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
b4a65395
Commit
b4a65395
authored
Feb 04, 2020
by
Sean Arnold
Committed by
Evan Read
Feb 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature flag docs for GraphQL
parent
3153edd5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
doc/development/api_graphql_styleguide.md
doc/development/api_graphql_styleguide.md
+27
-0
No files found.
doc/development/api_graphql_styleguide.md
View file @
b4a65395
...
...
@@ -226,6 +226,33 @@ end
policies at once. The fields for these will all have be non-nullable
booleans with a default description.
## Feature flags
Features controlled by feature flags often provide GraphQL functionality. When a feature
is enabled or disabled by a feature flag, the related GraphQL functionality should also
be enabled or disabled.
Fields can be put behind a feature flag so they can conditionally return the value for
the field depending on if the feature has been enabled or not.
GraphQL feature flags use the common
[
GitLab feature flag
](
../development/feature_flags.md
)
system, and can be added to a
field using the
`feature_key`
property.
For example:
```
ruby
field
:test_field
,
type:
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Some test field'
,
feature_key: :some_feature_key
```
In the above example, the
`test_field`
field will only be returned if
the
`some_feature_key`
feature flag is enabled.
If the feature flag is not enabled, an error will be returned saying the field does not exist.
## Enums
GitLab GraphQL enums are defined in
`app/graphql/types`
. When defining new enums, 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