Skip to content
代码片段 群组 项目
未验证 提交 cdcc26ab 编辑于 作者: Pavel Shutsin's avatar Pavel Shutsin 提交者: GitLab
浏览文件

Merge branch 'ld-docs-github-negated-helper' into 'master'

Document GraphQL negated helper

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/141730



Merged-by: default avatarPavel Shutsin <pshutsin@gitlab.com>
Approved-by: default avatarPavel Shutsin <pshutsin@gitlab.com>
Co-authored-by: default avatarLuke Duncalfe <lduncalfe@eml.cc>
No related branches found
No related tags found
加载中
...@@ -1461,9 +1461,19 @@ issues(labelName: "bug", not: {labelName: "bug2"}) { ...@@ -1461,9 +1461,19 @@ issues(labelName: "bug", not: {labelName: "bug2"}) {
} }
``` ```
To avoid duplicated argument definitions, you can place these arguments in a reusable module (or You can use the `negated` helper from `Gitlab::Graphql::NegatableArguments` in your type or resolver.
class, if the arguments are nested). Alternatively, you can consider to add a For example:
[helper resolver method](https://gitlab.com/gitlab-org/gitlab/-/issues/258969).
```ruby
extend ::Gitlab::Graphql::NegatableArguments
negated do
argument :labels, [GraphQL::STRING_TYPE],
required: false,
as: :label_name,
description: 'Array of label names. All resolved merge requests will not have these labels.'
end
```
### Metadata ### Metadata
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册