@apollo/client 4.0.6 → 4.1.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.
- package/CHANGELOG.md +43 -4
- package/__cjs/cache/core/cache.cjs +1 -1
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +19 -0
- package/__cjs/cache/inmemory/entityStore.cjs +3 -3
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs +3 -0
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +1 -0
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/key-extractor.cjs.map +1 -1
- package/__cjs/cache/inmemory/policies.cjs +4 -4
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
- package/__cjs/cache/inmemory/writeToStore.cjs +5 -5
- package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
- package/__cjs/core/ApolloClient.cjs +14 -13
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +12 -0
- package/__cjs/core/ObservableQuery.cjs +157 -110
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +1 -0
- package/__cjs/core/QueryManager.cjs +19 -17
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/incremental/handlers/defer20220824.cjs +20 -9
- package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -1
- package/__cjs/incremental/handlers/defer20220824.d.cts +14 -5
- package/__cjs/incremental/handlers/graphql17Alpha9.cjs +181 -0
- package/__cjs/incremental/handlers/graphql17Alpha9.cjs.map +1 -0
- package/__cjs/incremental/handlers/graphql17Alpha9.d.cts +97 -0
- package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
- package/__cjs/incremental/index.cjs +3 -1
- package/__cjs/incremental/index.cjs.map +1 -1
- package/__cjs/incremental/index.d.cts +1 -0
- package/__cjs/invariantErrorCodes.cjs +75 -59
- package/__cjs/link/core/ApolloLink.cjs +3 -3
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/ws/index.cjs +1 -1
- package/__cjs/local-state/LocalState.cjs +28 -14
- package/__cjs/local-state/LocalState.cjs.map +1 -1
- package/__cjs/local-state/LocalState.d.cts +3 -2
- package/__cjs/react/hooks/useReactiveVar.cjs +1 -2
- package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -1
- package/__cjs/react/hooks/useReactiveVar.d.cts +1 -2
- package/__cjs/react/internal/cache/QueryReference.cjs +16 -0
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/QueryReference.d.cts +1 -0
- package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockLink.d.cts +1 -3
- package/__cjs/utilities/internal/DeepMerger.cjs +10 -1
- package/__cjs/utilities/internal/DeepMerger.cjs.map +1 -1
- package/__cjs/utilities/internal/DeepMerger.d.cts +14 -2
- package/__cjs/utilities/internal/getStoreKeyName.cjs +1 -0
- package/__cjs/utilities/internal/getStoreKeyName.cjs.map +1 -1
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.cjs.map +1 -1
- package/cache/core/cache.d.ts +19 -0
- package/cache/core/cache.js +1 -1
- package/cache/core/cache.js.map +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +1 -0
- package/cache/inmemory/inMemoryCache.js +3 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/key-extractor.js.map +1 -1
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +5 -5
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts +12 -0
- package/core/ApolloClient.js +14 -13
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +1 -0
- package/core/ObservableQuery.js +159 -112
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.js +19 -17
- package/core/QueryManager.js.map +1 -1
- package/incremental/handlers/defer20220824.d.ts +14 -5
- package/incremental/handlers/defer20220824.js +20 -9
- package/incremental/handlers/defer20220824.js.map +1 -1
- package/incremental/handlers/graphql17Alpha9.d.ts +97 -0
- package/incremental/handlers/graphql17Alpha9.js +177 -0
- package/incremental/handlers/graphql17Alpha9.js.map +1 -0
- package/incremental/handlers/notImplemented.js +1 -1
- package/incremental/index.d.ts +1 -0
- package/incremental/index.js +3 -2
- package/incremental/index.js.map +1 -1
- package/invariantErrorCodes.js +75 -59
- package/link/core/ApolloLink.js +3 -3
- package/link/http/checkFetcher.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/ws/index.js +1 -1
- package/local-state/LocalState.d.ts +3 -2
- package/local-state/LocalState.js +28 -14
- package/local-state/LocalState.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useReactiveVar.d.ts +1 -2
- package/react/hooks/useReactiveVar.js +1 -2
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks-compiled/useReactiveVar.d.ts +1 -2
- package/react/hooks-compiled/useReactiveVar.js +1 -2
- package/react/hooks-compiled/useReactiveVar.js.map +1 -1
- package/react/internal/cache/QueryReference.d.ts +1 -0
- package/react/internal/cache/QueryReference.js +16 -0
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +1 -3
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/utilities/internal/DeepMerger.d.ts +14 -2
- package/utilities/internal/DeepMerger.js +10 -1
- package/utilities/internal/DeepMerger.js.map +1 -1
- package/utilities/internal/getStoreKeyName.js +1 -0
- package/utilities/internal/getStoreKeyName.js.map +1 -1
- package/utilities/internal/globals/global.js +2 -2
- package/utilities/internal/globals/global.js.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
|
@@ -16,29 +16,38 @@ export declare namespace Defer20220824Handler {
|
|
|
16
16
|
errors?: ReadonlyArray<GraphQLFormattedError>;
|
|
17
17
|
extensions?: Record<string, unknown>;
|
|
18
18
|
hasNext: boolean;
|
|
19
|
+
incremental?: ReadonlyArray<IncrementalResult<TData>>;
|
|
19
20
|
};
|
|
20
21
|
type SubsequentResult<TData = Record<string, unknown>> = {
|
|
21
22
|
data?: TData | null | undefined;
|
|
22
23
|
errors?: ReadonlyArray<GraphQLFormattedError>;
|
|
23
24
|
extensions?: Record<string, unknown>;
|
|
24
25
|
hasNext: boolean;
|
|
25
|
-
incremental?: Array<
|
|
26
|
+
incremental?: Array<IncrementalResult<TData>>;
|
|
26
27
|
};
|
|
27
|
-
type
|
|
28
|
-
|
|
29
|
-
data?: TData | null | undefined;
|
|
28
|
+
type IncrementalDeferResult<TData = Record<string, unknown>> = {
|
|
29
|
+
data?: TData | null;
|
|
30
30
|
errors?: ReadonlyArray<GraphQLFormattedError>;
|
|
31
31
|
extensions?: Record<string, unknown>;
|
|
32
32
|
path?: Incremental.Path;
|
|
33
33
|
label?: string;
|
|
34
34
|
};
|
|
35
|
+
type IncrementalStreamResult<TData = Array<unknown>> = {
|
|
36
|
+
errors?: ReadonlyArray<GraphQLFormattedError>;
|
|
37
|
+
items?: TData;
|
|
38
|
+
path?: Incremental.Path;
|
|
39
|
+
label?: string;
|
|
40
|
+
extensions?: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
type IncrementalResult<TData = Record<string, unknown>> = IncrementalDeferResult<TData> | IncrementalStreamResult<TData>;
|
|
43
|
+
type Chunk<TData extends Record<string, unknown>> = InitialResult<TData> | SubsequentResult<TData>;
|
|
35
44
|
}
|
|
36
45
|
declare class DeferRequest<TData extends Record<string, unknown>> implements Incremental.IncrementalRequest<Defer20220824Handler.Chunk<TData>, TData> {
|
|
37
46
|
hasNext: boolean;
|
|
38
47
|
private errors;
|
|
39
48
|
private extensions;
|
|
40
49
|
private data;
|
|
41
|
-
private
|
|
50
|
+
private merge;
|
|
42
51
|
handle(cacheData: TData | DeepPartial<TData> | null | undefined, chunk: Defer20220824Handler.Chunk<TData>): FormattedExecutionResult<TData>;
|
|
43
52
|
}
|
|
44
53
|
/**
|
|
@@ -4,9 +4,9 @@ class DeferRequest {
|
|
|
4
4
|
errors = [];
|
|
5
5
|
extensions = {};
|
|
6
6
|
data = {};
|
|
7
|
-
|
|
7
|
+
merge(normalized, arrayMerge = "truncate") {
|
|
8
8
|
if (normalized.data !== undefined) {
|
|
9
|
-
this.data =
|
|
9
|
+
this.data = new DeepMerger(undefined, { arrayMerge }).merge(this.data, normalized.data);
|
|
10
10
|
}
|
|
11
11
|
if (normalized.errors) {
|
|
12
12
|
this.errors.push(...normalized.errors);
|
|
@@ -19,25 +19,36 @@ class DeferRequest {
|
|
|
19
19
|
cacheData = this.data, chunk) {
|
|
20
20
|
this.hasNext = chunk.hasNext;
|
|
21
21
|
this.data = cacheData;
|
|
22
|
-
this.
|
|
22
|
+
this.merge(chunk);
|
|
23
23
|
if (hasIncrementalChunks(chunk)) {
|
|
24
|
-
const merger = new DeepMerger();
|
|
25
24
|
for (const incremental of chunk.incremental) {
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const { path, errors, extensions } = incremental;
|
|
26
|
+
let arrayMerge = "truncate";
|
|
27
|
+
let data =
|
|
28
|
+
// The item merged from a `@stream` chunk is always the first item in
|
|
29
|
+
// the `items` array
|
|
30
|
+
"items" in incremental ? incremental.items?.[0]
|
|
31
|
+
// Ensure `data: null` isn't merged for `@defer` responses by
|
|
32
|
+
// falling back to `undefined`
|
|
33
|
+
: "data" in incremental ? incremental.data ?? undefined
|
|
34
|
+
: undefined;
|
|
35
|
+
if (data !== undefined && path) {
|
|
28
36
|
for (let i = path.length - 1; i >= 0; --i) {
|
|
29
37
|
const key = path[i];
|
|
30
38
|
const isNumericKey = !isNaN(+key);
|
|
31
39
|
const parent = isNumericKey ? [] : {};
|
|
40
|
+
if (isNumericKey) {
|
|
41
|
+
arrayMerge = "combine";
|
|
42
|
+
}
|
|
32
43
|
parent[key] = data;
|
|
33
44
|
data = parent;
|
|
34
45
|
}
|
|
35
46
|
}
|
|
36
|
-
this.
|
|
47
|
+
this.merge({
|
|
37
48
|
errors,
|
|
38
49
|
extensions,
|
|
39
50
|
data: data ? data : undefined,
|
|
40
|
-
},
|
|
51
|
+
}, arrayMerge);
|
|
41
52
|
}
|
|
42
53
|
}
|
|
43
54
|
const result = { data: this.data };
|
|
@@ -76,7 +87,7 @@ export class Defer20220824Handler {
|
|
|
76
87
|
}
|
|
77
88
|
}
|
|
78
89
|
prepareRequest(request) {
|
|
79
|
-
if (hasDirectives(["defer"], request.query)) {
|
|
90
|
+
if (hasDirectives(["defer", "stream"], request.query)) {
|
|
80
91
|
const context = request.context ?? {};
|
|
81
92
|
const http = (context.http ??= {});
|
|
82
93
|
http.accept = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defer20220824.js","sourceRoot":"","sources":["../../../src/incremental/handlers/defer20220824.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,mCAAmC,CAAC;AA0C3C,MAAM,YAAY;IAIT,OAAO,GAAG,IAAI,CAAC;IAEd,MAAM,GAAiC,EAAE,CAAC;IAC1C,UAAU,GAAwB,EAAE,CAAC;IACrC,IAAI,GAAQ,EAAE,CAAC;IAEf,OAAO,CACb,UAA2C,EAC3C,MAAyB;QAEzB,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAClC,IA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CAAC;QACH,CAAC;QACD,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACf,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IAED,cAAc,CAAC,OAA2B;QACxC,IAAI,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;YACnC,IAAI,CAAC,MAAM,GAAG;gBACZ,oCAAoC;gBACpC,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;aACvB,CAAC;QACJ,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,YAAY,CAAwC,CAEnD;QACC,OAAO,IAAI,YAAY,EAAS,CAAC;IACnC,CAAC;CACF;AAED,iCAAiC;AACjC,MAAM,UAAU,oBAAoB,CAClC,MAA2B;IAE3B,OAAO,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import type {\n DocumentNode,\n FormattedExecutionResult,\n GraphQLFormattedError,\n} from \"graphql\";\n\nimport type { ApolloLink } from \"@apollo/client/link\";\nimport type { DeepPartial, HKT } from \"@apollo/client/utilities\";\nimport {\n DeepMerger,\n hasDirectives,\n isNonEmptyArray,\n} from \"@apollo/client/utilities/internal\";\n\nimport type { Incremental } from \"../types.js\";\n\nexport declare namespace Defer20220824Handler {\n interface Defer20220824Result extends HKT {\n arg1: unknown; // TData\n arg2: unknown; // TExtensions\n return: Defer20220824Handler.Chunk<Record<string, unknown>>;\n }\n export interface TypeOverrides {\n AdditionalApolloLinkResultTypes: Defer20220824Result;\n }\n\n export type InitialResult<TData = Record<string, unknown>> = {\n data?: TData | null | undefined;\n errors?: ReadonlyArray<GraphQLFormattedError>;\n extensions?: Record<string, unknown>;\n hasNext: boolean;\n };\n\n export type SubsequentResult<TData = Record<string, unknown>> = {\n data?: TData | null | undefined;\n errors?: ReadonlyArray<GraphQLFormattedError>;\n extensions?: Record<string, unknown>;\n hasNext: boolean;\n incremental?: Array<IncrementalDeferPayload<TData>>;\n };\n\n export type Chunk<TData extends Record<string, unknown>> =\n | InitialResult<TData>\n | SubsequentResult<TData>;\n\n export type IncrementalDeferPayload<TData = Record<string, unknown>> = {\n data?: TData | null | undefined;\n errors?: ReadonlyArray<GraphQLFormattedError>;\n extensions?: Record<string, unknown>;\n path?: Incremental.Path;\n label?: string;\n };\n}\n\nclass DeferRequest<TData extends Record<string, unknown>>\n implements\n Incremental.IncrementalRequest<Defer20220824Handler.Chunk<TData>, TData>\n{\n public hasNext = true;\n\n private errors: Array<GraphQLFormattedError> = [];\n private extensions: Record<string, any> = {};\n private data: any = {};\n\n private mergeIn(\n normalized: FormattedExecutionResult<TData>,\n merger: DeepMerger<any[]>\n ) {\n if (normalized.data !== undefined) {\n this.data = merger.merge(this.data, normalized.data);\n }\n if (normalized.errors) {\n this.errors.push(...normalized.errors);\n }\n Object.assign(this.extensions, normalized.extensions);\n }\n\n handle(\n // we'll get `undefined` here in case of a `no-cache` fetch policy,\n // so we'll continue with the last value this request had accumulated\n cacheData: TData | DeepPartial<TData> | null | undefined = this.data,\n chunk: Defer20220824Handler.Chunk<TData>\n ): FormattedExecutionResult<TData> {\n this.hasNext = chunk.hasNext;\n this.data = cacheData;\n\n this.mergeIn(chunk, new DeepMerger());\n\n if (hasIncrementalChunks(chunk)) {\n const merger = new DeepMerger();\n for (const incremental of chunk.incremental) {\n let { data, path, errors, extensions } = incremental;\n if (data && path) {\n for (let i = path.length - 1; i >= 0; --i) {\n const key = path[i];\n const isNumericKey = !isNaN(+key);\n const parent: Record<string | number, any> = isNumericKey ? [] : {};\n parent[key] = data;\n data = parent as typeof data;\n }\n }\n this.mergeIn(\n {\n errors,\n extensions,\n data: data ? (data as TData) : undefined,\n },\n merger\n );\n }\n }\n\n const result: FormattedExecutionResult<TData> = { data: this.data };\n\n if (isNonEmptyArray(this.errors)) {\n result.errors = this.errors;\n }\n\n if (Object.keys(this.extensions).length > 0) {\n result.extensions = this.extensions;\n }\n\n return result;\n }\n}\n\n/**\n * This handler implements the `@defer` directive as specified in this historical commit:\n * https://github.com/graphql/graphql-spec/tree/48cf7263a71a683fab03d45d309fd42d8d9a6659/spec\n */\nexport class Defer20220824Handler\n implements Incremental.Handler<Defer20220824Handler.Chunk<any>>\n{\n isIncrementalResult(\n result: Record<string, any>\n ): result is\n | Defer20220824Handler.SubsequentResult\n | Defer20220824Handler.InitialResult {\n return \"hasNext\" in result;\n }\n\n extractErrors(result: ApolloLink.Result<any>) {\n const acc: GraphQLFormattedError[] = [];\n const push = ({\n errors,\n }: {\n errors?: ReadonlyArray<GraphQLFormattedError>;\n }) => {\n if (errors) {\n acc.push(...errors);\n }\n };\n if (this.isIncrementalResult(result)) {\n push(result);\n if (hasIncrementalChunks(result)) {\n result.incremental.forEach(push);\n }\n }\n if (acc.length) {\n return acc;\n }\n }\n\n prepareRequest(request: ApolloLink.Request): ApolloLink.Request {\n if (hasDirectives([\"defer\"], request.query)) {\n const context = request.context ?? {};\n const http = (context.http ??= {});\n http.accept = [\n \"multipart/mixed;deferSpec=20220824\",\n ...(http.accept || []),\n ];\n }\n\n return request;\n }\n startRequest<TData extends Record<string, unknown>>(_: {\n query: DocumentNode;\n }) {\n return new DeferRequest<TData>();\n }\n}\n\n// only exported for use in tests\nexport function hasIncrementalChunks(\n result: Record<string, any>\n): result is Required<Defer20220824Handler.SubsequentResult> {\n return isNonEmptyArray(result.incremental);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"defer20220824.js","sourceRoot":"","sources":["../../../src/incremental/handlers/defer20220824.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAuD3C,MAAM,YAAY;IAIT,OAAO,GAAG,IAAI,CAAC;IAEd,MAA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CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import type {\n DocumentNode,\n FormattedExecutionResult,\n GraphQLFormattedError,\n} from \"graphql\";\n\nimport type { ApolloLink } from \"@apollo/client/link\";\nimport type { DeepPartial, HKT } from \"@apollo/client/utilities\";\nimport {\n DeepMerger,\n hasDirectives,\n isNonEmptyArray,\n} from \"@apollo/client/utilities/internal\";\n\nimport type { Incremental } from \"../types.js\";\n\nexport declare namespace Defer20220824Handler {\n interface Defer20220824Result extends HKT {\n arg1: unknown; // TData\n arg2: unknown; // TExtensions\n return: Defer20220824Handler.Chunk<Record<string, unknown>>;\n }\n export interface TypeOverrides {\n AdditionalApolloLinkResultTypes: Defer20220824Result;\n }\n\n export type InitialResult<TData = Record<string, unknown>> = {\n data?: TData | null | undefined;\n errors?: ReadonlyArray<GraphQLFormattedError>;\n extensions?: Record<string, unknown>;\n hasNext: boolean;\n incremental?: ReadonlyArray<IncrementalResult<TData>>;\n };\n\n export type SubsequentResult<TData = Record<string, unknown>> = {\n data?: TData | null | undefined;\n errors?: ReadonlyArray<GraphQLFormattedError>;\n extensions?: Record<string, unknown>;\n hasNext: boolean;\n incremental?: Array<IncrementalResult<TData>>;\n };\n\n export type IncrementalDeferResult<TData = Record<string, unknown>> = {\n data?: TData | null;\n errors?: ReadonlyArray<GraphQLFormattedError>;\n extensions?: Record<string, unknown>;\n path?: Incremental.Path;\n label?: string;\n };\n\n export type IncrementalStreamResult<TData = Array<unknown>> = {\n errors?: ReadonlyArray<GraphQLFormattedError>;\n items?: TData;\n path?: Incremental.Path;\n label?: string;\n extensions?: Record<string, unknown>;\n };\n\n export type IncrementalResult<TData = Record<string, unknown>> =\n | IncrementalDeferResult<TData>\n | IncrementalStreamResult<TData>;\n\n export type Chunk<TData extends Record<string, unknown>> =\n | InitialResult<TData>\n | SubsequentResult<TData>;\n}\n\nclass DeferRequest<TData extends Record<string, unknown>>\n implements\n Incremental.IncrementalRequest<Defer20220824Handler.Chunk<TData>, TData>\n{\n public hasNext = true;\n\n private errors: Array<GraphQLFormattedError> = [];\n private extensions: Record<string, any> = {};\n private data: any = {};\n\n private merge(\n normalized: FormattedExecutionResult<TData>,\n arrayMerge: DeepMerger.ArrayMergeStrategy = \"truncate\"\n ) {\n if (normalized.data !== undefined) {\n this.data = new DeepMerger(undefined, { arrayMerge }).merge(\n this.data,\n normalized.data\n );\n }\n if (normalized.errors) {\n this.errors.push(...normalized.errors);\n }\n Object.assign(this.extensions, normalized.extensions);\n }\n\n handle(\n // we'll get `undefined` here in case of a `no-cache` fetch policy,\n // so we'll continue with the last value this request had accumulated\n cacheData: TData | DeepPartial<TData> | null | undefined = this.data,\n chunk: Defer20220824Handler.Chunk<TData>\n ): FormattedExecutionResult<TData> {\n this.hasNext = chunk.hasNext;\n this.data = cacheData;\n this.merge(chunk);\n\n if (hasIncrementalChunks(chunk)) {\n for (const incremental of chunk.incremental) {\n const { path, errors, extensions } = incremental;\n let arrayMerge: DeepMerger.ArrayMergeStrategy = \"truncate\";\n let data =\n // The item merged from a `@stream` chunk is always the first item in\n // the `items` array\n \"items\" in incremental ? incremental.items?.[0]\n // Ensure `data: null` isn't merged for `@defer` responses by\n // falling back to `undefined`\n : \"data\" in incremental ? incremental.data ?? undefined\n : undefined;\n\n if (data !== undefined && path) {\n for (let i = path.length - 1; i >= 0; --i) {\n const key = path[i];\n const isNumericKey = !isNaN(+key);\n const parent: Record<string | number, any> = isNumericKey ? [] : {};\n if (isNumericKey) {\n arrayMerge = \"combine\";\n }\n parent[key] = data;\n data = parent as typeof data;\n }\n }\n this.merge(\n {\n errors,\n extensions,\n data: data ? (data as TData) : undefined,\n },\n arrayMerge\n );\n }\n }\n\n const result: FormattedExecutionResult<TData> = { data: this.data };\n\n if (isNonEmptyArray(this.errors)) {\n result.errors = this.errors;\n }\n\n if (Object.keys(this.extensions).length > 0) {\n result.extensions = this.extensions;\n }\n\n return result;\n }\n}\n\n/**\n * This handler implements the `@defer` directive as specified in this historical commit:\n * https://github.com/graphql/graphql-spec/tree/48cf7263a71a683fab03d45d309fd42d8d9a6659/spec\n */\nexport class Defer20220824Handler\n implements Incremental.Handler<Defer20220824Handler.Chunk<any>>\n{\n isIncrementalResult(\n result: Record<string, any>\n ): result is\n | Defer20220824Handler.SubsequentResult\n | Defer20220824Handler.InitialResult {\n return \"hasNext\" in result;\n }\n\n extractErrors(result: ApolloLink.Result<any>) {\n const acc: GraphQLFormattedError[] = [];\n const push = ({\n errors,\n }: {\n errors?: ReadonlyArray<GraphQLFormattedError>;\n }) => {\n if (errors) {\n acc.push(...errors);\n }\n };\n if (this.isIncrementalResult(result)) {\n push(result);\n if (hasIncrementalChunks(result)) {\n result.incremental.forEach(push);\n }\n }\n if (acc.length) {\n return acc;\n }\n }\n\n prepareRequest(request: ApolloLink.Request): ApolloLink.Request {\n if (hasDirectives([\"defer\", \"stream\"], request.query)) {\n const context = request.context ?? {};\n const http = (context.http ??= {});\n http.accept = [\n \"multipart/mixed;deferSpec=20220824\",\n ...(http.accept || []),\n ];\n }\n\n return request;\n }\n startRequest<TData extends Record<string, unknown>>(_: {\n query: DocumentNode;\n }) {\n return new DeferRequest<TData>();\n }\n}\n\n// only exported for use in tests\nexport function hasIncrementalChunks(\n result: Record<string, any>\n): result is Required<Defer20220824Handler.SubsequentResult> {\n return isNonEmptyArray(result.incremental);\n}\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { DocumentNode, FormattedExecutionResult, GraphQLFormattedError } from "graphql";
|
|
2
|
+
import type { ApolloLink } from "@apollo/client/link";
|
|
3
|
+
import type { DeepPartial, HKT } from "@apollo/client/utilities";
|
|
4
|
+
import type { Incremental } from "../types.js";
|
|
5
|
+
export declare namespace GraphQL17Alpha9Handler {
|
|
6
|
+
interface GraphQL17Alpha9Result extends HKT {
|
|
7
|
+
arg1: unknown;
|
|
8
|
+
arg2: unknown;
|
|
9
|
+
return: GraphQL17Alpha9Handler.Chunk<Record<string, unknown>>;
|
|
10
|
+
}
|
|
11
|
+
interface TypeOverrides {
|
|
12
|
+
AdditionalApolloLinkResultTypes: GraphQL17Alpha9Result;
|
|
13
|
+
}
|
|
14
|
+
type InitialResult<TData = Record<string, unknown>> = {
|
|
15
|
+
data: TData;
|
|
16
|
+
errors?: ReadonlyArray<GraphQLFormattedError>;
|
|
17
|
+
pending: ReadonlyArray<PendingResult>;
|
|
18
|
+
hasNext: boolean;
|
|
19
|
+
extensions?: Record<string, unknown>;
|
|
20
|
+
};
|
|
21
|
+
type SubsequentResult<TData = unknown> = {
|
|
22
|
+
hasNext: boolean;
|
|
23
|
+
pending?: ReadonlyArray<PendingResult>;
|
|
24
|
+
incremental?: ReadonlyArray<IncrementalResult<TData>>;
|
|
25
|
+
completed?: ReadonlyArray<CompletedResult>;
|
|
26
|
+
extensions?: Record<string, unknown>;
|
|
27
|
+
};
|
|
28
|
+
interface PendingResult {
|
|
29
|
+
id: string;
|
|
30
|
+
path: Incremental.Path;
|
|
31
|
+
label?: string;
|
|
32
|
+
}
|
|
33
|
+
interface CompletedResult {
|
|
34
|
+
id: string;
|
|
35
|
+
errors?: ReadonlyArray<GraphQLFormattedError>;
|
|
36
|
+
}
|
|
37
|
+
interface IncrementalDeferResult<TData = Record<string, unknown>> {
|
|
38
|
+
errors?: ReadonlyArray<GraphQLFormattedError>;
|
|
39
|
+
data: TData;
|
|
40
|
+
id: string;
|
|
41
|
+
subPath?: Incremental.Path;
|
|
42
|
+
extensions?: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
interface IncrementalStreamResult<TData = ReadonlyArray<unknown>> {
|
|
45
|
+
errors?: ReadonlyArray<GraphQLFormattedError>;
|
|
46
|
+
items: TData;
|
|
47
|
+
id: string;
|
|
48
|
+
subPath?: Incremental.Path;
|
|
49
|
+
extensions?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
type IncrementalResult<TData = unknown> = IncrementalDeferResult<TData> | IncrementalStreamResult<TData>;
|
|
52
|
+
type Chunk<TData> = InitialResult<TData> | SubsequentResult<TData>;
|
|
53
|
+
}
|
|
54
|
+
declare class IncrementalRequest<TData> implements Incremental.IncrementalRequest<GraphQL17Alpha9Handler.Chunk<TData>, TData> {
|
|
55
|
+
hasNext: boolean;
|
|
56
|
+
private data;
|
|
57
|
+
private errors;
|
|
58
|
+
private extensions;
|
|
59
|
+
private pending;
|
|
60
|
+
private streamPositions;
|
|
61
|
+
handle(cacheData: TData | DeepPartial<TData> | null | undefined, chunk: GraphQL17Alpha9Handler.Chunk<TData>): FormattedExecutionResult<TData>;
|
|
62
|
+
private merge;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Provides handling for the incremental delivery specification implemented by
|
|
66
|
+
* graphql.js version `17.0.0-alpha.9`.
|
|
67
|
+
*/
|
|
68
|
+
export declare class GraphQL17Alpha9Handler implements Incremental.Handler<GraphQL17Alpha9Handler.Chunk<any>> {
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*
|
|
72
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
73
|
+
*/
|
|
74
|
+
isIncrementalResult(result: ApolloLink.Result<any>): result is GraphQL17Alpha9Handler.InitialResult | GraphQL17Alpha9Handler.SubsequentResult;
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*
|
|
78
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
79
|
+
*/
|
|
80
|
+
prepareRequest(request: ApolloLink.Request): ApolloLink.Request;
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*
|
|
84
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
85
|
+
*/
|
|
86
|
+
extractErrors(result: ApolloLink.Result<any>): GraphQLFormattedError[] | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* @internal
|
|
89
|
+
*
|
|
90
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
91
|
+
*/
|
|
92
|
+
startRequest<TData>(_: {
|
|
93
|
+
query: DocumentNode;
|
|
94
|
+
}): IncrementalRequest<TData>;
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
97
|
+
//# sourceMappingURL=graphql17Alpha9.d.ts.map
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { DeepMerger } from "@apollo/client/utilities/internal";
|
|
2
|
+
import { hasDirectives, isNonEmptyArray, } from "@apollo/client/utilities/internal";
|
|
3
|
+
import { invariant } from "@apollo/client/utilities/invariant";
|
|
4
|
+
class IncrementalRequest {
|
|
5
|
+
hasNext = true;
|
|
6
|
+
data = {};
|
|
7
|
+
errors = [];
|
|
8
|
+
extensions = {};
|
|
9
|
+
pending = [];
|
|
10
|
+
// `streamPositions` maps `pending.id` to the index that should be set by the
|
|
11
|
+
// next `incremental` stream chunk to ensure the streamed array item is placed
|
|
12
|
+
// at the correct point in the data array. `this.data` contains cached
|
|
13
|
+
// references with the full array so we can't rely on the array length in
|
|
14
|
+
// `this.data` to determine where to place item. This also ensures that items
|
|
15
|
+
// updated by the cache between a streamed chunk aren't overwritten by merges
|
|
16
|
+
// of future stream items from already merged stream items.
|
|
17
|
+
streamPositions = {};
|
|
18
|
+
handle(cacheData = this.data, chunk) {
|
|
19
|
+
this.hasNext = chunk.hasNext;
|
|
20
|
+
this.data = cacheData;
|
|
21
|
+
if (chunk.pending) {
|
|
22
|
+
this.pending.push(...chunk.pending);
|
|
23
|
+
if ("data" in chunk) {
|
|
24
|
+
for (const pending of chunk.pending) {
|
|
25
|
+
const dataAtPath = pending.path.reduce((data, key) => data[key], chunk.data);
|
|
26
|
+
if (Array.isArray(dataAtPath)) {
|
|
27
|
+
this.streamPositions[pending.id] = dataAtPath.length;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
this.merge(chunk, "truncate");
|
|
33
|
+
if (hasIncrementalChunks(chunk)) {
|
|
34
|
+
for (const incremental of chunk.incremental) {
|
|
35
|
+
const pending = this.pending.find(({ id }) => incremental.id === id);
|
|
36
|
+
invariant(pending, 66);
|
|
37
|
+
const path = pending.path.concat(incremental.subPath ?? []);
|
|
38
|
+
let data;
|
|
39
|
+
let arrayMerge = "truncate";
|
|
40
|
+
if ("items" in incremental) {
|
|
41
|
+
const items = incremental.items;
|
|
42
|
+
const parent = [];
|
|
43
|
+
// This creates a sparse array with values set at the indices streamed
|
|
44
|
+
// from the server. DeepMerger uses Object.keys and will correctly
|
|
45
|
+
// place the values in this array in the correct place
|
|
46
|
+
for (let i = 0; i < items.length; i++) {
|
|
47
|
+
parent[i + this.streamPositions[pending.id]] = items[i];
|
|
48
|
+
}
|
|
49
|
+
this.streamPositions[pending.id] += items.length;
|
|
50
|
+
data = parent;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
data = incremental.data;
|
|
54
|
+
// Check if any pending streams added arrays from deferred data so
|
|
55
|
+
// that we can update streamPositions with the initial length of the
|
|
56
|
+
// array to ensure future streamed items are inserted at the right
|
|
57
|
+
// starting index.
|
|
58
|
+
for (const pendingItem of this.pending) {
|
|
59
|
+
if (!(pendingItem.id in this.streamPositions)) {
|
|
60
|
+
// Check if this incremental data contains array data for the pending path
|
|
61
|
+
// The pending path is absolute, but incremental data is relative to the defer
|
|
62
|
+
// E.g., pending.path = ["nestedObject"], pendingItem.path = ["nestedObject", "nestedFriendList"]
|
|
63
|
+
// incremental.data = { scalarField: "...", nestedFriendList: [...] }
|
|
64
|
+
// So we need the path from pending.path onwards
|
|
65
|
+
const relativePath = pendingItem.path.slice(pending.path.length);
|
|
66
|
+
const dataAtPath = relativePath.reduce((data, key) => data?.[key], incremental.data);
|
|
67
|
+
if (Array.isArray(dataAtPath)) {
|
|
68
|
+
this.streamPositions[pendingItem.id] = dataAtPath.length;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
for (let i = path.length - 1; i >= 0; i--) {
|
|
74
|
+
const key = path[i];
|
|
75
|
+
const parent = typeof key === "number" ? [] : {};
|
|
76
|
+
parent[key] = data;
|
|
77
|
+
if (typeof key === "number") {
|
|
78
|
+
arrayMerge = "combine";
|
|
79
|
+
}
|
|
80
|
+
data = parent;
|
|
81
|
+
}
|
|
82
|
+
this.merge({
|
|
83
|
+
data,
|
|
84
|
+
extensions: incremental.extensions,
|
|
85
|
+
errors: incremental.errors,
|
|
86
|
+
}, arrayMerge);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if ("completed" in chunk && chunk.completed) {
|
|
90
|
+
for (const completed of chunk.completed) {
|
|
91
|
+
this.pending = this.pending.filter(({ id }) => id !== completed.id);
|
|
92
|
+
if (completed.errors) {
|
|
93
|
+
this.errors.push(...completed.errors);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const result = { data: this.data };
|
|
98
|
+
if (isNonEmptyArray(this.errors)) {
|
|
99
|
+
result.errors = this.errors;
|
|
100
|
+
}
|
|
101
|
+
if (Object.keys(this.extensions).length > 0) {
|
|
102
|
+
result.extensions = this.extensions;
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
merge(normalized, arrayMerge) {
|
|
107
|
+
if (normalized.data !== undefined) {
|
|
108
|
+
this.data = new DeepMerger(undefined, { arrayMerge }).merge(this.data, normalized.data);
|
|
109
|
+
}
|
|
110
|
+
if (normalized.errors) {
|
|
111
|
+
this.errors.push(...normalized.errors);
|
|
112
|
+
}
|
|
113
|
+
Object.assign(this.extensions, normalized.extensions);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Provides handling for the incremental delivery specification implemented by
|
|
118
|
+
* graphql.js version `17.0.0-alpha.9`.
|
|
119
|
+
*/
|
|
120
|
+
export class GraphQL17Alpha9Handler {
|
|
121
|
+
/**
|
|
122
|
+
* @internal
|
|
123
|
+
*
|
|
124
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
125
|
+
*/
|
|
126
|
+
isIncrementalResult(result) {
|
|
127
|
+
return "hasNext" in result;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @internal
|
|
131
|
+
*
|
|
132
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
133
|
+
*/
|
|
134
|
+
prepareRequest(request) {
|
|
135
|
+
if (hasDirectives(["defer", "stream"], request.query)) {
|
|
136
|
+
const context = request.context ?? {};
|
|
137
|
+
const http = (context.http ??= {});
|
|
138
|
+
http.accept = ["multipart/mixed", ...(http.accept || [])];
|
|
139
|
+
request.context = context;
|
|
140
|
+
}
|
|
141
|
+
return request;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @internal
|
|
145
|
+
*
|
|
146
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
147
|
+
*/
|
|
148
|
+
extractErrors(result) {
|
|
149
|
+
const acc = [];
|
|
150
|
+
const push = ({ errors, }) => {
|
|
151
|
+
if (errors) {
|
|
152
|
+
acc.push(...errors);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
if (this.isIncrementalResult(result)) {
|
|
156
|
+
push(new IncrementalRequest().handle(undefined, result));
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
push(result);
|
|
160
|
+
}
|
|
161
|
+
if (acc.length) {
|
|
162
|
+
return acc;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* @internal
|
|
167
|
+
*
|
|
168
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
169
|
+
*/
|
|
170
|
+
startRequest(_) {
|
|
171
|
+
return new IncrementalRequest();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function hasIncrementalChunks(result) {
|
|
175
|
+
return isNonEmptyArray(result.incremental);
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=graphql17Alpha9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql17Alpha9.js","sources":["../../../src/incremental/handlers/graphql17Alpha9.ts"],"sourcesContent":["import type {\n DocumentNode,\n FormattedExecutionResult,\n GraphQLFormattedError,\n} from \"graphql\";\n\nimport type { ApolloLink } from \"@apollo/client/link\";\nimport type { DeepPartial, HKT } from \"@apollo/client/utilities\";\nimport { DeepMerger } from \"@apollo/client/utilities/internal\";\nimport {\n hasDirectives,\n isNonEmptyArray,\n} from \"@apollo/client/utilities/internal\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport type { Incremental } from \"../types.js\";\n\nexport declare namespace GraphQL17Alpha9Handler {\n interface GraphQL17Alpha9Result extends HKT {\n arg1: unknown; // TData\n arg2: unknown; // TExtensions\n return: GraphQL17Alpha9Handler.Chunk<Record<string, unknown>>;\n }\n\n export interface TypeOverrides {\n AdditionalApolloLinkResultTypes: GraphQL17Alpha9Result;\n }\n\n export type InitialResult<TData = Record<string, unknown>> = {\n data: TData;\n errors?: ReadonlyArray<GraphQLFormattedError>;\n pending: ReadonlyArray<PendingResult>;\n hasNext: boolean;\n extensions?: Record<string, unknown>;\n };\n\n export type SubsequentResult<TData = unknown> = {\n hasNext: boolean;\n pending?: ReadonlyArray<PendingResult>;\n incremental?: ReadonlyArray<IncrementalResult<TData>>;\n completed?: ReadonlyArray<CompletedResult>;\n extensions?: Record<string, unknown>;\n };\n\n export interface PendingResult {\n id: string;\n path: Incremental.Path;\n label?: string;\n }\n\n export interface CompletedResult {\n id: string;\n errors?: ReadonlyArray<GraphQLFormattedError>;\n }\n\n export interface IncrementalDeferResult<TData = Record<string, unknown>> {\n errors?: ReadonlyArray<GraphQLFormattedError>;\n data: TData;\n id: string;\n subPath?: Incremental.Path;\n extensions?: Record<string, unknown>;\n }\n\n export interface IncrementalStreamResult<TData = ReadonlyArray<unknown>> {\n errors?: ReadonlyArray<GraphQLFormattedError>;\n items: TData;\n id: string;\n subPath?: Incremental.Path;\n extensions?: Record<string, unknown>;\n }\n\n export type IncrementalResult<TData = unknown> =\n | IncrementalDeferResult<TData>\n | IncrementalStreamResult<TData>;\n\n export type Chunk<TData> = InitialResult<TData> | SubsequentResult<TData>;\n}\n\nclass IncrementalRequest<TData>\n implements\n Incremental.IncrementalRequest<GraphQL17Alpha9Handler.Chunk<TData>, TData>\n{\n hasNext = true;\n\n private data: any = {};\n private errors: GraphQLFormattedError[] = [];\n private extensions: Record<string, any> = {};\n private pending: GraphQL17Alpha9Handler.PendingResult[] = [];\n // `streamPositions` maps `pending.id` to the index that should be set by the\n // next `incremental` stream chunk to ensure the streamed array item is placed\n // at the correct point in the data array. `this.data` contains cached\n // references with the full array so we can't rely on the array length in\n // `this.data` to determine where to place item. This also ensures that items\n // updated by the cache between a streamed chunk aren't overwritten by merges\n // of future stream items from already merged stream items.\n private streamPositions: Record<string, number> = {};\n\n handle(\n cacheData: TData | DeepPartial<TData> | null | undefined = this.data,\n chunk: GraphQL17Alpha9Handler.Chunk<TData>\n ): FormattedExecutionResult<TData> {\n this.hasNext = chunk.hasNext;\n this.data = cacheData;\n\n if (chunk.pending) {\n this.pending.push(...chunk.pending);\n\n if (\"data\" in chunk) {\n for (const pending of chunk.pending) {\n const dataAtPath = pending.path.reduce(\n (data, key) => (data as any)[key],\n chunk.data\n );\n\n if (Array.isArray(dataAtPath)) {\n this.streamPositions[pending.id] = dataAtPath.length;\n }\n }\n }\n }\n\n this.merge(chunk, \"truncate\");\n\n if (hasIncrementalChunks(chunk)) {\n for (const incremental of chunk.incremental) {\n const pending = this.pending.find(({ id }) => incremental.id === id);\n\n invariant(\n pending,\n \"Could not find pending chunk for incremental value. Please file an issue for the Apollo Client team to investigate.\"\n );\n\n const path = pending.path.concat(incremental.subPath ?? []);\n\n let data: any;\n let arrayMerge: DeepMerger.ArrayMergeStrategy = \"truncate\";\n if (\"items\" in incremental) {\n const items = incremental.items as any[];\n const parent: any[] = [];\n\n // This creates a sparse array with values set at the indices streamed\n // from the server. DeepMerger uses Object.keys and will correctly\n // place the values in this array in the correct place\n for (let i = 0; i < items.length; i++) {\n parent[i + this.streamPositions[pending.id]] = items[i];\n }\n\n this.streamPositions[pending.id] += items.length;\n data = parent;\n } else {\n data = incremental.data;\n\n // Check if any pending streams added arrays from deferred data so\n // that we can update streamPositions with the initial length of the\n // array to ensure future streamed items are inserted at the right\n // starting index.\n for (const pendingItem of this.pending) {\n if (!(pendingItem.id in this.streamPositions)) {\n // Check if this incremental data contains array data for the pending path\n // The pending path is absolute, but incremental data is relative to the defer\n // E.g., pending.path = [\"nestedObject\"], pendingItem.path = [\"nestedObject\", \"nestedFriendList\"]\n // incremental.data = { scalarField: \"...\", nestedFriendList: [...] }\n // So we need the path from pending.path onwards\n const relativePath = pendingItem.path.slice(pending.path.length);\n const dataAtPath = relativePath.reduce(\n (data, key) => (data as any)?.[key],\n incremental.data\n );\n\n if (Array.isArray(dataAtPath)) {\n this.streamPositions[pendingItem.id] = dataAtPath.length;\n }\n }\n }\n }\n\n for (let i = path.length - 1; i >= 0; i--) {\n const key = path[i];\n const parent: Record<string | number, any> =\n typeof key === \"number\" ? [] : {};\n parent[key] = data;\n if (typeof key === \"number\") {\n arrayMerge = \"combine\";\n }\n data = parent;\n }\n\n this.merge(\n {\n data,\n extensions: incremental.extensions,\n errors: incremental.errors,\n },\n arrayMerge\n );\n }\n }\n\n if (\"completed\" in chunk && chunk.completed) {\n for (const completed of chunk.completed) {\n this.pending = this.pending.filter(({ id }) => id !== completed.id);\n\n if (completed.errors) {\n this.errors.push(...completed.errors);\n }\n }\n }\n\n const result: FormattedExecutionResult<TData> = { data: this.data };\n\n if (isNonEmptyArray(this.errors)) {\n result.errors = this.errors;\n }\n\n if (Object.keys(this.extensions).length > 0) {\n result.extensions = this.extensions;\n }\n\n return result;\n }\n\n private merge(\n normalized: FormattedExecutionResult<TData>,\n arrayMerge: DeepMerger.ArrayMergeStrategy\n ) {\n if (normalized.data !== undefined) {\n this.data = new DeepMerger(undefined, { arrayMerge }).merge(\n this.data,\n normalized.data\n );\n }\n\n if (normalized.errors) {\n this.errors.push(...normalized.errors);\n }\n\n Object.assign(this.extensions, normalized.extensions);\n }\n}\n\n/**\n * Provides handling for the incremental delivery specification implemented by\n * graphql.js version `17.0.0-alpha.9`.\n */\nexport class GraphQL17Alpha9Handler\n implements Incremental.Handler<GraphQL17Alpha9Handler.Chunk<any>>\n{\n /** @internal */\n isIncrementalResult(\n result: ApolloLink.Result<any>\n ): result is\n | GraphQL17Alpha9Handler.InitialResult\n | GraphQL17Alpha9Handler.SubsequentResult {\n return \"hasNext\" in result;\n }\n\n /** @internal */\n prepareRequest(request: ApolloLink.Request): ApolloLink.Request {\n if (hasDirectives([\"defer\", \"stream\"], request.query)) {\n const context = request.context ?? {};\n const http = (context.http ??= {});\n http.accept = [\"multipart/mixed\", ...(http.accept || [])];\n\n request.context = context;\n }\n\n return request;\n }\n\n /** @internal */\n extractErrors(result: ApolloLink.Result<any>) {\n const acc: GraphQLFormattedError[] = [];\n const push = ({\n errors,\n }: {\n errors?: ReadonlyArray<GraphQLFormattedError>;\n }) => {\n if (errors) {\n acc.push(...errors);\n }\n };\n\n if (this.isIncrementalResult(result)) {\n push(new IncrementalRequest().handle(undefined, result));\n } else {\n push(result);\n }\n\n if (acc.length) {\n return acc;\n }\n }\n\n /** @internal */\n startRequest<TData>(_: { query: DocumentNode }) {\n return new IncrementalRequest<TData>();\n }\n}\n\nfunction hasIncrementalChunks(\n result: Record<string, any>\n): result is Required<GraphQL17Alpha9Handler.SubsequentResult> {\n return isNonEmptyArray(result.incremental);\n}\n"],"names":[],"mappings":"AAQA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA2B,CAA3B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiC,CAAjC,CAA0C;IACxC;AACF;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6B,CAC3B,CADF,CAAA,CAAA,CAAA,CAAA,CAC6B,EAD7B;IAGE,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAC,CAAzB,CAAA,CAAA,CAAA,CAAA,CAA+B,CAAC,CAAhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2C,CAAC;AAC5C;"}
|
package/incremental/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { Incremental } from "./types.js";
|
|
2
2
|
export { NotImplementedHandler } from "./handlers/notImplemented.js";
|
|
3
3
|
export { Defer20220824Handler, Defer20220824Handler as GraphQL17Alpha2Handler, } from "./handlers/defer20220824.js";
|
|
4
|
+
export { GraphQL17Alpha9Handler } from "./handlers/graphql17Alpha9.js";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/incremental/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { NotImplementedHandler } from "./handlers/notImplemented.js";
|
|
2
|
-
export { Defer20220824Handler, Defer20220824Handler as GraphQL17Alpha2Handler } from "./handlers/defer20220824.js";
|
|
3
|
-
|
|
2
|
+
export { Defer20220824Handler, Defer20220824Handler as GraphQL17Alpha2Handler, } from "./handlers/defer20220824.js";
|
|
3
|
+
export { GraphQL17Alpha9Handler } from "./handlers/graphql17Alpha9.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
package/incremental/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/incremental/index.ts"],"sourcesContent":["export type { Incremental } from \"./types.js\";\nexport { NotImplementedHandler } from \"./handlers/notImplemented.js\";\nexport {\n Defer20220824Handler,\n Defer20220824Handler as GraphQL17Alpha2Handler,\n} from \"./handlers/defer20220824.js\";\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/incremental/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,IAAI,sBAAsB,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC","sourcesContent":["export type { Incremental } from \"./types.js\";\nexport { NotImplementedHandler } from \"./handlers/notImplemented.js\";\nexport {\n Defer20220824Handler,\n Defer20220824Handler as GraphQL17Alpha2Handler,\n} from \"./handlers/defer20220824.js\";\nexport { GraphQL17Alpha9Handler } from \"./handlers/graphql17Alpha9.js\";\n"]}
|