forked from apollographql/specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkotlin_labs-v0.1.graphql
41 lines (36 loc) · 2.48 KB
/
kotlin_labs-v0.1.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Marks a field or variable definition as optional or required
# By default Apollo Kotlin generates all variables of nullable types as optional, in compliance with the GraphQL specification,
# but this can be configured with this directive, because if the variable was added in the first place, it's usually to pass a value
directive @optional(if: Boolean = true) on FIELD | VARIABLE_DEFINITION
# Marks a field as non-null. The corresponding Kotlin property will be made non-nullable even if the GraphQL type is nullable.
# When used on an object definition in a schema document, `fields` must be non-empty and contain a selection set of fields that should be non-null
# When used on a field from an executable document, `fields` must always be empty
#
# Setting the directive at the schema level is usually easier as there is little reason that a field would be non-null in one place
# and null in the other
directive @nonnull(fields: String! = "") on OBJECT | FIELD
# Attach extra information to a given type
# `keyFields`: a selection set containing fields used to compute the cache key of an object. Order is important.
# `embeddedFields`: a selection set containing fields that shouldn't create a new cache Record and should be
# embedded in their parent instead. Order is unimportant.
directive @typePolicy(keyFields: String! = "", embeddedFields: String! = "") on OBJECT | INTERFACE | UNION
# Attach extra information to a given field
# `keyArgs`: a list of arguments used to compute the cache key of the object this field is pointing to.
# The list is parsed as a selection set: both spaces and comas are valid separators.
# `paginationArgs` (experimental): a list of arguments that vary when requesting different pages.
# These arguments are omitted when computing the cache key of this field.
# The list is parsed as a selection set: both spaces and comas are valid separators.
directive @fieldPolicy(forField: String!, keyArgs: String! = "", paginationArgs: String! = "") repeatable on OBJECT
"""
Indicates that the given field, argument, input field or enum value requires
giving explicit consent before being used.
"""
directive @requiresOptIn(feature: String!) repeatable
on FIELD_DEFINITION
| ARGUMENT_DEFINITION
| INPUT_FIELD_DEFINITION
| ENUM_VALUE
# Use the specified name for the enum value in the generated code.
# Use this for instance when the name would clash with a reserved keyword or field in the generated code.
# This directive is experimental.
directive @targetName(name: String!) on ENUM_VALUE