Commit c60be175 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'docs-graphql-negated-params' into 'master'

Document negated arguments

Closes #235115

See merge request gitlab-org/gitlab!41350
parents e1be418f 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment