You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
The next step with the experimental mutation API for nested mutations is to generate relationship field arguments for the data input objects. New input object types would be generated for these, containing nested arguments such as create, connect, update, merge, and delete. The types of these mutation-arguments would also be new input objects, containing the now supported where and / or data arguments.
Experiemntal augmentation results for the nested mutation support of the User node mutation API would be:
input_UserData {
idField: IDname: Stringbirthday: _Neo4jDateTimeInputuniqueString: StringindexedInt: IntextensionString: Stringrated: _UserRatedMutation
}
input_UserRatedMutation {
# Create a Movie Node related with a User node for the RATING relationshipcreate: [_CreateUserRatedMovie]
# connect: ...
}
input_CreateUserRatedMovie {
# require the .rating relationship property because it is non-null on Ratingrating: Int! # require providing data for the Movie to be created and related with a Usermovie: _MovieData!
}
input_MovieData {
title: String!ratedBy: _MovieRatedByMutation
}
# ...
The translation process would pick these arguments up and recursively generate a Cypher operation composed of Cypher subqueries, to be executed before the generated Cypher for the RETURN statement corresponding to the mutation's GraphQL selection set.
mutation {
CreateUser(
data: {
name: "Michael",
# new relationship input fieldrated: {
# create a Movie node and add a relationship with itcreate: {
rating: 10,
movie: {
title: "The Matrix"
}
}
}
}
) {
# selection setnamerated {
ratingmovie {
title
}
}
}
}
Nested mutation input fields
For the input objects generated for relationship field arguments to be added to node mutations:
Node
.create
Creates a node of the related type, and a relationship with it. Arguments would be the same as data.
.update
Updates matching nodes of the related type. Would use where and data sub-arguments.
.merge
Creates or updates a node of the related type, and a relationship with it. Would use where and data sub-arguments.
.delete
Deletes matching nodes of the related type. Arguments would be the same as where.
Relationship
.connect
Creates a relationship with matching nodes of the related type. Arguments would be the same as where.
.disconnect
Deletes relationships with matching nodes of the related type. Arguments would be the same as where.
Possible nested sequences
The following minimal nested combinations would be possible to generate. Any more complex pattern would be composed of pairs of these combinations. Moving forward, each combination needs to be assessed to identify requirements and strategies for translation. Custom errors may be useful / necessary for patterns that don't make sense under certain conditions.
So starting off, one might...
Create a node, then... create, update, merge, delete, connect, or disconnect...
Update a node, then... create, update, merge, delete, connect, or disconnect...
Delete a node, then... create, update, merge, delete, connect, or disconnect...
Merge a node, then... create, update, merge, delete, connect, or disconnect...
This feature request will be progressively updated with more implementation details regarding generated input types and custom error scenarios.
Nested mutations
The next step with the experimental mutation API for nested mutations is to generate relationship field arguments for the
data
input objects. New input object types would be generated for these, containing nested arguments such ascreate
,connect
,update
,merge
, anddelete
. The types of these mutation-arguments would also be new input objects, containing the now supportedwhere
and / ordata
arguments.Given the following schema:
Experiemntal augmentation results for the nested mutation support of the
User
node mutation API would be:The translation process would pick these arguments up and recursively generate a Cypher operation composed of Cypher subqueries, to be executed before the generated Cypher for the
RETURN
statement corresponding to the mutation's GraphQL selection set.Nested mutation input fields
For the input objects generated for relationship field arguments to be added to node mutations:
Node
.create
Creates a node of the related type, and a relationship with it. Arguments would be the same as
data
..update
Updates matching nodes of the related type. Would use
where
anddata
sub-arguments..merge
Creates or updates a node of the related type, and a relationship with it. Would use
where
anddata
sub-arguments..delete
Deletes matching nodes of the related type. Arguments would be the same as
where
.Relationship
.connect
Creates a relationship with matching nodes of the related type. Arguments would be the same as
where
..disconnect
Deletes relationships with matching nodes of the related type. Arguments would be the same as
where
.Possible nested sequences
The following minimal nested combinations would be possible to generate. Any more complex pattern would be composed of pairs of these combinations. Moving forward, each combination needs to be assessed to identify requirements and strategies for translation. Custom errors may be useful / necessary for patterns that don't make sense under certain conditions.
So starting off, one might...
Create
a node, then...create
,update
,merge
,delete
,connect
, ordisconnect
...Update
a node, then...create
,update
,merge
,delete
,connect
, ordisconnect
...Delete
a node, then...create
,update
,merge
,delete
,connect
, ordisconnect
...Merge
a node, then...create
,update
,merge
,delete
,connect
, ordisconnect
...This feature request will be progressively updated with more implementation details regarding generated input types and custom error scenarios.
This feature request is relevant to #89 and #331.
The text was updated successfully, but these errors were encountered: