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
dc267ace
Commit
dc267ace
authored
Sep 30, 2020
by
Jan Provaznik
Committed by
Bob Van Landuyt
Sep 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document negated arguments
Adds a note about usage of `not` argument.
parent
d95dbd59
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
doc/development/api_graphql_styleguide.md
doc/development/api_graphql_styleguide.md
+19
-0
No files found.
doc/development/api_graphql_styleguide.md
View file @
dc267ace
...
...
@@ -780,6 +780,25 @@ to advertise the need for lookahead:
For an example of real world use, please
see
[
`ResolvesMergeRequests`
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/graphql/resolvers/concerns/resolves_merge_requests.rb
)
.
### Negated arguments
Negated filters can filter some resources (for example, find all issues that
have the
`bug`
label, but don't have the
`bug2`
label assigned). The
`not`
argument is the preferred syntax to pass negated arguments:
```
graphql
issues(labelName:
"bug"
,
not:
{
labelName
:
"
bug2
"
}
)
{
nodes
{
id
title
}
}
```
To avoid duplicated argument definitions, you can place these arguments in a reusable module (or
class, if the arguments are nested). Alternatively, you can consider to add a
[
helper resolver method
](
https://gitlab.com/gitlab-org/gitlab/-/issues/258969
)
.
## Pass a parent object into a child Presenter
Sometimes you need to access the resolved query parent in a child context to compute fields. Usually the parent is only
...
...
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