Skip to content Skip to sidebar Skip to footer

Designing The Db And State Mutations And Requests Of A Form Builder In React With Graphql, Faunadb, Nextjs & Apollo

I'm working on a next JS, React, Apollo, graphQL, faunaDB App. I am trying to architect how a form builder would work with it's mutations to fauna via graphQL. I am able to run mut

Solution 1:

If the root of the issue here is mutating or creating multiple documents at once, I think it got duplicated here:

https://stackoverflow.com/a/68930202/534056

A couple of things to watch out for:

  • Choose a name for your custom inputs that does not equal [type name] + Input. This is what Fauna uses for the auto-generated CRUD operations, and if you define one yourself the it will override the generated one. For example, given the type Form, Fauna will generate an input type called FormInput, so don't use that for a custom one.

  • If you want to pass an array of data as input, specify the argument as a List type (placed in square brackets).

  • If you are updating some documents, you will need to pass in the ID. The GraphQL API hides some details around Refs, so in your UDF, you will need to reconstruct the ref from an ID.

Post a Comment for "Designing The Db And State Mutations And Requests Of A Form Builder In React With Graphql, Faunadb, Nextjs & Apollo"