Closed
Description
GraphQL::Relay::Mutation
is really showing its age, and I'd like to replace it with a new class-based API for structuring mutations. I want to answer a few specific questions that have come up over the years. Here are some issues and the current best practice:
- How do you authorize a mutation? Current best practice is to put auth code at the top of the resolve function.
- How do you convert
id
s to objects in a consistent way? Current best practice is to load ids as needed. - How do you express errors to clients? No current best practice. Maybe top-level
"errors"
key, maybe return"errors":
as part of the mutation response, maybe a dedicatedClientError
type.
So, I have some thoughts about how to solve this which I will add below as a comment, and I'd love to hear if anyone else has other issues to consider or suggestions to propose.
Metadata
Metadata
Assignees
Labels
No labels