Skip to content

Commit 94dcf38

Browse files
committed
test: add tests for executable descriptions
1 parent 61ccda9 commit 94dcf38

32 files changed

+172
-4
lines changed

crates/apollo-compiler/test_data/ok/0001_annonymous_operation_definition.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ ExecutableDocument {
9898
operations: OperationMap {
9999
anonymous: Some(
100100
1..31 @3 Operation {
101+
description: None,
101102
operation_type: Query,
102103
name: None,
103104
variables: [],

crates/apollo-compiler/test_data/ok/0002_multiple_named_operation_definitions.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ ExecutableDocument {
133133
anonymous: None,
134134
named: {
135135
"getCatName": 0..41 @4 Operation {
136+
description: None,
136137
operation_type: Query,
137138
name: Some(
138139
"getCatName",
@@ -189,6 +190,7 @@ ExecutableDocument {
189190
},
190191
},
191192
"getOwnerName": 43..106 @4 Operation {
193+
description: None,
192194
operation_type: Query,
193195
name: Some(
194196
"getOwnerName",

crates/apollo-compiler/test_data/ok/0010_operation_with_defined_fields.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ ExecutableDocument {
252252
anonymous: None,
253253
named: {
254254
"getProduct": 0..68 @12 Operation {
255+
description: None,
255256
operation_type: Query,
256257
name: Some(
257258
"getProduct",

crates/apollo-compiler/test_data/ok/0011_fragment_spreads_in_fragment_definitions.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ ExecutableDocument {
122122
anonymous: None,
123123
named: {
124124
"IntrospectionQuery": 0..51 @13 Operation {
125+
description: None,
125126
operation_type: Query,
126127
name: Some(
127128
"IntrospectionQuery",
@@ -166,6 +167,7 @@ ExecutableDocument {
166167
},
167168
fragments: {
168169
"Bar": 53..100 @13 Fragment {
170+
description: None,
169171
name: "Bar",
170172
directives: [],
171173
selection_set: SelectionSet {
@@ -203,6 +205,7 @@ ExecutableDocument {
203205
},
204206
},
205207
"Quux": 102..131 @13 Fragment {
208+
description: None,
206209
name: "Quux",
207210
directives: [],
208211
selection_set: SelectionSet {

crates/apollo-compiler/test_data/ok/0012_introspection_query.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ExecutableDocument {
7878
anonymous: None,
7979
named: {
8080
"IntrospectionQuery": 0..271 @14 Operation {
81+
description: None,
8182
operation_type: Query,
8283
name: Some(
8384
"IntrospectionQuery",
@@ -418,6 +419,7 @@ ExecutableDocument {
418419
},
419420
fragments: {
420421
"FullType": 272..723 @14 Fragment {
422+
description: None,
421423
name: "FullType",
422424
directives: [],
423425
selection_set: SelectionSet {
@@ -924,6 +926,7 @@ ExecutableDocument {
924926
},
925927
},
926928
"InputValue": 724..821 @14 Fragment {
929+
description: None,
927930
name: "InputValue",
928931
directives: [],
929932
selection_set: SelectionSet {
@@ -1026,6 +1029,7 @@ ExecutableDocument {
10261029
},
10271030
},
10281031
"TypeRef": 822..1265 @14 Fragment {
1032+
description: None,
10291033
name: "TypeRef",
10301034
directives: [],
10311035
selection_set: SelectionSet {

crates/apollo-compiler/test_data/ok/0013_operation_with_used_variable_in_fragment.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,14 @@ ExecutableDocument {
210210
anonymous: None,
211211
named: {
212212
"ExampleQuery": 0..81 @15 Operation {
213+
description: None,
213214
operation_type: Query,
214215
name: Some(
215216
"ExampleQuery",
216217
),
217218
variables: [
218219
19..33 @15 VariableDefinition {
220+
description: None,
219221
name: "variable",
220222
ty: 30..33 @15 Named(
221223
"Int",
@@ -294,6 +296,7 @@ ExecutableDocument {
294296
},
295297
fragments: {
296298
"subFrag": 83..163 @15 Fragment {
299+
description: None,
297300
name: "subFrag",
298301
directives: [],
299302
selection_set: SelectionSet {

crates/apollo-compiler/test_data/ok/0016_same_variables_in_multiple_operations.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,14 @@ ExecutableDocument {
146146
anonymous: None,
147147
named: {
148148
"A": 0..61 @18 Operation {
149+
description: None,
149150
operation_type: Query,
150151
name: Some(
151152
"A",
152153
),
153154
variables: [
154155
8..30 @18 VariableDefinition {
156+
description: None,
155157
name: "atOtherHomes",
156158
ty: 23..30 @18 Named(
157159
"Boolean",
@@ -174,12 +176,14 @@ ExecutableDocument {
174176
},
175177
},
176178
"B": 63..124 @18 Operation {
179+
description: None,
177180
operation_type: Query,
178181
name: Some(
179182
"B",
180183
),
181184
variables: [
182185
71..93 @18 VariableDefinition {
186+
description: None,
183187
name: "atOtherHomes",
184188
ty: 86..93 @18 Named(
185189
"Boolean",
@@ -205,6 +209,7 @@ ExecutableDocument {
205209
},
206210
fragments: {
207211
"HouseTrainedFragment": 126..228 @18 Fragment {
212+
description: None,
208213
name: "HouseTrainedFragment",
209214
directives: [],
210215
selection_set: SelectionSet {

crates/apollo-compiler/test_data/ok/0017_variables_are_input_types.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,14 @@ ExecutableDocument {
225225
anonymous: None,
226226
named: {
227227
"takesBoolean": 0..106 @19 Operation {
228+
description: None,
228229
operation_type: Query,
229230
name: Some(
230231
"takesBoolean",
231232
),
232233
variables: [
233234
19..41 @19 VariableDefinition {
235+
description: None,
234236
name: "atOtherHomes",
235237
ty: 34..41 @19 Named(
236238
"Boolean",
@@ -307,12 +309,14 @@ ExecutableDocument {
307309
},
308310
},
309311
"takesComplexInput": 108..213 @19 Operation {
312+
description: None,
310313
operation_type: Query,
311314
name: Some(
312315
"takesComplexInput",
313316
),
314317
variables: [
315318
132..159 @19 VariableDefinition {
319+
description: None,
316320
name: "complexInput",
317321
ty: 147..159 @19 Named(
318322
"ComplexInput",
@@ -389,12 +393,14 @@ ExecutableDocument {
389393
},
390394
},
391395
"TakesListOfBooleanBang": 215..311 @19 Operation {
396+
description: None,
392397
operation_type: Query,
393398
name: Some(
394399
"TakesListOfBooleanBang",
395400
),
396401
variables: [
397402
244..265 @19 VariableDefinition {
403+
description: None,
398404
name: "booleans",
399405
ty: 255..265 @19 List(
400406
NonNullNamed(

crates/apollo-compiler/test_data/ok/0018_non_clashing_names.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ ExecutableDocument {
117117
anonymous: None,
118118
named: {
119119
"A": 173..203 @20 Operation {
120+
description: None,
120121
operation_type: Query,
121122
name: Some(
122123
"A",
@@ -161,6 +162,7 @@ ExecutableDocument {
161162
},
162163
fragments: {
163164
"A": 148..171 @20 Fragment {
165+
description: None,
164166
name: "A",
165167
directives: [],
166168
selection_set: SelectionSet {

crates/apollo-compiler/test_data/ok/0020_merge_identical_fields.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ ExecutableDocument {
111111
anonymous: None,
112112
named: {
113113
"queryPupper": 76..175 @22 Operation {
114+
description: None,
114115
operation_type: Query,
115116
name: Some(
116117
"queryPupper",
@@ -161,6 +162,7 @@ ExecutableDocument {
161162
},
162163
fragments: {
163164
"mergeIdenticalFields": 177..231 @22 Fragment {
165+
description: None,
164166
name: "mergeIdenticalFields",
165167
directives: [],
166168
selection_set: SelectionSet {
@@ -212,6 +214,7 @@ ExecutableDocument {
212214
},
213215
},
214216
"mergeIdenticalAliasesAndFields": 233..319 @22 Fragment {
217+
description: None,
215218
name: "mergeIdenticalAliasesAndFields",
216219
directives: [],
217220
selection_set: SelectionSet {

0 commit comments

Comments
 (0)