@apollo/gateway 2.0.0-preview.7 → 2.0.0
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.
- package/dist/config.d.ts +2 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/supergraphManagers/IntrospectAndCompose/index.d.ts +1 -1
- package/dist/supergraphManagers/IntrospectAndCompose/index.d.ts.map +1 -1
- package/dist/supergraphManagers/LegacyFetcher/index.d.ts +1 -1
- package/dist/supergraphManagers/LegacyFetcher/index.d.ts.map +1 -1
- package/dist/supergraphManagers/LocalCompose/index.d.ts +1 -1
- package/dist/supergraphManagers/LocalCompose/index.d.ts.map +1 -1
- package/dist/supergraphManagers/UplinkFetcher/index.d.ts +1 -1
- package/dist/supergraphManagers/UplinkFetcher/index.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/__tests__/buildQueryPlan.test.ts +51 -4
- package/src/__tests__/execution-utils.ts +3 -2
- package/src/__tests__/gateway/endToEnd.test.ts +363 -40
- package/src/__tests__/gateway/executor.test.ts +1 -1
- package/src/__tests__/gateway/lifecycle-hooks.test.ts +2 -2
- package/src/__tests__/gateway/reporting.test.ts +5 -0
- package/src/__tests__/gateway/supergraphSdl.test.ts +1 -1
- package/src/__tests__/integration/complex-key.test.ts +1 -6
- package/src/__tests__/integration/configuration.test.ts +1 -1
- package/src/__tests__/integration/logger.test.ts +1 -1
- package/src/__tests__/integration/networkRequests.test.ts +1 -1
- package/src/config.ts +2 -4
- package/src/core/__tests__/core.test.ts +8 -8
- package/src/index.ts +1 -1
- package/src/supergraphManagers/IntrospectAndCompose/__tests__/IntrospectAndCompose.test.ts +1 -1
- package/src/supergraphManagers/IntrospectAndCompose/index.ts +1 -1
- package/src/supergraphManagers/LegacyFetcher/index.ts +1 -1
- package/src/supergraphManagers/LocalCompose/index.ts +1 -1
- package/src/supergraphManagers/UplinkFetcher/index.ts +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { GraphQLError, GraphQLSchema } from 'graphql';
|
|
2
2
|
import { HeadersInit } from 'node-fetch';
|
|
3
3
|
import { fetch } from 'apollo-server-env';
|
|
4
|
-
import { GraphQLRequestContextExecutionDidStart
|
|
4
|
+
import { GraphQLRequestContextExecutionDidStart } from 'apollo-server-types';
|
|
5
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
5
6
|
import { GraphQLDataSource } from './datasources/types';
|
|
6
7
|
import { QueryPlan } from '@apollo/query-planner';
|
|
7
8
|
import { OperationContext } from './operationContext';
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,sCAAsC,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,O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C,MAAM,EAAE,aAAa,GACpB,MAAM,IAAI,gCAAgC,CAE5C;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,aAAa,GACpB,MAAM,IAAI,8BAA8B,CAI1C;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,aAAa,GACpB,MAAM,IAAI,8BAA8B,CAM1C;AAID,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,GACpB,MAAM,IAAI,4BAA4B,CAQxC;AAGD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,GACpB,MAAM,IAAI,oBAAoB,CAShC;AAGD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,aAAa,GACpB,MAAM,IAAI,mBAAmB,CAE/B"}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;AAoFA,SAAgB,qBAAqB,CACnC,MAAyB;IAEzB,OAAO,eAAe,IAAI,MAAM,CAAC;AACnC,CAAC;AAJD,sDAIC;AAED,SAAgB,yBAAyB,CACvC,MAAyB;IAEzB,OAAO,aAAa,IAAI,MAAM,CAAC;AACjC,CAAC;AAJD,8DAIC;AAiGD,SAAgB,2CAA2C,CACzD,MAAqB;IAErB,OAAO,yBAAyB,CAAC,MAAM,CAAC,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAChF,CAAC;AAJD,kGAIC;AAyED,SAAgB,aAAa,CAC3B,MAAqB;IAErB,OAAO,kBAAkB,IAAI,MAAM,CAAC;AACtC,CAAC;AAJD,sCAIC;AAGD,SAAgB,mBAAmB,CACjC,MAAqB;IAErB,OAAO,aAAa,IAAI,MAAM,CAAC;AACjC,CAAC;AAJD,kDAIC;AAED,SAAgB,2BAA2B,CACzC,MAAqB;IAErB,OAAO,eAAe,IAAI,MAAM,IAA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,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Logger } from 'apollo
|
|
1
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
2
2
|
import { HeadersInit } from 'node-fetch';
|
|
3
3
|
import { ServiceEndpointDefinition } from '../..';
|
|
4
4
|
import { SupergraphManager, SupergraphSdlHookOptions } from '../../config';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/IntrospectAndCompose/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/IntrospectAndCompose/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EACL,yBAAyB,EAG1B,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAI3E,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,yBAAyB,EAAE,CAAC;IACvC,oBAAoB,CAAC,EACjB,WAAW,GACX,CAAC,CACC,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAOD,qBAAa,oBAAqB,YAAW,iBAAiB;IAC5D,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,MAAM,CAAC,CAA8B;IAC7C,OAAO,CAAC,WAAW,CAAC,CAA8B;IAClD,OAAO,CAAC,SAAS,CAAC,CAAY;IAC9B,OAAO,CAAC,eAAe,CAAkC;IACzD,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,KAAK,CAAQ;gBAET,OAAO,EAAE,2BAA2B;IAKnC,UAAU,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,wBAAwB;;;;YA2C1E,mBAAmB;IAsBjC,OAAO,CAAC,gCAAgC;IAexC,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,IAAI;IAqBZ,OAAO,CAAC,gBAAgB;CAMzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Logger } from 'apollo
|
|
1
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
2
2
|
import { SupergraphManager, SupergraphSdlHookOptions, DynamicGatewayConfig } from '../../config';
|
|
3
3
|
import { Experimental_UpdateComposition } from '../..';
|
|
4
4
|
export interface LegacyFetcherOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/LegacyFetcher/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/LegacyFetcher/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EAKrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,8BAA8B,EAG/B,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,wBAAwB,EAAE,8BAA8B,CAAC;IACzD,aAAa,EAAE,oBAAoB,CAAC;CACrC;AAOD,qBAAa,aAAc,YAAW,iBAAiB;IACrD,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,MAAM,CAAC,CAA8B;IAC7C,OAAO,CAAC,WAAW,CAAC,CAA8B;IAClD,OAAO,CAAC,aAAa,CAAC,CAAwB;IAC9C,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,kBAAkB,CAAC,CAAsB;gBAErC,OAAO,EAAE,oBAAoB;IAMzC,OAAO,CAAC,wBAAwB;IAcnB,UAAU,CAAC,EACtB,MAAM,EACN,WAAW,EACX,aAAa,GACd,EAAE,wBAAwB;;;;YAuCb,mBAAmB;IAwBjC,OAAO,CAAC,mBAAmB;IA+B3B,OAAO,CAAC,+BAA+B;IA2BvC,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,IAAI;IAqBZ,OAAO,CAAC,gBAAgB;CAMzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Logger } from 'apollo
|
|
1
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
2
2
|
import { SupergraphSdlHookOptions, SupergraphManager } from '../../config';
|
|
3
3
|
import { ServiceDefinition } from '@apollo/federation-internals';
|
|
4
4
|
export interface LocalComposeOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/LocalCompose/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/LocalCompose/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAEL,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;CACvC;AAED,qBAAa,YAAa,YAAW,iBAAiB;IACpD,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,aAAa,CAAC,CAAwB;gBAElC,OAAO,EAAE,mBAAmB;IAKxC,OAAO,CAAC,wBAAwB;IAMnB,UAAU,CAAC,EAAE,aAAa,EAAE,EAAE,wBAAwB;;;IAgBnE,OAAO,CAAC,+BAA+B;IA0BvC,OAAO,CAAC,gBAAgB;CAMzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fetch } from 'apollo-server-env';
|
|
2
|
-
import { Logger } from 'apollo
|
|
2
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
3
3
|
import { SupergraphManager, SupergraphSdlHookOptions } from '../../config';
|
|
4
4
|
export interface UplinkFetcherOptions {
|
|
5
5
|
fallbackPollIntervalInMs: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkFetcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supergraphManagers/UplinkFetcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAI3E,MAAM,WAAW,oBAAoB;IACnC,wBAAwB,EAAE,MAAM,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,KAAK,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAOD,qBAAa,aAAc,YAAW,iBAAiB;IACrD,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,MAAM,CAAC,CAA8B;IAC7C,OAAO,CAAC,WAAW,CAAC,CAA8B;IAClD,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,sBAAsB,CACkC;IAChE,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,iBAAiB,CAAqB;gBAElC,OAAO,EAAE,oBAAoB;IAK5B,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,wBAAwB;;;;YAyC3D,mBAAmB;IAwBjC,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,IAAI;IA+BZ,OAAO,CAAC,gBAAgB;CAMzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apollo/gateway",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Apollo Gateway",
|
|
5
5
|
"author": "Apollo <packages@apollographql.com>",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,16 +18,17 @@
|
|
|
18
18
|
"apollo"
|
|
19
19
|
],
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=12.13.0 <
|
|
21
|
+
"node": ">=12.13.0 <18.0"
|
|
22
22
|
},
|
|
23
23
|
"license": "SEE LICENSE IN ./LICENSE",
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@apollo/composition": "^2.0.0
|
|
29
|
-
"@apollo/core-schema": "
|
|
30
|
-
"@apollo/query-planner": "^2.0.0
|
|
28
|
+
"@apollo/composition": "^2.0.0",
|
|
29
|
+
"@apollo/core-schema": "~0.2.3",
|
|
30
|
+
"@apollo/query-planner": "^2.0.0",
|
|
31
|
+
"@apollo/utils.logger": "^1.0.0",
|
|
31
32
|
"@josephg/resolvable": "^1.0.1",
|
|
32
33
|
"@opentelemetry/api": "^1.0.1",
|
|
33
34
|
"@types/node-fetch": "2.6.1",
|
|
@@ -37,7 +38,6 @@
|
|
|
37
38
|
"apollo-server-env": "^3.0.0 || ^4.0.0",
|
|
38
39
|
"apollo-server-errors": "^2.5.0 || ^3.0.0",
|
|
39
40
|
"apollo-server-types": "^0.9.0 || ^3.0.0",
|
|
40
|
-
"apollo-utilities": "^1.3.0",
|
|
41
41
|
"async-retry": "^1.3.3",
|
|
42
42
|
"loglevel": "^1.6.1",
|
|
43
43
|
"make-fetch-happen": "^8.0.0",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"graphql": "^16.0.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "d6e3b48536de475c2f0ad491b3d30b456a5940e1"
|
|
51
51
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
astSerializer,
|
|
3
|
+
queryPlanSerializer,
|
|
4
|
+
} from 'apollo-federation-integration-testsuite';
|
|
2
5
|
import { getFederatedTestingSchema } from './execution-utils';
|
|
3
6
|
import { QueryPlan, QueryPlanner } from '@apollo/query-planner';
|
|
4
7
|
import { Schema, parseOperation } from '@apollo/federation-internals';
|
|
@@ -6,14 +9,13 @@ import { Schema, parseOperation } from '@apollo/federation-internals';
|
|
|
6
9
|
expect.addSnapshotSerializer(astSerializer);
|
|
7
10
|
expect.addSnapshotSerializer(queryPlanSerializer);
|
|
8
11
|
|
|
9
|
-
|
|
10
12
|
describe('buildQueryPlan', () => {
|
|
11
13
|
let schema: Schema;
|
|
12
14
|
let queryPlanner: QueryPlanner;
|
|
13
15
|
|
|
14
16
|
const buildPlan = (operation: string): QueryPlan => {
|
|
15
17
|
return queryPlanner.buildQueryPlan(parseOperation(schema, operation));
|
|
16
|
-
}
|
|
18
|
+
};
|
|
17
19
|
|
|
18
20
|
beforeEach(() => {
|
|
19
21
|
expect(
|
|
@@ -515,7 +517,7 @@ describe('buildQueryPlan', () => {
|
|
|
515
517
|
|
|
516
518
|
describe(`when requesting a composite field with subfields from another service`, () => {
|
|
517
519
|
it(`should add key fields to the parent selection set and use a dependent fetch`, () => {
|
|
518
|
-
|
|
520
|
+
const operationString = `#graphql
|
|
519
521
|
query {
|
|
520
522
|
topReviews {
|
|
521
523
|
body
|
|
@@ -1171,4 +1173,49 @@ describe('buildQueryPlan', () => {
|
|
|
1171
1173
|
`);
|
|
1172
1174
|
});
|
|
1173
1175
|
});
|
|
1176
|
+
|
|
1177
|
+
describe('overridden fields and type', () => {
|
|
1178
|
+
it(`query plan of overridden field`, () => {
|
|
1179
|
+
const operationString = `#graphql
|
|
1180
|
+
query {
|
|
1181
|
+
library (id: "3") {
|
|
1182
|
+
name
|
|
1183
|
+
description
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
`;
|
|
1187
|
+
|
|
1188
|
+
const queryPlan = buildPlan(operationString);
|
|
1189
|
+
expect(queryPlan).toMatchInlineSnapshot(`
|
|
1190
|
+
QueryPlan {
|
|
1191
|
+
Sequence {
|
|
1192
|
+
Fetch(service: "books") {
|
|
1193
|
+
{
|
|
1194
|
+
library(id: 3) {
|
|
1195
|
+
__typename
|
|
1196
|
+
id
|
|
1197
|
+
name
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
},
|
|
1201
|
+
Flatten(path: "library") {
|
|
1202
|
+
Fetch(service: "accounts") {
|
|
1203
|
+
{
|
|
1204
|
+
... on Library {
|
|
1205
|
+
__typename
|
|
1206
|
+
id
|
|
1207
|
+
}
|
|
1208
|
+
} =>
|
|
1209
|
+
{
|
|
1210
|
+
... on Library {
|
|
1211
|
+
description
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
},
|
|
1215
|
+
},
|
|
1216
|
+
},
|
|
1217
|
+
}
|
|
1218
|
+
`);
|
|
1219
|
+
});
|
|
1220
|
+
});
|
|
1174
1221
|
});
|
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
GraphQLSchemaModule,
|
|
4
4
|
GraphQLResolverMap,
|
|
5
5
|
} from '../schema-helper';
|
|
6
|
-
import { GraphQLRequest, GraphQLExecutionResult
|
|
6
|
+
import { GraphQLRequest, GraphQLExecutionResult } from 'apollo-server-types';
|
|
7
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
7
8
|
import { buildSubgraphSchema } from '@apollo/subgraph';
|
|
8
9
|
import {
|
|
9
10
|
executeQueryPlan,
|
|
@@ -11,7 +12,7 @@ import {
|
|
|
11
12
|
} from '@apollo/gateway';
|
|
12
13
|
import { QueryPlan, QueryPlanner } from '@apollo/query-planner';
|
|
13
14
|
import { LocalGraphQLDataSource } from '../datasources/LocalGraphQLDataSource';
|
|
14
|
-
import { mergeDeep } from 'apollo
|
|
15
|
+
import { mergeDeep } from '@apollo/client/utilities';
|
|
15
16
|
|
|
16
17
|
import { queryPlanSerializer, astSerializer } from 'apollo-federation-integration-testsuite';
|
|
17
18
|
import gql from 'graphql-tag';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { buildSubgraphSchema } from '@apollo/subgraph';
|
|
2
2
|
import { ApolloServer } from 'apollo-server';
|
|
3
|
-
import fetch from 'node-fetch';
|
|
3
|
+
import fetch, { Response } from 'node-fetch';
|
|
4
4
|
import { ApolloGateway } from '../..';
|
|
5
5
|
import { fixtures } from 'apollo-federation-integration-testsuite';
|
|
6
6
|
import { ApolloServerPluginInlineTrace } from 'apollo-server-core';
|
|
7
7
|
import { GraphQLSchemaModule } from '../../schema-helper';
|
|
8
|
+
import { buildSchema, ObjectType, ServiceDefinition } from '@apollo/federation-internals';
|
|
9
|
+
import gql from 'graphql-tag';
|
|
10
|
+
import { printSchema } from 'graphql';
|
|
8
11
|
|
|
9
12
|
async function startFederatedServer(modules: GraphQLSchemaModule[]) {
|
|
10
13
|
const schema = buildSubgraphSchema(modules);
|
|
@@ -17,34 +20,49 @@ async function startFederatedServer(modules: GraphQLSchemaModule[]) {
|
|
|
17
20
|
return { url, server };
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
let backendServers: ApolloServer[];
|
|
24
|
+
let gateway: ApolloGateway;
|
|
25
|
+
let gatewayServer: ApolloServer;
|
|
26
|
+
let gatewayUrl: string;
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
({ url: gatewayUrl } = await gatewayServer.listen({ port: 0 }));
|
|
28
|
+
async function startServicesAndGateway(servicesDefs: ServiceDefinition[]) {
|
|
29
|
+
backendServers = [];
|
|
30
|
+
const serviceList = [];
|
|
31
|
+
for (const serviceDef of servicesDefs) {
|
|
32
|
+
const { server, url } = await startFederatedServer([serviceDef]);
|
|
33
|
+
backendServers.push(server);
|
|
34
|
+
serviceList.push({ name: serviceDef.name, url });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
gateway = new ApolloGateway({ serviceList });
|
|
38
|
+
gatewayServer = new ApolloServer({
|
|
39
|
+
gateway,
|
|
39
40
|
});
|
|
41
|
+
({ url: gatewayUrl } = await gatewayServer.listen({ port: 0 }));
|
|
42
|
+
}
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
44
|
+
async function queryGateway(query: string): Promise<Response> {
|
|
45
|
+
return fetch(gatewayUrl, {
|
|
46
|
+
method: 'POST',
|
|
47
|
+
headers: {
|
|
48
|
+
'Content-Type': 'application/json',
|
|
49
|
+
},
|
|
50
|
+
body: JSON.stringify({ query }),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
afterEach(async () => {
|
|
55
|
+
for (const server of backendServers) {
|
|
56
|
+
await server.stop();
|
|
57
|
+
}
|
|
58
|
+
if (gatewayServer) {
|
|
59
|
+
await gatewayServer.stop();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe('caching', () => {
|
|
64
|
+
beforeEach(async () => {
|
|
65
|
+
await startServicesAndGateway(fixtures);
|
|
48
66
|
});
|
|
49
67
|
|
|
50
68
|
it(`cache control`, async () => {
|
|
@@ -62,13 +80,7 @@ describe('end-to-end', () => {
|
|
|
62
80
|
}
|
|
63
81
|
`;
|
|
64
82
|
|
|
65
|
-
const response = await
|
|
66
|
-
method: 'POST',
|
|
67
|
-
headers: {
|
|
68
|
-
'Content-Type': 'application/json',
|
|
69
|
-
},
|
|
70
|
-
body: JSON.stringify({ query }),
|
|
71
|
-
});
|
|
83
|
+
const response = await queryGateway(query);
|
|
72
84
|
const result = await response.json();
|
|
73
85
|
expect(result).toMatchInlineSnapshot(`
|
|
74
86
|
Object {
|
|
@@ -122,13 +134,7 @@ describe('end-to-end', () => {
|
|
|
122
134
|
}
|
|
123
135
|
`;
|
|
124
136
|
|
|
125
|
-
const response = await
|
|
126
|
-
method: 'POST',
|
|
127
|
-
headers: {
|
|
128
|
-
'Content-Type': 'application/json',
|
|
129
|
-
},
|
|
130
|
-
body: JSON.stringify({ query }),
|
|
131
|
-
});
|
|
137
|
+
const response = await queryGateway(query);
|
|
132
138
|
const result = await response.json();
|
|
133
139
|
expect(result).toMatchInlineSnapshot(`
|
|
134
140
|
Object {
|
|
@@ -164,3 +170,320 @@ describe('end-to-end', () => {
|
|
|
164
170
|
expect(response.headers.get('cache-control')).toBe(null);
|
|
165
171
|
});
|
|
166
172
|
});
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Tests for a number of specific features end-to-end.
|
|
176
|
+
* Note that those features have (or at least should have) much thorough test coverage in the various places
|
|
177
|
+
* that handle them more directly, and those tests largely duplicate other test, but it's meant to ensure we
|
|
178
|
+
* have basic end-to-end testing, thus ensuring those feature don't break in places we didn't expect.
|
|
179
|
+
*/
|
|
180
|
+
describe('end-to-end features', () => {
|
|
181
|
+
it('@tag renaming', async () => {
|
|
182
|
+
const subgraphA = {
|
|
183
|
+
name: 'A',
|
|
184
|
+
url: 'https://A',
|
|
185
|
+
typeDefs: gql`
|
|
186
|
+
extend schema
|
|
187
|
+
@link(
|
|
188
|
+
url: "https://specs.apollo.dev/federation/v2.0",
|
|
189
|
+
import: [ "@key", { name: "@tag", as: "@federationTag"} ]
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
type Query {
|
|
193
|
+
t: T
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
type T @key(fields: "k") {
|
|
197
|
+
k: ID
|
|
198
|
+
x: Int @federationTag(name: "Important")
|
|
199
|
+
}
|
|
200
|
+
`,
|
|
201
|
+
resolvers: {
|
|
202
|
+
Query: {
|
|
203
|
+
t: () => ({
|
|
204
|
+
k: 42,
|
|
205
|
+
x: 1
|
|
206
|
+
}),
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const subgraphB = {
|
|
212
|
+
name: 'B',
|
|
213
|
+
url: 'https://B',
|
|
214
|
+
typeDefs: gql`
|
|
215
|
+
extend schema
|
|
216
|
+
@link(
|
|
217
|
+
url: "https://specs.apollo.dev/federation/v2.0",
|
|
218
|
+
import: [ "@key", { name: "@tag", as: "@federationTag"} ]
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
type T @key(fields: "k") {
|
|
222
|
+
k: ID
|
|
223
|
+
y: Int @federationTag(name: "Less Important")
|
|
224
|
+
}
|
|
225
|
+
`,
|
|
226
|
+
resolvers: {
|
|
227
|
+
T: {
|
|
228
|
+
__resolveReference: ({ k }: { k: string }) => {
|
|
229
|
+
return k === '42' ? ({ y: 2 }) : undefined;
|
|
230
|
+
},
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
await startServicesAndGateway([subgraphA, subgraphB]);
|
|
236
|
+
|
|
237
|
+
const query = `
|
|
238
|
+
{
|
|
239
|
+
t {
|
|
240
|
+
x
|
|
241
|
+
y
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
`;
|
|
245
|
+
|
|
246
|
+
const response = await queryGateway(query);
|
|
247
|
+
const result = await response.json();
|
|
248
|
+
expect(result).toMatchInlineSnapshot(`
|
|
249
|
+
Object {
|
|
250
|
+
"data": Object {
|
|
251
|
+
"t": Object {
|
|
252
|
+
"x": 1,
|
|
253
|
+
"y": 2,
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
}
|
|
257
|
+
`);
|
|
258
|
+
|
|
259
|
+
const supergraphSdl = gateway.__testing().supergraphSdl;
|
|
260
|
+
expect(supergraphSdl).toBeDefined();
|
|
261
|
+
const supergraph = buildSchema(supergraphSdl!);
|
|
262
|
+
const typeT = supergraph.type('T') as ObjectType;
|
|
263
|
+
expect(typeT.field('x')?.appliedDirectivesOf('federationTag').toString()).toStrictEqual('@federationTag(name: "Important")');
|
|
264
|
+
expect(typeT.field('y')?.appliedDirectivesOf('federationTag').toString()).toStrictEqual('@federationTag(name: "Less Important")');
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('handles fed1 schema', async () => {
|
|
268
|
+
const subgraphA = {
|
|
269
|
+
name: 'A',
|
|
270
|
+
url: 'https://A',
|
|
271
|
+
typeDefs: gql`
|
|
272
|
+
type Query {
|
|
273
|
+
t: T
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
type T @key(fields: "k") {
|
|
277
|
+
k: ID
|
|
278
|
+
x: Int
|
|
279
|
+
}
|
|
280
|
+
`,
|
|
281
|
+
resolvers: {
|
|
282
|
+
Query: {
|
|
283
|
+
t: () => ({
|
|
284
|
+
k: 42,
|
|
285
|
+
x: 1
|
|
286
|
+
}),
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
const subgraphB = {
|
|
292
|
+
name: 'B',
|
|
293
|
+
url: 'https://B',
|
|
294
|
+
typeDefs: gql`
|
|
295
|
+
type T @key(fields: "k") {
|
|
296
|
+
k: ID
|
|
297
|
+
y: Int
|
|
298
|
+
}
|
|
299
|
+
`,
|
|
300
|
+
resolvers: {
|
|
301
|
+
T: {
|
|
302
|
+
__resolveReference: ({ k }: { k: string }) => {
|
|
303
|
+
return k === '42' ? ({ y: 2 }) : undefined;
|
|
304
|
+
},
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
await startServicesAndGateway([subgraphA, subgraphB]);
|
|
310
|
+
|
|
311
|
+
const query = `
|
|
312
|
+
{
|
|
313
|
+
t {
|
|
314
|
+
x
|
|
315
|
+
y
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
`;
|
|
319
|
+
|
|
320
|
+
const response = await queryGateway(query);
|
|
321
|
+
const result = await response.json();
|
|
322
|
+
expect(result).toMatchInlineSnapshot(`
|
|
323
|
+
Object {
|
|
324
|
+
"data": Object {
|
|
325
|
+
"t": Object {
|
|
326
|
+
"x": 1,
|
|
327
|
+
"y": 2,
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
}
|
|
331
|
+
`);
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it('removals of @inaccessible', async () => {
|
|
335
|
+
const subgraphA = {
|
|
336
|
+
name: 'A',
|
|
337
|
+
url: 'https://A',
|
|
338
|
+
typeDefs: gql`
|
|
339
|
+
extend schema
|
|
340
|
+
@link(
|
|
341
|
+
url: "https://specs.apollo.dev/federation/v2.0",
|
|
342
|
+
import: [ "@key", "@shareable", "@inaccessible"]
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
type Query {
|
|
346
|
+
t: T
|
|
347
|
+
f(e: E): Int
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
enum E {
|
|
351
|
+
FOO
|
|
352
|
+
BAR @inaccessible
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
type T @key(fields: "k") {
|
|
356
|
+
k: ID
|
|
357
|
+
a: Int @inaccessible
|
|
358
|
+
b: Int
|
|
359
|
+
c: String @shareable
|
|
360
|
+
}
|
|
361
|
+
`,
|
|
362
|
+
resolvers: {
|
|
363
|
+
Query: {
|
|
364
|
+
t: () => ({
|
|
365
|
+
k: 42,
|
|
366
|
+
a: 1,
|
|
367
|
+
b: 2,
|
|
368
|
+
c: 3,
|
|
369
|
+
}),
|
|
370
|
+
f: (_: any, args: any) => {
|
|
371
|
+
return args.e === 'FOO' ? 0 : 1;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
const subgraphB = {
|
|
378
|
+
name: 'B',
|
|
379
|
+
url: 'https://B',
|
|
380
|
+
typeDefs: gql`
|
|
381
|
+
extend schema
|
|
382
|
+
@link(
|
|
383
|
+
url: "https://specs.apollo.dev/federation/v2.0",
|
|
384
|
+
import: [ "@key", "@shareable", "@inaccessible" ]
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
type T @key(fields: "k") {
|
|
388
|
+
k: ID
|
|
389
|
+
c: String @shareable @inaccessible
|
|
390
|
+
d: String
|
|
391
|
+
}
|
|
392
|
+
`,
|
|
393
|
+
resolvers: {
|
|
394
|
+
T: {
|
|
395
|
+
__resolveReference: ({ k }: { k: string }) => {
|
|
396
|
+
return k === '42' ? ({ c: 'foo', d: 'bar' }) : undefined;
|
|
397
|
+
},
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
await startServicesAndGateway([subgraphA, subgraphB]);
|
|
403
|
+
|
|
404
|
+
const q1 = `
|
|
405
|
+
{
|
|
406
|
+
t {
|
|
407
|
+
b
|
|
408
|
+
d
|
|
409
|
+
}
|
|
410
|
+
f(e: FOO)
|
|
411
|
+
}
|
|
412
|
+
`;
|
|
413
|
+
|
|
414
|
+
const resp1 = await queryGateway(q1);
|
|
415
|
+
const res1 = await resp1.json();
|
|
416
|
+
expect(res1).toMatchInlineSnapshot(`
|
|
417
|
+
Object {
|
|
418
|
+
"data": Object {
|
|
419
|
+
"f": 0,
|
|
420
|
+
"t": Object {
|
|
421
|
+
"b": 2,
|
|
422
|
+
"d": "bar",
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
}
|
|
426
|
+
`);
|
|
427
|
+
|
|
428
|
+
// Make sure the exposed API doesn't have any @inaccessible elements.
|
|
429
|
+
expect(printSchema(gateway.schema!)).toMatchInlineSnapshot(`
|
|
430
|
+
"enum E {
|
|
431
|
+
FOO
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
type Query {
|
|
435
|
+
t: T
|
|
436
|
+
f(e: E): Int
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
type T {
|
|
440
|
+
k: ID
|
|
441
|
+
b: Int
|
|
442
|
+
d: String
|
|
443
|
+
}"
|
|
444
|
+
`);
|
|
445
|
+
|
|
446
|
+
// Lastly, make sure querying inaccessible things is rejected
|
|
447
|
+
const q2 = `
|
|
448
|
+
{
|
|
449
|
+
f(e: BAR)
|
|
450
|
+
}
|
|
451
|
+
`;
|
|
452
|
+
const resp2 = await queryGateway(q2);
|
|
453
|
+
const res2 = await resp2.json();
|
|
454
|
+
expect(res2).toMatchInlineSnapshot(`
|
|
455
|
+
Object {
|
|
456
|
+
"errors": Array [
|
|
457
|
+
Object {
|
|
458
|
+
"extensions": Object {
|
|
459
|
+
"code": "GRAPHQL_VALIDATION_FAILED",
|
|
460
|
+
},
|
|
461
|
+
"message": "Value \\"BAR\\" does not exist in \\"E\\" enum.",
|
|
462
|
+
},
|
|
463
|
+
],
|
|
464
|
+
}
|
|
465
|
+
`);
|
|
466
|
+
|
|
467
|
+
const q3 = `
|
|
468
|
+
{
|
|
469
|
+
t {
|
|
470
|
+
a
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
`;
|
|
474
|
+
const resp3 = await queryGateway(q3);
|
|
475
|
+
const res3 = await resp3.json();
|
|
476
|
+
expect(res3).toMatchInlineSnapshot(`
|
|
477
|
+
Object {
|
|
478
|
+
"errors": Array [
|
|
479
|
+
Object {
|
|
480
|
+
"extensions": Object {
|
|
481
|
+
"code": "GRAPHQL_VALIDATION_FAILED",
|
|
482
|
+
},
|
|
483
|
+
"message": "Cannot query field \\"a\\" on type \\"T\\". Did you mean \\"b\\", \\"d\\", or \\"k\\"?",
|
|
484
|
+
},
|
|
485
|
+
],
|
|
486
|
+
}
|
|
487
|
+
`);
|
|
488
|
+
});
|
|
489
|
+
})
|
|
@@ -2,7 +2,7 @@ import { fetch } from '../../__mocks__/make-fetch-happen-fetcher';
|
|
|
2
2
|
import gql from 'graphql-tag';
|
|
3
3
|
import { ApolloGateway } from '../../';
|
|
4
4
|
import { fixtures } from 'apollo-federation-integration-testsuite';
|
|
5
|
-
import { Logger } from 'apollo
|
|
5
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
6
6
|
|
|
7
7
|
let logger: {
|
|
8
8
|
warn: jest.MockedFunction<Logger['warn']>,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
fixtures,
|
|
17
17
|
fixturesWithUpdate,
|
|
18
18
|
} from 'apollo-federation-integration-testsuite';
|
|
19
|
-
import { Logger } from 'apollo
|
|
19
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
20
20
|
import resolvable from '@josephg/resolvable';
|
|
21
21
|
import { createHash } from '../../utilities/createHash';
|
|
22
22
|
import { getTestingSupergraphSdl } from '../execution-utils';
|
|
@@ -147,7 +147,7 @@ describe('lifecycle hooks', () => {
|
|
|
147
147
|
// the supergraph (even just formatting differences), this ID will change
|
|
148
148
|
// and this test will have to updated.
|
|
149
149
|
expect(secondCall[0]!.compositionId).toEqual(
|
|
150
|
-
'
|
|
150
|
+
'730a2fe4036db8e2c847096ba2a62f78ff8f3c08c9ee092a5b1b37e1aa00ef5a',
|
|
151
151
|
);
|
|
152
152
|
// second call should have previous info in the second arg
|
|
153
153
|
expect(secondCall[1]!.compositionId).toEqual(expectedFirstId);
|
|
@@ -229,6 +229,7 @@ describe('reporting', () => {
|
|
|
229
229
|
"seconds": "1562203363",
|
|
230
230
|
},
|
|
231
231
|
"header": "<HEADER>",
|
|
232
|
+
"operationCount": 1,
|
|
232
233
|
"tracesPerQuery": Object {
|
|
233
234
|
"# -
|
|
234
235
|
{me{name{first last}}topProducts{name}}": Object {
|
|
@@ -301,6 +302,7 @@ describe('reporting', () => {
|
|
|
301
302
|
"nanos": 123000000,
|
|
302
303
|
"seconds": "1562203363",
|
|
303
304
|
},
|
|
305
|
+
"fieldExecutionWeight": 1,
|
|
304
306
|
"root": Object {
|
|
305
307
|
"child": Array [
|
|
306
308
|
Object {
|
|
@@ -366,6 +368,7 @@ describe('reporting', () => {
|
|
|
366
368
|
"nanos": 123000000,
|
|
367
369
|
"seconds": "1562203363",
|
|
368
370
|
},
|
|
371
|
+
"fieldExecutionWeight": 1,
|
|
369
372
|
"root": Object {
|
|
370
373
|
"child": Array [
|
|
371
374
|
Object {
|
|
@@ -467,6 +470,7 @@ describe('reporting', () => {
|
|
|
467
470
|
"nanos": 123000000,
|
|
468
471
|
"seconds": "1562203363",
|
|
469
472
|
},
|
|
473
|
+
"fieldExecutionWeight": 1,
|
|
470
474
|
"root": Object {
|
|
471
475
|
"child": Array [
|
|
472
476
|
Object {
|
|
@@ -556,6 +560,7 @@ describe('reporting', () => {
|
|
|
556
560
|
"nanos": 123000000,
|
|
557
561
|
"seconds": "1562203363",
|
|
558
562
|
},
|
|
563
|
+
"fieldExecutionWeight": 1,
|
|
559
564
|
"root": Object {
|
|
560
565
|
"child": Array [
|
|
561
566
|
Object {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { fixturesWithUpdate } from 'apollo-federation-integration-testsuite';
|
|
8
8
|
import { createHash } from '../../utilities/createHash';
|
|
9
9
|
import { ApolloServer } from 'apollo-server';
|
|
10
|
-
import { Logger } from 'apollo
|
|
10
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
11
11
|
import { fetch } from '../../__mocks__/make-fetch-happen-fetcher';
|
|
12
12
|
import { getTestingSupergraphSdl } from '../execution-utils';
|
|
13
13
|
import { mockAllServicesHealthCheckSuccess } from '../integration/nockMocks';
|
|
@@ -91,12 +91,7 @@ const userService: ServiceDefinitionModule = {
|
|
|
91
91
|
);
|
|
92
92
|
},
|
|
93
93
|
organization(user) {
|
|
94
|
-
return
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
Organization: {
|
|
98
|
-
__resolveObject(object) {
|
|
99
|
-
return organizations.find(org => org.id === object.id);
|
|
94
|
+
return organizations.find(org => org.id === user.organizationId);
|
|
100
95
|
},
|
|
101
96
|
},
|
|
102
97
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import gql from 'graphql-tag';
|
|
2
2
|
import http from 'http';
|
|
3
3
|
import mockedEnv from 'mocked-env';
|
|
4
|
-
import { Logger } from 'apollo
|
|
4
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
5
5
|
import { ApolloGateway } from '../..';
|
|
6
6
|
import {
|
|
7
7
|
mockSdlQuerySuccess,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import gql from 'graphql-tag';
|
|
2
2
|
import { GraphQLObjectType, GraphQLSchema } from 'graphql';
|
|
3
3
|
import mockedEnv from 'mocked-env';
|
|
4
|
-
import { Logger } from 'apollo
|
|
4
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
5
5
|
import { ApolloGateway } from '../..';
|
|
6
6
|
import {
|
|
7
7
|
mockSdlQuerySuccess,
|
package/src/config.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { GraphQLError, GraphQLSchema } from 'graphql';
|
|
2
2
|
import { HeadersInit } from 'node-fetch';
|
|
3
3
|
import { fetch } from 'apollo-server-env';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
Logger,
|
|
7
|
-
} from 'apollo-server-types';
|
|
4
|
+
import { GraphQLRequestContextExecutionDidStart } from 'apollo-server-types';
|
|
5
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
8
6
|
import { GraphQLDataSource } from './datasources/types';
|
|
9
7
|
import { QueryPlan } from '@apollo/query-planner';
|
|
10
8
|
import { OperationContext } from './operationContext';
|
|
@@ -31,7 +31,7 @@ describe('core v0.1', () => {
|
|
|
31
31
|
|
|
32
32
|
directive @tag(
|
|
33
33
|
name: String!
|
|
34
|
-
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION
|
|
34
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
35
35
|
|
|
36
36
|
enum CacheControlScope {
|
|
37
37
|
PRIVATE
|
|
@@ -87,7 +87,7 @@ describe('core v0.1', () => {
|
|
|
87
87
|
|
|
88
88
|
directive @tag(
|
|
89
89
|
name: String!
|
|
90
|
-
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION
|
|
90
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
91
91
|
|
|
92
92
|
enum CacheControlScope {
|
|
93
93
|
PRIVATE
|
|
@@ -124,7 +124,7 @@ describe('core v0.2', () => {
|
|
|
124
124
|
schema
|
|
125
125
|
@core(feature: "https://specs.apollo.dev/core/v0.2")
|
|
126
126
|
@core(feature: "https://specs.apollo.dev/join/v0.1", for: EXECUTION)
|
|
127
|
-
@core(feature: "https://specs.apollo.dev/tag/v0.
|
|
127
|
+
@core(feature: "https://specs.apollo.dev/tag/v0.2") {
|
|
128
128
|
query: Query
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -151,7 +151,7 @@ describe('core v0.2', () => {
|
|
|
151
151
|
|
|
152
152
|
directive @tag(
|
|
153
153
|
name: String!
|
|
154
|
-
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION
|
|
154
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
155
155
|
|
|
156
156
|
enum CacheControlScope {
|
|
157
157
|
PRIVATE
|
|
@@ -193,7 +193,7 @@ describe('core v0.2', () => {
|
|
|
193
193
|
schema
|
|
194
194
|
@core(feature: "https://specs.apollo.dev/core/v0.2")
|
|
195
195
|
@core(feature: "https://specs.apollo.dev/join/v0.1", for: EXECUTION)
|
|
196
|
-
@core(feature: "https://specs.apollo.dev/tag/v0.
|
|
196
|
+
@core(feature: "https://specs.apollo.dev/tag/v0.2")
|
|
197
197
|
@core(feature: "https://specs.apollo.dev/unsupported-feature/v0.1") {
|
|
198
198
|
query: Query
|
|
199
199
|
}
|
|
@@ -221,7 +221,7 @@ describe('core v0.2', () => {
|
|
|
221
221
|
|
|
222
222
|
directive @tag(
|
|
223
223
|
name: String!
|
|
224
|
-
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION
|
|
224
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
225
225
|
|
|
226
226
|
enum CacheControlScope {
|
|
227
227
|
PRIVATE
|
|
@@ -293,7 +293,7 @@ describe('core v0.2', () => {
|
|
|
293
293
|
|
|
294
294
|
directive @tag(
|
|
295
295
|
name: String!
|
|
296
|
-
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION
|
|
296
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
297
297
|
|
|
298
298
|
enum CacheControlScope {
|
|
299
299
|
PRIVATE
|
|
@@ -369,7 +369,7 @@ describe('core v0.2', () => {
|
|
|
369
369
|
|
|
370
370
|
directive @tag(
|
|
371
371
|
name: String!
|
|
372
|
-
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION
|
|
372
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
373
373
|
|
|
374
374
|
enum CacheControlScope {
|
|
375
375
|
PRIVATE
|
package/src/index.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { deprecate } from 'util';
|
|
|
2
2
|
import { GraphQLService, Unsubscriber } from 'apollo-server-core';
|
|
3
3
|
import {
|
|
4
4
|
GraphQLExecutionResult,
|
|
5
|
-
Logger,
|
|
6
5
|
GraphQLRequestContextExecutionDidStart,
|
|
7
6
|
} from 'apollo-server-types';
|
|
7
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
8
8
|
import { InMemoryLRUCache } from 'apollo-server-caching';
|
|
9
9
|
import {
|
|
10
10
|
isObjectType,
|
|
@@ -9,7 +9,7 @@ import { IntrospectAndCompose } from '..';
|
|
|
9
9
|
import { mockAllServicesSdlQuerySuccess } from '../../../__tests__/integration/nockMocks';
|
|
10
10
|
import { getTestingSupergraphSdl, wait } from '../../../__tests__/execution-utils';
|
|
11
11
|
import resolvable from '@josephg/resolvable';
|
|
12
|
-
import { Logger } from 'apollo
|
|
12
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
13
13
|
|
|
14
14
|
describe('IntrospectAndCompose', () => {
|
|
15
15
|
beforeEach(nockBeforeEach);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* configuration options of the gateway and will be removed in a future release
|
|
5
5
|
* along with those options.
|
|
6
6
|
*/
|
|
7
|
-
import { Logger } from 'apollo
|
|
7
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
8
8
|
import resolvable from '@josephg/resolvable';
|
|
9
9
|
import {
|
|
10
10
|
SupergraphManager,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fetch } from 'apollo-server-env';
|
|
2
|
-
import { Logger } from 'apollo
|
|
2
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
3
3
|
import resolvable from '@josephg/resolvable';
|
|
4
4
|
import { SupergraphManager, SupergraphSdlHookOptions } from '../../config';
|
|
5
5
|
import { SubgraphHealthCheckFunction, SupergraphSdlUpdateFunction } from '../..';
|