Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a53c4778
Commit
a53c4778
authored
Oct 29, 2020
by
Philip Cunningham
Committed by
charlie ablett
Oct 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs for deprecating EE GraphQL mutations
parent
88be2501
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
doc/development/api_graphql_styleguide.md
doc/development/api_graphql_styleguide.md
+5
-0
doc/development/ee_features.md
doc/development/ee_features.md
+32
-0
No files found.
doc/development/api_graphql_styleguide.md
View file @
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
)
.
...
...
doc/development/ee_features.md
View file @
a53c4778
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment