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
7e341e92
Commit
7e341e92
authored
Jun 24, 2020
by
Luke Duncalfe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document GraphQL mount_aliased_mutation method
https://gitlab.com/gitlab-org/gitlab/-/issues/223815
parent
bc48b173
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
doc/development/api_graphql_styleguide.md
doc/development/api_graphql_styleguide.md
+28
-0
No files found.
doc/development/api_graphql_styleguide.md
View file @
7e341e92
...
...
@@ -1012,6 +1012,34 @@ to make sure the error information we are passing back is useful.
See also the
[
frontend GraphQL guide
](
../development/fe_guide/graphql.md#handling-errors
)
.
### Aliasing and deprecating mutations
The
`#mount_aliased_mutation`
helper allows us to alias a mutation as
another name within
`MutationType`
.
For example, to alias a mutation called
`FooMutation`
as
`BarMutation`
:
```
ruby
mount_aliased_mutation
'BarMutation'
,
Mutations
::
FooMutation
```
This allows us to rename a mutation and continue to support the old name,
when coupled with the
[
`deprecated`
](
#deprecating-fields
)
argument.
Example:
```
ruby
mount_aliased_mutation
'UpdateFoo'
,
Mutations
::
Foo
::
Update
,
deprecated:
{
reason:
'Use fooUpdate'
,
milestone:
'13.2'
}
```
Deprecated mutations should be added to
`Types::DeprecatedMutations`
and
tested for within the unit test of
`Types::MutationType`
. The merge request
[
!34798
](
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34798
)
can be referred to as an example of this, including the method of testing
deprecated aliased mutations.
## Validating arguments
For validations of single arguments, use the
...
...
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