2019-07-11 04:06:35 -04:00
|
|
|
-# haml-lint:disable UnnecessaryStringOutput
|
|
|
|
|
|
|
|
= auto_generated_comment
|
|
|
|
|
|
|
|
:plain
|
|
|
|
# GraphQL API Resources
|
|
|
|
|
|
|
|
This documentation is self-generated based on GitLab current GraphQL schema.
|
|
|
|
|
|
|
|
The API can be explored interactively using the [GraphiQL IDE](../index.md#graphiql).
|
|
|
|
|
2020-01-31 01:08:59 -05:00
|
|
|
Each table below documents a GraphQL type. Types match loosely to models, but not all
|
|
|
|
fields and methods on a model are available via GraphQL.
|
2020-02-27 13:09:21 -05:00
|
|
|
|
2020-12-04 19:10:01 -05:00
|
|
|
WARNING:
|
2020-02-27 13:09:21 -05:00
|
|
|
Fields that are deprecated are marked with **{warning-solid}**.
|
2021-03-02 13:11:20 -05:00
|
|
|
Items (fields, enums, etc) that have been removed according to our [deprecation process](../index.md#deprecation-and-removal-process) can be found
|
2020-11-17 22:09:21 -05:00
|
|
|
in [Removed Items](../removed_items.md).
|
2021-02-11 01:09:17 -05:00
|
|
|
|
|
|
|
<!-- vale gitlab.Spelling = NO -->
|
2019-07-11 04:06:35 -04:00
|
|
|
\
|
2020-09-11 05:08:44 -04:00
|
|
|
|
2021-02-17 10:09:21 -05:00
|
|
|
:plain
|
2021-03-02 13:11:20 -05:00
|
|
|
## `Query` type
|
2021-02-17 10:09:21 -05:00
|
|
|
|
2021-03-02 13:11:20 -05:00
|
|
|
The `Query` type contains the API's top-level entry points for all executable queries.
|
2021-02-17 10:09:21 -05:00
|
|
|
\
|
|
|
|
|
|
|
|
- sorted_by_name(queries).each do |query|
|
2021-03-29 11:09:30 -04:00
|
|
|
= render_name_and_description(query, owner: 'Query')
|
2021-03-12 04:09:06 -05:00
|
|
|
\
|
|
|
|
= render_return_type(query)
|
2021-02-17 10:09:21 -05:00
|
|
|
- unless query[:arguments].empty?
|
2021-03-02 13:11:20 -05:00
|
|
|
~ "#### Arguments\n"
|
|
|
|
~ "| Name | Type | Description |"
|
|
|
|
~ "| ---- | ---- | ----------- |"
|
2021-02-17 10:09:21 -05:00
|
|
|
- sorted_by_name(query[:arguments]).each do |argument|
|
2021-03-29 11:09:30 -04:00
|
|
|
= render_field(argument, query[:type][:name])
|
2021-02-17 10:09:21 -05:00
|
|
|
\
|
|
|
|
|
2020-09-11 05:08:44 -04:00
|
|
|
:plain
|
|
|
|
## Object types
|
|
|
|
|
2020-12-16 16:09:57 -05:00
|
|
|
Object types represent the resources that the GitLab GraphQL API can return.
|
2020-09-11 05:08:44 -04:00
|
|
|
They contain _fields_. Each field has its own type, which will either be one of the
|
|
|
|
basic GraphQL [scalar types](https://graphql.org/learn/schema/#scalar-types)
|
|
|
|
(e.g.: `String` or `Boolean`) or other object types.
|
|
|
|
|
|
|
|
For more information, see
|
|
|
|
[Object Types and Fields](https://graphql.org/learn/schema/#object-types-and-fields)
|
|
|
|
on `graphql.org`.
|
|
|
|
\
|
|
|
|
|
2019-07-11 04:06:35 -04:00
|
|
|
- objects.each do |type|
|
|
|
|
- unless type[:fields].empty?
|
2020-09-11 05:08:44 -04:00
|
|
|
= render_name_and_description(type)
|
2021-03-12 04:09:06 -05:00
|
|
|
\
|
2020-09-11 05:08:44 -04:00
|
|
|
~ "| Field | Type | Description |"
|
|
|
|
~ "| ----- | ---- | ----------- |"
|
|
|
|
- sorted_by_name(type[:fields]).each do |field|
|
2021-03-29 11:09:30 -04:00
|
|
|
= render_field(field, type[:name])
|
2019-07-11 04:06:35 -04:00
|
|
|
\
|
2020-09-11 05:08:44 -04:00
|
|
|
|
|
|
|
:plain
|
|
|
|
## Enumeration types
|
|
|
|
|
|
|
|
Also called _Enums_, enumeration types are a special kind of scalar that
|
|
|
|
is restricted to a particular set of allowed values.
|
|
|
|
|
|
|
|
For more information, see
|
|
|
|
[Enumeration Types](https://graphql.org/learn/schema/#enumeration-types)
|
|
|
|
on `graphql.org`.
|
|
|
|
\
|
|
|
|
|
|
|
|
- enums.each do |enum|
|
|
|
|
- unless enum[:values].empty?
|
|
|
|
= render_name_and_description(enum)
|
2021-03-12 04:09:06 -05:00
|
|
|
\
|
2020-09-11 05:08:44 -04:00
|
|
|
~ "| Value | Description |"
|
|
|
|
~ "| ----- | ----------- |"
|
|
|
|
- sorted_by_name(enum[:values]).each do |value|
|
2021-03-29 11:09:30 -04:00
|
|
|
= render_enum_value(enum, value)
|
2020-09-11 05:08:44 -04:00
|
|
|
\
|
2021-03-12 04:09:06 -05:00
|
|
|
|
|
|
|
:plain
|
|
|
|
## Scalar types
|
|
|
|
|
|
|
|
Scalar values are atomic values, and do not have fields of their own.
|
|
|
|
Basic scalars include strings, boolean values, and numbers. This schema also
|
|
|
|
defines various custom scalar values, such as types for times and dates.
|
|
|
|
|
|
|
|
This schema includes custom scalar types for identifiers, with a specific type for
|
|
|
|
each kind of object.
|
|
|
|
|
|
|
|
For more information, read about [Scalar Types](https://graphql.org/learn/schema/#scalar-types) on `graphql.org`.
|
|
|
|
\
|
|
|
|
|
|
|
|
- graphql_scalar_types.each do |type|
|
|
|
|
= render_name_and_description(type)
|
|
|
|
\
|
|
|
|
|
|
|
|
:plain
|
|
|
|
## Abstract types
|
|
|
|
|
|
|
|
Abstract types (unions and interfaces) are ways the schema can represent
|
|
|
|
values that may be one of several concrete types.
|
|
|
|
|
|
|
|
- A [`Union`](https://graphql.org/learn/schema/#union-types) is a set of possible types.
|
|
|
|
The types might not have any fields in common.
|
|
|
|
- An [`Interface`](https://graphql.org/learn/schema/#interfaces) is a defined set of fields.
|
|
|
|
Types may `implement` an interface, which
|
|
|
|
guarantees that they have all the fields in the set. A type may implement more than
|
|
|
|
one interface.
|
|
|
|
|
|
|
|
See the [GraphQL documentation](https://graphql.org/learn/) for more information on using
|
|
|
|
abstract types.
|
|
|
|
\
|
|
|
|
|
|
|
|
:plain
|
|
|
|
### Unions
|
|
|
|
\
|
|
|
|
|
|
|
|
- graphql_union_types.each do |type|
|
2021-03-29 11:09:30 -04:00
|
|
|
= render_name_and_description(type, level: 4)
|
2021-03-12 04:09:06 -05:00
|
|
|
\
|
|
|
|
One of:
|
|
|
|
\
|
2021-03-29 11:09:30 -04:00
|
|
|
- type[:possible_types].each do |member|
|
|
|
|
= render_union_member(member)
|
2021-03-12 04:09:06 -05:00
|
|
|
\
|
|
|
|
|
|
|
|
:plain
|
|
|
|
### Interfaces
|
|
|
|
\
|
|
|
|
|
|
|
|
- graphql_interface_types.each do |type|
|
2021-03-29 11:09:30 -04:00
|
|
|
= render_name_and_description(type, level: 4)
|
2021-03-12 04:09:06 -05:00
|
|
|
\
|
|
|
|
Implementations:
|
|
|
|
\
|
|
|
|
- type[:implemented_by].each do |type_name|
|
|
|
|
~ "- [`#{type_name}`](##{type_name.downcase})"
|
|
|
|
\
|
|
|
|
~ "| Field | Type | Description |"
|
|
|
|
~ "| ----- | ---- | ----------- |"
|
|
|
|
- sorted_by_name(type[:fields] + type[:connections]).each do |field|
|
2021-03-29 11:09:30 -04:00
|
|
|
= render_field(field, type[:name])
|
2021-03-12 04:09:06 -05:00
|
|
|
\
|