正式なドキュメントは英語版であり、この日本語訳はAI支援翻訳により作成された参考用のものです。日本語訳の一部の内容は人間によるレビューがまだ行われていないため、翻訳のタイミングにより英語版との間に差異が生じることがあります。最新かつ正確な情報については、英語版をご参照ください。
ドキュメントに関する現在のご利用体験についてお聞かせください。アンケートにご協力ください

GraphQL API Directives

A directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. For more information, see the GraphQL directive documentation.

WARNING: Deprecated items are marked with warning . They will be removed in a future release according to the GitLab deprecation process. Items that are experiments are marked with work-item-test-case . Experimental items can change at any time and are not recommended for use in production.

deprecated

Marks an element of a GraphQL schema as no longer supported.

Locations

  • ARGUMENT_DEFINITION
  • ENUM_VALUE
  • FIELD_DEFINITION
  • INPUT_FIELD_DEFINITION

Arguments

NameTypeDescriptionDefault
reasonStringExplains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in Markdown."No longer supported"

gl_introduced

Marks a field as introduced in a specific version. Fields tagged with the current milestone or a later one return null when the field is absent from the schema.

Locations

  • FIELD
  • INLINE_FRAGMENT

Arguments

NameTypeDescription
versionString!The version when this field was introduced (e.g. ‘18.1.0’).

granularScope

Locations

  • FIELD_DEFINITION
  • OBJECT

This is a repeatable directive and can be used with different arguments at the same location.

Arguments

NameTypeDescription
assignableWhen[String!]Conditions the current user must meet for the permissions to be offered in the token creation UI. Not a security control: the type, mutation, or field must still enforce the conditions. Valid values: admin, gitlab_team_member, saas, self_managed.
boundaryStringMethod name to call on the resolved object to extract the authorization boundary (Project/Group). Use when the object is already resolved (fields on types, nested fields).
boundaryArgumentStringArgument name containing the authorization boundary (path or GlobalID). Use for mutations and query fields where the boundary is passed as an argument.
boundaryTypePermissionBoundaryThe type of authorization boundary (project, group, user, instance). Used for validation and documentation of the permission boundary.
permissions[String!]Granular scope permissions required to access the field or type.
requirementGroupStringLabel grouping directives that are alternative boundaries for the same requirement. The token must be authorized on any one boundary in a group, and on every group. Absent means the primary group. Set for a second container, such as a move target.
skipReasonStringReason the field or type intentionally opts out of granular token authorization.

include

Directs the executor to include this field or fragment only when the if argument is true.

Locations

  • FIELD
  • FRAGMENT_SPREAD
  • INLINE_FRAGMENT

Arguments

NameTypeDescription
ifBoolean!Included when true.

oneOf

Requires that exactly one field must be supplied and that field must not be null.

Locations

  • INPUT_OBJECT

skip

Directs the executor to skip this field or fragment when the if argument is true.

Locations

  • FIELD
  • FRAGMENT_SPREAD
  • INLINE_FRAGMENT

Arguments

NameTypeDescription
ifBoolean!Skipped when true.

specifiedBy

Exposes a URL that specifies the behavior of this scalar.

Locations

  • SCALAR

Arguments

NameTypeDescription
urlString!The URL that specifies the behavior of this scalar.