This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
Custom nested mutations using @cypher on input fields #542
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.
This PR adds support for using the
@cypher
directive on INPUT_FIELD_DEFINITION, allowing for custom nested mutations that are translated using Cypher correlated subqueries, available in Neo4j version 4.1.Initial documentation: https://deploy-preview-60--distracted-golick-08ed24.netlify.app/docs/guide-graphql-schema-design#custom-nested-mutations
Node Mutation API Tests
Schema: https://github.com/michaeldgraham/neo4j-graphql-js/blob/master/test/helpers/custom/testSchema.js
Tests: https://github.com/michaeldgraham/neo4j-graphql-js/blob/master/test/unit/custom/cypherTest.test.js
Experimental API
As of PR #531, when
config.experimental = true
, the arguments for generated node mutations have an input object format. Nested@cypher
input fields also work for this more recent schema design option:Schema: https://github.com/michaeldgraham/neo4j-graphql-js/blob/master/test/helpers/experimental/custom/testSchema.js
Tests: https://github.com/michaeldgraham/neo4j-graphql-js/blob/master/test/unit/experimental/custom/cypherTest.test.js
This PR seems relevant to #89, #331, #532, and #539.
The #532 feature request will be updated to include designs for follow-up enhancements to the augmentation process based on this PR.
The PR #543 updates the initial design for this feature.