Skip to content

New Mutation API Brainstorming  #1275

Closed
@rmosolgo

Description

@rmosolgo

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 ids 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 dedicated ClientError 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions