Hello
I would to understand the best practices while creating Query or Mutation
For Mutation :
In this tutorial they advise to use this kind of output for mutation Adding a mutation to our schema - GraphQL Tutorials :
“Similar to HTTP status code, represents the status of the mutation”
code: Int!
“Indicates whether the mutation was successful”
success: Boolean!
“Human-readable message for the UI”
message: String!
“Newly updated track after a successful mutation”
track: Track
Can i use the above outputs for queries and mutations? Why?
Should i use different outputs for queries and mutations? Why?
Also I think i have read that the client useQuery rely on the Id to manage the Graphql cache.
The mutation also gives an output with IDs so i guess it is also used in the graphql cache but if the outputs are different, how useQuery and useMutation knows where is the ID field in the output or which field/IDs they have to use in the cache?
How works the graphql cache?
Does the type of outputs would change the way how the cache is managed?
What output should i use to avoid to break useQuery and useMutation hooks behavior?
Thank you for your help