@apollo/gateway 0.43.1 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +2 -4
  2. package/LICENSE +95 -0
  3. package/dist/executeQueryPlan.d.ts +2 -3
  4. package/dist/executeQueryPlan.d.ts.map +1 -1
  5. package/dist/executeQueryPlan.js +2 -27
  6. package/dist/executeQueryPlan.js.map +1 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +22 -41
  10. package/dist/index.js.map +1 -1
  11. package/package.json +7 -5
  12. package/src/__tests__/build-query-plan.feature +34 -24
  13. package/src/__tests__/buildQueryPlan.test.ts +76 -840
  14. package/src/__tests__/executeQueryPlan.test.ts +543 -537
  15. package/src/__tests__/execution-utils.ts +20 -26
  16. package/src/__tests__/gateway/lifecycle-hooks.test.ts +26 -4
  17. package/src/__tests__/gateway/reporting.test.ts +0 -14
  18. package/src/__tests__/integration/abstract-types.test.ts +40 -52
  19. package/src/__tests__/integration/boolean.test.ts +3 -1
  20. package/src/__tests__/integration/complex-key.test.ts +40 -55
  21. package/src/__tests__/integration/configuration.test.ts +5 -5
  22. package/src/__tests__/integration/custom-directives.test.ts +8 -2
  23. package/src/__tests__/integration/multiple-key.test.ts +10 -11
  24. package/src/__tests__/integration/requires.test.ts +2 -2
  25. package/src/__tests__/integration/scope.test.ts +19 -30
  26. package/src/__tests__/integration/value-types.test.ts +31 -31
  27. package/src/__tests__/loadSupergraphSdlFromStorage.test.ts +217 -142
  28. package/src/__tests__/queryPlanCucumber.test.ts +4 -18
  29. package/src/core/__tests__/core.test.ts +1 -0
  30. package/src/executeQueryPlan.ts +1 -32
  31. package/src/index.ts +39 -80
  32. package/src/utilities/__tests__/cleanErrorOfInaccessibleElements.test.ts +4 -4
  33. package/LICENSE.md +0 -21
  34. package/dist/core/index.d.ts +0 -13
  35. package/dist/core/index.d.ts.map +0 -1
  36. package/dist/core/index.js +0 -43
  37. package/dist/core/index.js.map +0 -1
  38. package/src/__tests__/build-query-plan-fragmentization.feature +0 -282
  39. package/src/core/index.ts +0 -51
@@ -72,15 +72,12 @@ describe('scope', () => {
72
72
  {
73
73
  topProducts {
74
74
  __typename
75
- ... on Car {
76
- name
75
+ name
76
+ ... on Shoe @include(if: true) {
77
77
  __typename
78
78
  upc
79
79
  }
80
- ... on Shoe {
81
- name
82
- }
83
- ... on Shoe @include(if: true) {
80
+ ... on Car {
84
81
  __typename
85
82
  upc
86
83
  }
@@ -180,17 +177,16 @@ describe('scope', () => {
180
177
  {
181
178
  topProducts {
182
179
  __typename
183
- ... on Car {
184
- name
180
+ name
181
+ ... on Shoe {
185
182
  __typename
186
183
  upc
187
184
  }
188
- ... on Shoe {
189
- name
185
+ ... on Shoe @include(if: true) {
190
186
  __typename
191
187
  upc
192
188
  }
193
- ... on Shoe @include(if: true) {
189
+ ... on Car {
194
190
  __typename
195
191
  upc
196
192
  }
@@ -297,17 +293,16 @@ describe('scope', () => {
297
293
  {
298
294
  topProducts {
299
295
  __typename
300
- ... on Car {
301
- name
296
+ name
297
+ ... on Shoe {
302
298
  __typename
303
299
  upc
304
300
  }
305
- ... on Shoe {
306
- name
301
+ ... on Shoe @include(if: true) {
307
302
  __typename
308
303
  upc
309
304
  }
310
- ... on Shoe @include(if: true) {
305
+ ... on Car {
311
306
  __typename
312
307
  upc
313
308
  }
@@ -412,15 +407,12 @@ describe('scope', () => {
412
407
  {
413
408
  topProducts {
414
409
  __typename
415
- ... on Car {
416
- name
410
+ name
411
+ ... on Shoe @include(if: true) {
417
412
  __typename
418
413
  upc
419
414
  }
420
- ... on Shoe {
421
- name
422
- }
423
- ... on Shoe @include(if: true) {
415
+ ... on Car {
424
416
  __typename
425
417
  upc
426
418
  }
@@ -518,20 +510,17 @@ describe('scope', () => {
518
510
  {
519
511
  topProducts {
520
512
  __typename
521
- ... on Car {
522
- name
523
- __typename
524
- upc
525
- }
526
- ... on Shoe {
527
- name
528
- }
513
+ name
529
514
  ... on Shoe @include(if: true) {
530
515
  ... on Shoe @skip(if: true) {
531
516
  __typename
532
517
  upc
533
518
  }
534
519
  }
520
+ ... on Car {
521
+ __typename
522
+ upc
523
+ }
535
524
  }
536
525
  }
537
526
  },
@@ -57,12 +57,13 @@ describe('value types', () => {
57
57
  {
58
58
  topProducts(first: 10) {
59
59
  __typename
60
+ upc
60
61
  ... on Book {
61
- upc
62
62
  __typename
63
63
  isbn
64
64
  }
65
65
  ... on Furniture {
66
+ __typename
66
67
  upc
67
68
  metadata {
68
69
  __typename
@@ -75,37 +76,11 @@ describe('value types', () => {
75
76
  message
76
77
  }
77
78
  }
78
- __typename
79
79
  }
80
80
  }
81
81
  }
82
82
  },
83
83
  Parallel {
84
- Flatten(path: "topProducts.@") {
85
- Fetch(service: "books") {
86
- {
87
- ... on Book {
88
- __typename
89
- isbn
90
- }
91
- } =>
92
- {
93
- ... on Book {
94
- metadata {
95
- __typename
96
- ... on KeyValue {
97
- key
98
- value
99
- }
100
- ... on Error {
101
- code
102
- message
103
- }
104
- }
105
- }
106
- }
107
- },
108
- },
109
84
  Flatten(path: "topProducts.@") {
110
85
  Fetch(service: "reviews") {
111
86
  {
@@ -152,6 +127,31 @@ describe('value types', () => {
152
127
  }
153
128
  },
154
129
  },
130
+ Flatten(path: "topProducts.@") {
131
+ Fetch(service: "books") {
132
+ {
133
+ ... on Book {
134
+ __typename
135
+ isbn
136
+ }
137
+ } =>
138
+ {
139
+ ... on Book {
140
+ metadata {
141
+ __typename
142
+ ... on KeyValue {
143
+ key
144
+ value
145
+ }
146
+ ... on Error {
147
+ code
148
+ message
149
+ }
150
+ }
151
+ }
152
+ }
153
+ },
154
+ },
155
155
  },
156
156
  },
157
157
  }
@@ -202,7 +202,7 @@ describe('value types', () => {
202
202
 
203
203
  type ValueType {
204
204
  id: ID!
205
- user: User! @provides(fields: "id name")
205
+ user: User! @provides(fields: "name")
206
206
  }
207
207
 
208
208
  extend type User @key(fields: "id") {
@@ -228,7 +228,7 @@ describe('value types', () => {
228
228
 
229
229
  type ValueType {
230
230
  id: ID!
231
- user: User! @provides(fields: "id name")
231
+ user: User! @provides(fields: "name")
232
232
  }
233
233
 
234
234
  extend type User @key(fields: "id") {
@@ -326,9 +326,9 @@ describe('value types', () => {
326
326
  valueType {
327
327
  id
328
328
  user {
329
+ __typename
329
330
  id
330
331
  name
331
- __typename
332
332
  }
333
333
  }
334
334
  }
@@ -355,9 +355,9 @@ describe('value types', () => {
355
355
  otherValueType {
356
356
  id
357
357
  user {
358
+ __typename
358
359
  id
359
360
  name
360
- __typename
361
361
  }
362
362
  }
363
363
  }