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
1ebbcfa9
Commit
1ebbcfa9
authored
May 21, 2020
by
Luke Duncalfe
Committed by
Evan Read
May 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation of GraphQL API copy_field_description helper
parent
c3e64742
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
doc/development/api_graphql_styleguide.md
doc/development/api_graphql_styleguide.md
+17
-0
No files found.
doc/development/api_graphql_styleguide.md
View file @
1ebbcfa9
...
...
@@ -470,6 +470,23 @@ field :confidential, GraphQL::BOOLEAN_TYPE, description: 'Indicates the issue is
field
:closed_at
,
Types
::
TimeType
,
description:
'Timestamp of when the issue was closed'
```
### `copy_field_description` helper
Sometimes we want to ensure that two descriptions will always be identical.
For example, to keep a type field description the same as a mutation argument
when they both represent the same property.
Instead of supplying a description, we can use the
`copy_field_description`
helper,
passing it the type, and field name to copy the description of.
Example:
```
ruby
argument
:title
,
GraphQL
::
STRING_TYPE
,
required:
false
,
description:
copy_field_description
(
Types
::
MergeRequestType
,
:title
)
```
## Authorization
Authorizations can be applied to both types and fields using the same
...
...
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