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 . They will be removed in a future release according to the GitLab deprecation process. Items that are experiments are marked with . 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_DEFINITIONENUM_VALUEFIELD_DEFINITIONINPUT_FIELD_DEFINITION
Arguments
| Name | Type | Description | Default |
|---|---|---|---|
reason | String | Explains 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
FIELDINLINE_FRAGMENT
Arguments
| Name | Type | Description |
|---|---|---|
version | String! | The version when this field was introduced (e.g. ‘18.1.0’). |
granularScope
Locations
FIELD_DEFINITIONOBJECT
This is a repeatable directive and can be used with different arguments at the same location.
Arguments
| Name | Type | Description |
|---|---|---|
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. |
boundary | String | Method 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). |
boundaryArgument | String | Argument name containing the authorization boundary (path or GlobalID). Use for mutations and query fields where the boundary is passed as an argument. |
boundaryType | PermissionBoundary | The 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. |
requirementGroup | String | Label 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. |
skipReason | String | Reason 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
FIELDFRAGMENT_SPREADINLINE_FRAGMENT
Arguments
| Name | Type | Description |
|---|---|---|
if | Boolean! | 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
FIELDFRAGMENT_SPREADINLINE_FRAGMENT
Arguments
| Name | Type | Description |
|---|---|---|
if | Boolean! | Skipped when true. |
specifiedBy
Exposes a URL that specifies the behavior of this scalar.
Locations
SCALAR
Arguments
| Name | Type | Description |
|---|---|---|
url | String! | The URL that specifies the behavior of this scalar. |