Skip to content
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

Merged
merged 15 commits into from
Nov 18, 2020
Merged

Custom nested mutations using @cypher on input fields #542

merged 15 commits into from
Nov 18, 2020

Conversation

michaeldgraham
Copy link
Collaborator

@michaeldgraham michaeldgraham commented Nov 15, 2020

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.

@michaeldgraham michaeldgraham changed the title Custom nested mutations using @cypher on INPUT_FIELD_DEFINITION Custom nested mutations using @cypher on input fields Nov 16, 2020
@johnymontana johnymontana merged commit e2825f9 into neo4j-graphql:master Nov 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants