Commit efcc4347 authored by charlie ablett's avatar charlie ablett

Merge branch 'add-documentation-for-deprecating-ee-mutations-250635' into 'master'

Add docs for deprecating EE GraphQL mutations

See merge request gitlab-org/gitlab!46340
parents f375c51b a53c4778
...@@ -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