Commit a53c4778 authored by Philip Cunningham's avatar Philip Cunningham Committed by charlie ablett

Add docs for deprecating EE GraphQL mutations

parent 88be2501
...@@ -1273,6 +1273,11 @@ tested for within the unit test of `Types::MutationType`. The merge request ...@@ -1273,6 +1273,11 @@ tested for within the unit test of `Types::MutationType`. The merge request
can be referred to as an example of this, including the method of testing can be referred to as an example of this, including the method of testing
deprecated aliased mutations. deprecated aliased mutations.
#### Deprecating EE mutations
EE mutations should follow the same process. For an example of the merge request
process, read [merge request !42588](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42588).
## Pagination implementation ## Pagination implementation
To learn more, visit [GraphQL pagination](graphql_guide/pagination.md). To learn more, visit [GraphQL pagination](graphql_guide/pagination.md).
......
...@@ -426,6 +426,38 @@ module EE ...@@ -426,6 +426,38 @@ module EE
end end
``` ```
### Code in `app/graphql/`
EE-specific mutations, resolvers, and types should be added to
`ee/app/graphql/{mutations,resolvers,types}`.
To override a CE mutation, resolver, or type, create the file in
`ee/app/graphql/ee/{mutations,resolvers,types}` and add new code to a
`prepended` block.
For example, if CE has a mutation called `Mutations::Tanukis::Create` and you
wanted to add a new argument, place the EE override in
`ee/app/graphql/ee/mutations/tanukis/create.rb`:
```ruby
module EE
module Mutations
module Tanukis
module Create
extend ActiveSupport::Concern
prepended do
argument :name,
GraphQL::STRING_TYPE,
required: false,
description: 'Tanuki name'
end
end
end
end
end
```
#### Using `render_if_exists` #### Using `render_if_exists`
Instead of using regular `render`, we should use `render_if_exists`, which Instead of using regular `render`, we should use `render_if_exists`, which
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment