Expose what mutations can be performed on a resource in GraphQL

We could define what mutations can be performed on a resource like this

class Types::MergeRequestType
  available_mutations Mutations::MergeRequests::WipMutation, Mutations::MergeRequests::MergeMutation #, ...
end

That could then expose those mutations by their GraphQL name, and a boolean indicating whether or not the current user can perform that mutation on the resource.


The following discussion from !20443 (merged) should be addressed:

  • @DouweM started a discussion: (+2 comments)

    What is the GraphQL way of communicating to the API consumer that a specific mutation is available to them, when they query the MR for example?

    This is somewhat related to our conversation about exposing abilities.