Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-24-2019 02:15 AM
We're using neo4j-graphql-js. It's absolutly incredible tool. Managing a database and API thru a simple Schema is amazing approach. Thank you so much for that. We're huge fan.
I'm trying to figurate how to do a simple mutation which involve 2 mutations. Let me explain:
When I do CreateMyType() mutation, it's always followed by a mutation addMyType1ParentType() to link the created node to a related node. This example is show the most simple case but often, there's more than 2 mutations (as there's many link and node creation related to the creation of one node) which needs to be done in one requests from the front end.
I'm wondering how you plan to make such mutations easier. I've to plan with my dev team the best approach to do that.
Would it be to write custom resolvers which will be in charge to receive one "call" from the frontend, and then, do the few mutations with existing mutations created by neo4j-graphql-js, and respond to the frontend whatever is needed ?
Or what would you suggest?
Also, in the background of this question, there's the notion of transaction. If one mutation fail, all should fail.
This demand is quite urgent for us.
Thank you so much
Jonas
09-24-2019 09:01 AM
Hi @jonasdumas -
Currently, the options are:
@cypher
schema directive on a mutation field with the logic for creating the node and relationship in a single Cypher query. Since the logic is defined in a single Cypher query it will execute in a single transaction.Eventually, we plan to add nested mutations that would allow for much more complex operations using the auto-generated mutations, similar to this example. However this is not yet implemented.
09-27-2019 04:09 PM
Hi @William_Lyon im new to neo4j in general neo4j-graphql.js is looking very interesting for integrating with graphql.
Is there a feature roadmap somewhere that we can refer to?
09-25-2019 06:41 AM
Thank you so much for your quick answer.
Very clear. I see better the approach to use to be efficient.
Looking forward to see upcoming features!
Any rough idea when theses two upcoming features will be available?
All the sessions of the conference are now available online