You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes and additions to schema introspection, for comparative fuzzing (#899)
* Align descriptions of built-ins with graphql-js. This makes comparating testing of introspection possible
* includeDeprecated argument is nullable
* Introspection: serialize defaultValue without indentation. Align with graphql-js
* Introspection: that field is called specifiedByURL, not specifiedBy
* Introspection: __Type.possibleTypes only includes object types. If an interface type implements another interface, it is not listed here
* Convenience for introspection fuzzing
* Introspection: as a precaution, validate unconditionally newly crafted executable documents, rather than only with debug assertions
Copy file name to clipboardExpand all lines: crates/apollo-compiler/src/built_in_types.graphql
+48-18Lines changed: 48 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,19 @@
1
+
"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations."
1
2
type__Schema {
2
3
description: String
4
+
"A list of all types supported by this server."
3
5
types: [__Type!]!
6
+
"The type that query operations will be rooted at."
4
7
queryType: __Type!
8
+
"If this server supports mutation, the type that mutation operations will be rooted at."
5
9
mutationType: __Type
10
+
"If this server support subscription, the type that subscription operations will be rooted at."
6
11
subscriptionType: __Type
12
+
"A list of all directives supported by this server."
7
13
directives: [__Directive!]!
8
14
}
9
15
16
+
"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types."
10
17
type__Type {
11
18
kind: __TypeKind!
12
19
name: String
@@ -27,17 +34,27 @@ type __Type {
27
34
specifiedByURL: String
28
35
}
29
36
37
+
"An enum describing what kind of type a given `__Type` is."
30
38
enum__TypeKind {
39
+
"Indicates this type is a scalar."
31
40
SCALAR
41
+
"Indicates this type is an object. `fields` and `interfaces` are valid fields."
32
42
OBJECT
43
+
"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."
33
44
INTERFACE
45
+
"Indicates this type is a union. `possibleTypes` is a valid field."
34
46
UNION
47
+
"Indicates this type is an enum. `enumValues` is a valid field."
35
48
ENUM
49
+
"Indicates this type is an input object. `inputFields` is a valid field."
36
50
INPUT_OBJECT
51
+
"Indicates this type is a list. `ofType` is a valid field."
37
52
LIST
53
+
"Indicates this type is a non-null. `ofType` is a valid field."
38
54
NON_NULL
39
55
}
40
56
57
+
"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type."
41
58
type__Field {
42
59
name: String!
43
60
description: String
@@ -47,22 +64,26 @@ type __Field {
47
64
deprecationReason: String
48
65
}
49
66
67
+
"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value."
50
68
type__InputValue {
51
69
name: String!
52
70
description: String
53
71
type: __Type!
72
+
"A GraphQL-formatted string representing the default value for this input value."
54
73
defaultValue: String
55
74
isDeprecated: Boolean!
56
75
deprecationReason: String
57
76
}
58
77
78
+
"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string."
59
79
type__EnumValue {
60
80
name: String!
61
81
description: String
62
82
isDeprecated: Boolean!
63
83
deprecationReason: String
64
84
}
65
85
86
+
"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor."
66
87
type__Directive {
67
88
name: String!
68
89
description: String
@@ -71,25 +92,45 @@ type __Directive {
71
92
isRepeatable: Boolean!
72
93
}
73
94
95
+
"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies."
74
96
enum__DirectiveLocation {
97
+
"Location adjacent to a query operation."
75
98
QUERY
99
+
"Location adjacent to a mutation operation."
76
100
MUTATION
101
+
"Location adjacent to a subscription operation."
77
102
SUBSCRIPTION
103
+
"Location adjacent to a field."
78
104
FIELD
105
+
"Location adjacent to a fragment definition."
79
106
FRAGMENT_DEFINITION
107
+
"Location adjacent to a fragment spread."
80
108
FRAGMENT_SPREAD
109
+
"Location adjacent to an inline fragment."
81
110
INLINE_FRAGMENT
111
+
"Location adjacent to a variable definition."
82
112
VARIABLE_DEFINITION
113
+
"Location adjacent to a schema definition."
83
114
SCHEMA
115
+
"Location adjacent to a scalar definition."
84
116
SCALAR
117
+
"Location adjacent to an object type definition."
85
118
OBJECT
119
+
"Location adjacent to a field definition."
86
120
FIELD_DEFINITION
121
+
"Location adjacent to an argument definition."
87
122
ARGUMENT_DEFINITION
123
+
"Location adjacent to an interface definition."
88
124
INTERFACE
125
+
"Location adjacent to a union definition."
89
126
UNION
127
+
"Location adjacent to an enum definition."
90
128
ENUM
129
+
"Location adjacent to an enum value definition."
91
130
ENUM_VALUE
131
+
"Location adjacent to an input object type definition."
92
132
INPUT_OBJECT
133
+
"Location adjacent to an input object field definition."
93
134
INPUT_FIELD_DEFINITION
94
135
}
95
136
@@ -108,47 +149,36 @@ directive @include(
108
149
"Marks an element of a GraphQL schema as no longer supported."
109
150
directive@deprecated(
110
151
"""
111
-
Explains why this element was deprecated, usually also including a
112
-
suggestion for how to access supported similar data. Formatted using
113
-
the Markdown syntax, as specified by
114
-
[CommonMark](https://commonmark.org/).
152
+
Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).
"Exposes a URL that specifies the behaviour of this scalar."
157
+
"Exposes a URL that specifies the behavior of this scalar."
120
158
directive@specifiedBy(
121
-
"The URL that specifies the behaviour of this scalar."
159
+
"The URL that specifies the behavior of this scalar."
122
160
url: String!
123
161
) onSCALAR
124
162
125
163
"""
126
-
The `Int` scalar type represents non-fractional signed whole numeric values. Int
127
-
can represent values between -(2^31) and 2^31 - 1.
164
+
The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
128
165
"""
129
166
scalarInt
130
167
131
168
"""
132
-
The `Float` scalar type represents signed double-precision fractional values as
133
-
specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
169
+
The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
134
170
"""
135
171
scalarFloat
136
172
137
173
"""
138
-
The `String` scalar type represents textual data, represented as UTF-8 character
139
-
sequences. The String type is most often used by GraphQL to represent free-form
140
-
human-readable text.
174
+
The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
141
175
"""
142
176
scalarString
143
177
144
178
"The `Boolean` scalar type represents `true` or `false`."
145
179
scalarBoolean
146
180
147
181
"""
148
-
The `ID` scalar type represents a unique identifier, often used to refetch an
149
-
object or as key for a cache. The ID type appears in a JSON response as a
150
-
String; however, it is not intended to be human-readable. When expected as an
151
-
input type, any string (such as `\"4\"`) or integer (such as `4`) input value
152
-
will be accepted as an ID.
182
+
The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
0 commit comments