This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
Input object argument format for mutation API #531
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
now used by both the normal and experimental augmentation tests
michaeldgraham
added
the
Needs docs
Document the features added in this PR better
label
Oct 31, 2020
This was referenced Nov 1, 2020
michaeldgraham
removed
the
Needs docs
Document the features added in this PR better
label
Nov 1, 2020
Codecov Report
|
#524: unified the translation of nested orderBy arguments for relationship fields into translateNestedOrderingArgument, fixed schemaType argument to be innerSchemaType, for call in relationFieldOnNodeType #495: uses parentIsListArgument to buildNeo4jTypeTranslation, to appropriately translate temporal filters used within OR / AND list filters
this results in letting the cypher error pass through, caused by datetime(""), if an empty string is provided for a .formatted argument
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Experimental Mutation API
This PR adds initial support for generating input object arguments for node and relationship mutations. A documentation update preview is available at: https://deploy-preview-59--distracted-golick-08ed24.netlify.app/docs/graphql-schema-generation-augmentation#experimental-api.
To prevent breaking changes moving forward, the new API is available under this configuration flag:
Example schema
In the below schema, we have a
User
type and aMovie
type. Each has an@id
field along with at least one other@unique
or@index
field:Node mutations
In the new mutation API design, the following node mutations are generated for the
User
type:The
_UserWhere
input object is generated for node selection, containing the same arguments geneated forfilter
in the query API, for all@id
,@unique
, and@index
fields on theUser
type:The
_UserData
input object is generated for providing property values when creating, updating, or merging aUser
type node:Relationship mutations
These
Where
input objects with complex filtering arguments are also used by relationship mutations to select source and target nodes. The following relationship field mutations are generated for theUser
type:Using multiple keys
In alignment with the "Input object arguments" sub-section of the "Future design considerations" section in PR #499, initial behavior is to use all
@id
,@unique
, and@index
fields on a node type when generating its correspondingwhere
argument input object. When using assertSchema to set property indexes and uniqueness constraints, this should provide a way to ensure that available complex node selection arguments are performant.Merge node mutations
Because the Cypher
MERGE
clause cannot be combined withWHERE
, complex filtering arguments (_not
,_in
, etc.) are not generated for thewhere
input objects used by merge node mutations. But multiple keys can still be used. So, merge mutationwhere
input objects contain arguments for any@id
,@unique
, and@index
fields, with no additional custom filters added.For the below
MergeUser
mutation:The
_UserKeys
input objects is generated specifically for it:Tests
Tests for experimental API have been added to test/unit/experimental:
Augmentation
Translation
Node
Relationship
This should resolve #516.
This PR also fixes #495 and fixes #524.