Initial Save
This commit is contained in:
2
node_modules/apollo-server-core/dist/utils/createSHA.d.ts
generated
vendored
Normal file
2
node_modules/apollo-server-core/dist/utils/createSHA.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export default function (kind: string): import('crypto').Hash;
|
||||
//# sourceMappingURL=createSHA.d.ts.map
|
||||
1
node_modules/apollo-server-core/dist/utils/createSHA.d.ts.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/createSHA.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"createSHA.d.ts","sourceRoot":"","sources":["../../src/utils/createSHA.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,WAAU,IAAI,EAAE,MAAM,GAAG,OAAO,QAAQ,EAAE,IAAI,CAO3D"}
|
||||
14
node_modules/apollo-server-core/dist/utils/createSHA.js
generated
vendored
Normal file
14
node_modules/apollo-server-core/dist/utils/createSHA.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const isNodeLike_1 = __importDefault(require("./isNodeLike"));
|
||||
function default_1(kind) {
|
||||
if (isNodeLike_1.default) {
|
||||
return module.require('crypto').createHash(kind);
|
||||
}
|
||||
return require('sha.js')(kind);
|
||||
}
|
||||
exports.default = default_1;
|
||||
//# sourceMappingURL=createSHA.js.map
|
||||
1
node_modules/apollo-server-core/dist/utils/createSHA.js.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/createSHA.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"createSHA.js","sourceRoot":"","sources":["../../src/utils/createSHA.ts"],"names":[],"mappings":";;;;;AAAA,8DAAsC;AAEtC,mBAAwB,IAAY;IAClC,IAAI,oBAAU,EAAE;QAGd,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KAClD;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAPD,4BAOC"}
|
||||
17
node_modules/apollo-server-core/dist/utils/dispatcher.d.ts
generated
vendored
Normal file
17
node_modules/apollo-server-core/dist/utils/dispatcher.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { AnyFunction, AnyFunctionMap } from "apollo-server-types";
|
||||
declare type Args<F> = F extends (...args: infer A) => any ? A : never;
|
||||
declare type AsFunction<F> = F extends AnyFunction ? F : never;
|
||||
declare type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
|
||||
declare type DidEndHook<TArgs extends any[]> = (...args: TArgs) => void;
|
||||
export declare class Dispatcher<T extends AnyFunctionMap> {
|
||||
protected targets: T[];
|
||||
constructor(targets: T[]);
|
||||
private callTargets;
|
||||
invokeHookAsync<TMethodName extends keyof T>(methodName: TMethodName, ...args: Args<T[TMethodName]>): Promise<ReturnType<AsFunction<T[TMethodName]>>[]>;
|
||||
invokeHookSync<TMethodName extends keyof T>(methodName: TMethodName, ...args: Args<T[TMethodName]>): ReturnType<AsFunction<T[TMethodName]>>[];
|
||||
reverseInvokeHookSync<TMethodName extends keyof T>(methodName: TMethodName, ...args: Args<T[TMethodName]>): ReturnType<AsFunction<T[TMethodName]>>[];
|
||||
invokeHooksUntilNonNull<TMethodName extends keyof T>(methodName: TMethodName, ...args: Args<T[TMethodName]>): Promise<UnwrapPromise<ReturnType<AsFunction<T[TMethodName]>>> | null>;
|
||||
invokeDidStartHook<TMethodName extends keyof T, TEndHookArgs extends Args<ReturnType<AsFunction<T[TMethodName]>>>>(methodName: TMethodName, ...args: Args<T[TMethodName]>): DidEndHook<TEndHookArgs>;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=dispatcher.d.ts.map
|
||||
1
node_modules/apollo-server-core/dist/utils/dispatcher.d.ts.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/dispatcher.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/utils/dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAElE,aAAK,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AAC/D,aAAK,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,WAAW,GAAG,CAAC,GAAG,KAAK,CAAC;AACvD,aAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE3D,aAAK,UAAU,CAAC,KAAK,SAAS,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;AAEhE,qBAAa,UAAU,CAAC,CAAC,SAAS,cAAc;IAClC,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE;gBAAZ,OAAO,EAAE,CAAC,EAAE;IAElC,OAAO,CAAC,WAAW;IAaN,eAAe,CAAC,WAAW,SAAS,MAAM,CAAC,EACtD,UAAU,EAAE,WAAW,EACvB,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,GAC5B,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAK7C,cAAc,CAAC,WAAW,SAAS,MAAM,CAAC,EAC/C,UAAU,EAAE,WAAW,EACvB,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,GAC5B,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;IAIpC,qBAAqB,CAAC,WAAW,SAAS,MAAM,CAAC,EACtD,UAAU,EAAE,WAAW,EACvB,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,GAC5B,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;IAI9B,uBAAuB,CAAC,WAAW,SAAS,MAAM,CAAC,EAC9D,UAAU,EAAE,WAAW,EACvB,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,GAC5B,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAcjE,kBAAkB,CACvB,WAAW,SAAS,MAAM,CAAC,EAC3B,YAAY,SAAS,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAEjE,UAAU,EAAE,WAAW,EACvB,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,GAC5B,UAAU,CAAC,YAAY,CAAC;CAqB5B"}
|
||||
71
node_modules/apollo-server-core/dist/utils/dispatcher.js
generated
vendored
Normal file
71
node_modules/apollo-server-core/dist/utils/dispatcher.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Dispatcher = void 0;
|
||||
class Dispatcher {
|
||||
constructor(targets) {
|
||||
this.targets = targets;
|
||||
}
|
||||
callTargets(targets, methodName, ...args) {
|
||||
return targets.map(target => {
|
||||
const method = target[methodName];
|
||||
if (method && typeof method === 'function') {
|
||||
return method.apply(target, args);
|
||||
}
|
||||
});
|
||||
}
|
||||
invokeHookAsync(methodName, ...args) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return yield Promise.all(this.callTargets(this.targets, methodName, ...args));
|
||||
});
|
||||
}
|
||||
invokeHookSync(methodName, ...args) {
|
||||
return this.callTargets(this.targets, methodName, ...args);
|
||||
}
|
||||
reverseInvokeHookSync(methodName, ...args) {
|
||||
return this.callTargets(this.targets.reverse(), methodName, ...args);
|
||||
}
|
||||
invokeHooksUntilNonNull(methodName, ...args) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
for (const target of this.targets) {
|
||||
const method = target[methodName];
|
||||
if (!(method && typeof method === 'function')) {
|
||||
continue;
|
||||
}
|
||||
const value = yield method.apply(target, args);
|
||||
if (value !== null) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}
|
||||
invokeDidStartHook(methodName, ...args) {
|
||||
const didEndHooks = [];
|
||||
for (const target of this.targets) {
|
||||
const method = target[methodName];
|
||||
if (method && typeof method === 'function') {
|
||||
const didEndHook = method.apply(target, args);
|
||||
if (didEndHook) {
|
||||
didEndHooks.push(didEndHook);
|
||||
}
|
||||
}
|
||||
}
|
||||
return (...args) => {
|
||||
didEndHooks.reverse();
|
||||
for (const didEndHook of didEndHooks) {
|
||||
didEndHook(...args);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.Dispatcher = Dispatcher;
|
||||
//# sourceMappingURL=dispatcher.js.map
|
||||
1
node_modules/apollo-server-core/dist/utils/dispatcher.js.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/dispatcher.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/utils/dispatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAQA,MAAa,UAAU;IACrB,YAAsB,OAAY;QAAZ,YAAO,GAAP,OAAO,CAAK;IAAG,CAAC;IAE9B,WAAW,CACjB,OAAY,EACZ,UAAuB,EACvB,GAAG,IAA0B;QAE7B,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YAC1B,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;YAClC,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;gBAC1C,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;aACnC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAEY,eAAe,CAC1B,UAAuB,EACvB,GAAG,IAA0B;;YAE7B,OAAO,MAAM,OAAO,CAAC,GAAG,CACtB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QACzD,CAAC;KAAA;IAEM,cAAc,CACnB,UAAuB,EACvB,GAAG,IAA0B;QAE7B,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7D,CAAC;IAEM,qBAAqB,CAC1B,UAAuB,EACvB,GAAG,IAA0B;QAE7B,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;IACvE,CAAC;IAEY,uBAAuB,CAClC,UAAuB,EACvB,GAAG,IAA0B;;YAE7B,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;gBACjC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;gBAClC,IAAI,CAAC,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,UAAU,CAAC,EAAE;oBAC7C,SAAS;iBACV;gBACD,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBAC/C,IAAI,KAAK,KAAK,IAAI,EAAE;oBAClB,OAAO,KAAK,CAAC;iBACd;aACF;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAEM,kBAAkB,CAIvB,UAAuB,EACvB,GAAG,IAA0B;QAE7B,MAAM,WAAW,GAA+B,EAAE,CAAC;QAEnD,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;YACjC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;YAClC,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;gBAC1C,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBAC9C,IAAI,UAAU,EAAE;oBACd,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;iBAC9B;aACF;SACF;QAED,OAAO,CAAC,GAAG,IAAkB,EAAE,EAAE;YAC/B,WAAW,CAAC,OAAO,EAAE,CAAC;YAEtB,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;gBACpC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;aACrB;QACH,CAAC,CAAC;IACJ,CAAC;CACF;AAlFD,gCAkFC"}
|
||||
3
node_modules/apollo-server-core/dist/utils/isDirectiveDefined.d.ts
generated
vendored
Normal file
3
node_modules/apollo-server-core/dist/utils/isDirectiveDefined.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { DocumentNode } from 'graphql/language';
|
||||
export declare const isDirectiveDefined: (typeDefs: (DocumentNode | string)[], directiveName: string) => boolean;
|
||||
//# sourceMappingURL=isDirectiveDefined.d.ts.map
|
||||
1
node_modules/apollo-server-core/dist/utils/isDirectiveDefined.d.ts.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/isDirectiveDefined.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isDirectiveDefined.d.ts","sourceRoot":"","sources":["../../src/utils/isDirectiveDefined.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAQ,MAAM,kBAAkB,CAAC;AAGtD,eAAO,MAAM,kBAAkB,aACnB,CAAC,YAAY,GAAG,MAAM,CAAC,EAAE,iBACpB,MAAM,KACpB,OAeF,CAAC"}
|
||||
16
node_modules/apollo-server-core/dist/utils/isDirectiveDefined.js
generated
vendored
Normal file
16
node_modules/apollo-server-core/dist/utils/isDirectiveDefined.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isDirectiveDefined = void 0;
|
||||
const language_1 = require("graphql/language");
|
||||
const __1 = require("../");
|
||||
exports.isDirectiveDefined = (typeDefs, directiveName) => {
|
||||
typeDefs = Array.isArray(typeDefs) ? typeDefs : [typeDefs];
|
||||
return typeDefs.some(typeDef => {
|
||||
if (typeof typeDef === 'string') {
|
||||
typeDef = __1.gql(typeDef);
|
||||
}
|
||||
return typeDef.definitions.some(definition => definition.kind === language_1.Kind.DIRECTIVE_DEFINITION &&
|
||||
definition.name.value === directiveName);
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=isDirectiveDefined.js.map
|
||||
1
node_modules/apollo-server-core/dist/utils/isDirectiveDefined.js.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/isDirectiveDefined.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isDirectiveDefined.js","sourceRoot":"","sources":["../../src/utils/isDirectiveDefined.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2BAA0B;AAEb,QAAA,kBAAkB,GAAG,CAChC,QAAmC,EACnC,aAAqB,EACZ,EAAE;IAEX,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAE3D,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,OAAO,GAAG,OAAG,CAAC,OAAO,CAAC,CAAC;SACxB;QAED,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAC7B,UAAU,CAAC,EAAE,CACX,UAAU,CAAC,IAAI,KAAK,eAAI,CAAC,oBAAoB;YAC7C,UAAU,CAAC,IAAI,CAAC,KAAK,KAAK,aAAa,CAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
||||
3
node_modules/apollo-server-core/dist/utils/isNodeLike.d.ts
generated
vendored
Normal file
3
node_modules/apollo-server-core/dist/utils/isNodeLike.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare const _default: boolean;
|
||||
export default _default;
|
||||
//# sourceMappingURL=isNodeLike.d.ts.map
|
||||
1
node_modules/apollo-server-core/dist/utils/isNodeLike.d.ts.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/isNodeLike.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isNodeLike.d.ts","sourceRoot":"","sources":["../../src/utils/isNodeLike.ts"],"names":[],"mappings":";AAAA,wBAU4C"}
|
||||
8
node_modules/apollo-server-core/dist/utils/isNodeLike.js
generated
vendored
Normal file
8
node_modules/apollo-server-core/dist/utils/isNodeLike.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = typeof process === 'object' &&
|
||||
process &&
|
||||
process.release &&
|
||||
process.versions &&
|
||||
typeof process.versions.node === 'string';
|
||||
//# sourceMappingURL=isNodeLike.js.map
|
||||
1
node_modules/apollo-server-core/dist/utils/isNodeLike.js.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/isNodeLike.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isNodeLike.js","sourceRoot":"","sources":["../../src/utils/isNodeLike.ts"],"names":[],"mappings":";;AAAA,kBAAe,OAAO,OAAO,KAAK,QAAQ;IACxC,OAAO;IAKP,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ;IAGhB,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC"}
|
||||
19
node_modules/apollo-server-core/dist/utils/pluginTestHarness.d.ts
generated
vendored
Normal file
19
node_modules/apollo-server-core/dist/utils/pluginTestHarness.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { WithRequired, GraphQLRequest, GraphQLRequestContextExecutionDidStart, GraphQLResponse, ValueOrPromise, GraphQLRequestContextWillSendResponse, Logger } from 'apollo-server-types';
|
||||
import { GraphQLSchema } from 'graphql/type';
|
||||
import { CacheHint } from 'apollo-cache-control';
|
||||
import { ApolloServerPlugin } from 'apollo-server-plugin-base';
|
||||
declare type IPluginTestHarnessGraphqlRequest = WithRequired<GraphQLRequest, 'query'>;
|
||||
declare type IPluginTestHarnessExecutionDidStart<TContext> = GraphQLRequestContextExecutionDidStart<TContext> & {
|
||||
request: IPluginTestHarnessGraphqlRequest;
|
||||
};
|
||||
export default function pluginTestHarness<TContext>({ pluginInstance, schema, logger, graphqlRequest, overallCachePolicy, executor, context }: {
|
||||
pluginInstance: ApolloServerPlugin<TContext>;
|
||||
schema?: GraphQLSchema;
|
||||
logger?: Logger;
|
||||
graphqlRequest: IPluginTestHarnessGraphqlRequest;
|
||||
overallCachePolicy?: Required<CacheHint>;
|
||||
executor: (requestContext: IPluginTestHarnessExecutionDidStart<TContext>) => ValueOrPromise<GraphQLResponse>;
|
||||
context?: TContext;
|
||||
}): Promise<GraphQLRequestContextWillSendResponse<TContext>>;
|
||||
export {};
|
||||
//# sourceMappingURL=pluginTestHarness.d.ts.map
|
||||
1
node_modules/apollo-server-core/dist/utils/pluginTestHarness.d.ts.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/pluginTestHarness.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pluginTestHarness.d.ts","sourceRoot":"","sources":["../../src/utils/pluginTestHarness.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,sCAAsC,EACtC,eAAe,EACf,cAAc,EACd,qCAAqC,EAErC,MAAM,EAKP,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAoC,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAKjD,OAAO,EACL,kBAAkB,EAGnB,MAAM,2BAA2B,CAAC;AAOnC,aAAK,gCAAgC,GAAG,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAC9E,aAAK,mCAAmC,CAAC,QAAQ,IAC/C,sCAAsC,CAAC,QAAQ,CAAC,GAAG;IACjD,OAAO,EAAE,gCAAgC,CAAC;CAC3C,CAAC;AAEJ,wBAA8B,iBAAiB,CAAC,QAAQ,EAAE,EACxD,cAAc,EACd,MAAM,EACN,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,OAA6B,EAC9B,EAAE;IAID,cAAc,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAS7C,MAAM,CAAC,EAAE,aAAa,CAAC;IAKvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAOhB,cAAc,EAAE,gCAAgC,CAAC;IAKjD,kBAAkB,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAKzC,QAAQ,EAAE,CACR,cAAc,EAAE,mCAAmC,CAAC,QAAQ,CAAC,KAC1D,cAAc,CAAC,eAAe,CAAC,CAAC;IAKrC,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB,GAAG,OAAO,CAAC,qCAAqC,CAAC,QAAQ,CAAC,CAAC,CAiM3D"}
|
||||
134
node_modules/apollo-server-core/dist/utils/pluginTestHarness.js
generated
vendored
Normal file
134
node_modules/apollo-server-core/dist/utils/pluginTestHarness.js
generated
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const type_1 = require("graphql/type");
|
||||
const schemaInstrumentation_1 = require("./schemaInstrumentation");
|
||||
const apollo_server_caching_1 = require("apollo-server-caching");
|
||||
const dispatcher_1 = require("./dispatcher");
|
||||
const schemaHash_1 = require("./schemaHash");
|
||||
const graphql_1 = require("graphql");
|
||||
function pluginTestHarness({ pluginInstance, schema, logger, graphqlRequest, overallCachePolicy, executor, context = Object.create(null) }) {
|
||||
var _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!schema) {
|
||||
schema = new type_1.GraphQLSchema({
|
||||
query: new type_1.GraphQLObjectType({
|
||||
name: 'RootQueryType',
|
||||
fields: {
|
||||
hello: {
|
||||
type: type_1.GraphQLString,
|
||||
resolve() {
|
||||
return 'hello world';
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
const schemaHash = schemaHash_1.generateSchemaHash(schema);
|
||||
let serverListener;
|
||||
if (typeof pluginInstance.serverWillStart === 'function') {
|
||||
const maybeServerListener = yield pluginInstance.serverWillStart({
|
||||
logger: logger || console,
|
||||
schema,
|
||||
schemaHash,
|
||||
serverlessFramework: false,
|
||||
apollo: {
|
||||
key: 'some-key',
|
||||
graphRef: 'graph@current',
|
||||
graphId: 'graph',
|
||||
graphVariant: 'current',
|
||||
},
|
||||
engine: {},
|
||||
});
|
||||
if (maybeServerListener && maybeServerListener.serverWillStop) {
|
||||
serverListener = maybeServerListener;
|
||||
}
|
||||
}
|
||||
const requestContext = {
|
||||
logger: logger || console,
|
||||
schema,
|
||||
schemaHash: schemaHash_1.generateSchemaHash(schema),
|
||||
request: graphqlRequest,
|
||||
metrics: Object.create(null),
|
||||
source: graphqlRequest.query,
|
||||
cache: new apollo_server_caching_1.InMemoryLRUCache(),
|
||||
context,
|
||||
};
|
||||
if (requestContext.source === undefined) {
|
||||
throw new Error("No source provided for test");
|
||||
}
|
||||
requestContext.overallCachePolicy = overallCachePolicy;
|
||||
if (typeof pluginInstance.requestDidStart !== "function") {
|
||||
throw new Error("This test harness expects this to be defined.");
|
||||
}
|
||||
const listener = pluginInstance.requestDidStart(requestContext);
|
||||
const dispatcher = new dispatcher_1.Dispatcher(listener ? [listener] : []);
|
||||
const executionListeners = [];
|
||||
yield dispatcher.invokeHookAsync('didResolveSource', requestContext);
|
||||
if (!requestContext.document) {
|
||||
yield dispatcher.invokeDidStartHook('parsingDidStart', requestContext);
|
||||
try {
|
||||
requestContext.document = graphql_1.parse(requestContext.source, undefined);
|
||||
}
|
||||
catch (syntaxError) {
|
||||
const errorOrErrors = syntaxError;
|
||||
requestContext.errors = Array.isArray(errorOrErrors)
|
||||
? errorOrErrors
|
||||
: [errorOrErrors];
|
||||
yield dispatcher.invokeHookAsync('didEncounterErrors', requestContext);
|
||||
return requestContext;
|
||||
}
|
||||
const validationDidEnd = yield dispatcher.invokeDidStartHook('validationDidStart', requestContext);
|
||||
const validationErrors = graphql_1.validate(requestContext.schema, requestContext.document);
|
||||
if (validationErrors.length !== 0) {
|
||||
requestContext.errors = validationErrors;
|
||||
validationDidEnd(validationErrors);
|
||||
yield dispatcher.invokeHookAsync('didEncounterErrors', requestContext);
|
||||
return requestContext;
|
||||
}
|
||||
else {
|
||||
validationDidEnd();
|
||||
}
|
||||
}
|
||||
const operation = graphql_1.getOperationAST(requestContext.document, requestContext.request.operationName);
|
||||
requestContext.operation = operation || undefined;
|
||||
requestContext.operationName =
|
||||
(operation && operation.name && operation.name.value) || null;
|
||||
yield dispatcher.invokeHookAsync('didResolveOperation', requestContext);
|
||||
dispatcher.invokeHookSync('executionDidStart', requestContext).forEach(executionListener => {
|
||||
if (typeof executionListener === 'function') {
|
||||
executionListeners.push({
|
||||
executionDidEnd: executionListener,
|
||||
});
|
||||
}
|
||||
else if (typeof executionListener === 'object') {
|
||||
executionListeners.push(executionListener);
|
||||
}
|
||||
});
|
||||
const executionDispatcher = new dispatcher_1.Dispatcher(executionListeners);
|
||||
const invokeWillResolveField = (...args) => executionDispatcher.invokeDidStartHook('willResolveField', ...args);
|
||||
Object.defineProperty(requestContext.context, schemaInstrumentation_1.symbolExecutionDispatcherWillResolveField, { value: invokeWillResolveField });
|
||||
schemaInstrumentation_1.enablePluginsForSchemaResolvers(schema);
|
||||
try {
|
||||
requestContext.response = yield executor(requestContext);
|
||||
executionDispatcher.reverseInvokeHookSync("executionDidEnd");
|
||||
}
|
||||
catch (executionErr) {
|
||||
executionDispatcher.reverseInvokeHookSync("executionDidEnd", executionErr);
|
||||
}
|
||||
yield dispatcher.invokeHookAsync("willSendResponse", requestContext);
|
||||
yield ((_a = serverListener === null || serverListener === void 0 ? void 0 : serverListener.serverWillStop) === null || _a === void 0 ? void 0 : _a.call(serverListener));
|
||||
return requestContext;
|
||||
});
|
||||
}
|
||||
exports.default = pluginTestHarness;
|
||||
//# sourceMappingURL=pluginTestHarness.js.map
|
||||
1
node_modules/apollo-server-core/dist/utils/pluginTestHarness.js.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/pluginTestHarness.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pluginTestHarness.js","sourceRoot":"","sources":["../../src/utils/pluginTestHarness.ts"],"names":[],"mappings":";;;;;;;;;;;AAcA,uCAA+E;AAE/E,mEAGiC;AAMjC,iEAAyD;AACzD,6CAA0C;AAC1C,6CAAkD;AAClD,qCAA8E;AAS9E,SAA8B,iBAAiB,CAAW,EACxD,cAAc,EACd,MAAM,EACN,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EA4C9B;;;QACC,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,IAAI,oBAAa,CAAC;gBACzB,KAAK,EAAE,IAAI,wBAAiB,CAAC;oBAC3B,IAAI,EAAE,eAAe;oBACrB,MAAM,EAAE;wBACN,KAAK,EAAE;4BACL,IAAI,EAAE,oBAAa;4BACnB,OAAO;gCACL,OAAO,aAAa,CAAC;4BACvB,CAAC;yBACF;qBACF;iBACF,CAAC;aACH,CAAC,CAAC;SACJ;QAED,MAAM,UAAU,GAAG,+BAAkB,CAAC,MAAM,CAAC,CAAC;QAC9C,IAAI,cAAiD,CAAC;QACtD,IAAI,OAAO,cAAc,CAAC,eAAe,KAAK,UAAU,EAAE;YACxD,MAAM,mBAAmB,GAAG,MAAM,cAAc,CAAC,eAAe,CAAC;gBAC/D,MAAM,EAAE,MAAM,IAAI,OAAO;gBACzB,MAAM;gBACN,UAAU;gBACV,mBAAmB,EAAE,KAAK;gBAC1B,MAAM,EAAE;oBACN,GAAG,EAAE,UAAU;oBACf,QAAQ,EAAE,eAAe;oBACzB,OAAO,EAAE,OAAO;oBAChB,YAAY,EAAE,SAAS;iBACxB;gBACD,MAAM,EAAE,EAAE;aACX,CAAC,CAAC;YACH,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,cAAc,EAAE;gBAC7D,cA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nC,CAAC,CAAC;aACJ;iBAAM,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;gBAChD,kBAAkB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;aAC5C;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,mBAAmB,GAAG,IAAI,uBAAU,CAAC,kBAAkB,CAAC,CAAC;QAK/D,MAAM,sBAAsB,GAEJ,CAAC,GAAG,IAAI,EAAE,EAAE,CAChC,mBAAmB,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,CAAC;QAExE,MAAM,CAAC,cAAc,CACnB,cAAc,CAAC,OAAO,EACtB,iEAAyC,EACzC,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAClC,CAAC;QAIF,uDAA+B,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI;YAED,cAAc,CAAC,QAAgB,GAAG,MAAM,QAAQ,CAC/C,cAA+D,CAChE,CAAC;YACF,mBAAmB,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;SAE9D;QAAC,OAAO,YAAY,EAAE;YACrB,mBAAmB,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;SAC5E;QAED,MAAM,UAAU,CAAC,eAAe,CAC9B,kBAAkB,EAClB,cAAiE,CAClE,CAAC;QAEF,aAAM,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,cAAc,+CAA9B,cAAc,EAAoB,CAAC;QAEzC,OAAO,cAAiE,CAAC;;CAC1E;AApPD,oCAoPC"}
|
||||
3
node_modules/apollo-server-core/dist/utils/runtimeSupportsUploads.d.ts
generated
vendored
Normal file
3
node_modules/apollo-server-core/dist/utils/runtimeSupportsUploads.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare const runtimeSupportsUploads: boolean;
|
||||
export default runtimeSupportsUploads;
|
||||
//# sourceMappingURL=runtimeSupportsUploads.d.ts.map
|
||||
1
node_modules/apollo-server-core/dist/utils/runtimeSupportsUploads.d.ts.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/runtimeSupportsUploads.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"runtimeSupportsUploads.d.ts","sourceRoot":"","sources":["../../src/utils/runtimeSupportsUploads.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,sBAAsB,SAexB,CAAC;AAEL,eAAe,sBAAsB,CAAC"}
|
||||
20
node_modules/apollo-server-core/dist/utils/runtimeSupportsUploads.js
generated
vendored
Normal file
20
node_modules/apollo-server-core/dist/utils/runtimeSupportsUploads.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const isNodeLike_1 = __importDefault(require("./isNodeLike"));
|
||||
const runtimeSupportsUploads = (() => {
|
||||
if (isNodeLike_1.default) {
|
||||
const [nodeMajor, nodeMinor] = process.versions.node
|
||||
.split('.', 2)
|
||||
.map(segment => parseInt(segment, 10));
|
||||
if (nodeMajor < 8 || (nodeMajor === 8 && nodeMinor < 5)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})();
|
||||
exports.default = runtimeSupportsUploads;
|
||||
//# sourceMappingURL=runtimeSupportsUploads.js.map
|
||||
1
node_modules/apollo-server-core/dist/utils/runtimeSupportsUploads.js.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/runtimeSupportsUploads.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"runtimeSupportsUploads.js","sourceRoot":"","sources":["../../src/utils/runtimeSupportsUploads.ts"],"names":[],"mappings":";;;;;AAAA,8DAAsC;AAEtC,MAAM,sBAAsB,GAAG,CAAC,GAAG,EAAE;IACnC,IAAI,oBAAU,EAAE;QACd,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI;aACjD,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;aACb,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QAEzC,IAAI,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,EAAE;YACvD,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,CAAC;KACb;IAID,OAAO,KAAK,CAAC;AACf,CAAC,CAAC,EAAE,CAAC;AAEL,kBAAe,sBAAsB,CAAC"}
|
||||
4
node_modules/apollo-server-core/dist/utils/schemaHash.d.ts
generated
vendored
Normal file
4
node_modules/apollo-server-core/dist/utils/schemaHash.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { GraphQLSchema } from 'graphql/type';
|
||||
import { SchemaHash } from "apollo-server-types";
|
||||
export declare function generateSchemaHash(schema: GraphQLSchema): SchemaHash;
|
||||
//# sourceMappingURL=schemaHash.d.ts.map
|
||||
1
node_modules/apollo-server-core/dist/utils/schemaHash.d.ts.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/schemaHash.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"schemaHash.d.ts","sourceRoot":"","sources":["../../src/utils/schemaHash.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,UAAU,CAoCpE"}
|
||||
34
node_modules/apollo-server-core/dist/utils/schemaHash.js
generated
vendored
Normal file
34
node_modules/apollo-server-core/dist/utils/schemaHash.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.generateSchemaHash = void 0;
|
||||
const language_1 = require("graphql/language");
|
||||
const execution_1 = require("graphql/execution");
|
||||
const utilities_1 = require("graphql/utilities");
|
||||
const fast_json_stable_stringify_1 = __importDefault(require("fast-json-stable-stringify"));
|
||||
const createSHA_1 = __importDefault(require("./createSHA"));
|
||||
function generateSchemaHash(schema) {
|
||||
const introspectionQuery = utilities_1.getIntrospectionQuery();
|
||||
const documentAST = language_1.parse(introspectionQuery);
|
||||
const result = execution_1.execute(schema, documentAST);
|
||||
if (result &&
|
||||
typeof result.then === 'function') {
|
||||
throw new Error([
|
||||
'The introspection query is resolving asynchronously; execution of an introspection query is not expected to return a `Promise`.',
|
||||
'',
|
||||
'Wrapped type resolvers should maintain the existing execution dynamics of the resolvers they wrap (i.e. async vs sync) or introspection types should be excluded from wrapping by checking them with `graphql/type`s, `isIntrospectionType` predicate function prior to wrapping.',
|
||||
].join('\n'));
|
||||
}
|
||||
if (!result || !result.data || !result.data.__schema) {
|
||||
throw new Error('Unable to generate server introspection document.');
|
||||
}
|
||||
const introspectionSchema = result.data.__schema;
|
||||
const stringifiedSchema = fast_json_stable_stringify_1.default(introspectionSchema);
|
||||
return createSHA_1.default('sha512')
|
||||
.update(stringifiedSchema)
|
||||
.digest('hex');
|
||||
}
|
||||
exports.generateSchemaHash = generateSchemaHash;
|
||||
//# sourceMappingURL=schemaHash.js.map
|
||||
1
node_modules/apollo-server-core/dist/utils/schemaHash.js.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/schemaHash.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"schemaHash.js","sourceRoot":"","sources":["../../src/utils/schemaHash.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyC;AACzC,iDAA6D;AAC7D,iDAA+E;AAC/E,4FAAyD;AAEzD,4DAAoC;AAGpC,SAAgB,kBAAkB,CAAC,MAAqB;IACtD,MAAM,kBAAkB,GAAG,iCAAqB,EAAE,CAAC;IACnD,MAAM,WAAW,GAAG,gBAAK,CAAC,kBAAkB,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,mBAAO,CAAC,MAAM,EAAE,WAAW,CAAoB,CAAC;IAM/D,IACE,MAAM;QACN,OAAQ,MAAqC,CAAC,IAAI,KAAK,UAAU,EACjE;QACA,MAAM,IAAI,KAAK,CACb;YACE,iIAAiI;YACjI,EAAE;YACF,mRAAmR;SACpR,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;KACH;IAED,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE;QACpD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACtE;IAED,MAAM,mBAAmB,GAAwB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IAKtE,MAAM,iBAAiB,GAAG,oCAAe,CAAC,mBAAmB,CAAC,CAAC;IAE/D,OAAO,mBAAS,CAAC,QAAQ,CAAC;SACvB,MAAM,CAAC,iBAAiB,CAAC;SACzB,MAAM,CAAC,KAAK,CAAe,CAAC;AACjC,CAAC;AApCD,gDAoCC"}
|
||||
11
node_modules/apollo-server-core/dist/utils/schemaInstrumentation.d.ts
generated
vendored
Normal file
11
node_modules/apollo-server-core/dist/utils/schemaInstrumentation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { GraphQLSchema } from 'graphql/type';
|
||||
export declare const symbolExecutionDispatcherWillResolveField: unique symbol;
|
||||
export declare const symbolUserFieldResolver: unique symbol;
|
||||
export declare const symbolPluginsEnabled: unique symbol;
|
||||
export declare function enablePluginsForSchemaResolvers(schema: GraphQLSchema & {
|
||||
[symbolPluginsEnabled]?: boolean;
|
||||
}): GraphQLSchema & {
|
||||
[symbolPluginsEnabled]?: boolean | undefined;
|
||||
};
|
||||
export declare function whenResultIsFinished(result: any, callback: (err: Error | null, result?: any) => void): void;
|
||||
//# sourceMappingURL=schemaInstrumentation.d.ts.map
|
||||
1
node_modules/apollo-server-core/dist/utils/schemaInstrumentation.d.ts.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/schemaInstrumentation.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"schemaInstrumentation.d.ts","sourceRoot":"","sources":["../../src/utils/schemaInstrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAMd,MAAM,cAAc,CAAC;AAMtB,eAAO,MAAM,yCAAyC,eACK,CAAC;AAC5D,eAAO,MAAM,uBAAuB,eACK,CAAC;AAC1C,eAAO,MAAM,oBAAoB,eAAuC,CAAC;AAEzE,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,aAAa,GAAG;IAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,OAAO,CAAA;CAAE;;EAY7D;AAmGD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,GAAG,EACX,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,QAgBpD"}
|
||||
100
node_modules/apollo-server-core/dist/utils/schemaInstrumentation.js
generated
vendored
Normal file
100
node_modules/apollo-server-core/dist/utils/schemaInstrumentation.js
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.whenResultIsFinished = exports.enablePluginsForSchemaResolvers = exports.symbolPluginsEnabled = exports.symbolUserFieldResolver = exports.symbolExecutionDispatcherWillResolveField = void 0;
|
||||
const type_1 = require("graphql/type");
|
||||
const execution_1 = require("graphql/execution");
|
||||
exports.symbolExecutionDispatcherWillResolveField = Symbol("apolloServerExecutionDispatcherWillResolveField");
|
||||
exports.symbolUserFieldResolver = Symbol("apolloServerUserFieldResolver");
|
||||
exports.symbolPluginsEnabled = Symbol("apolloServerPluginsEnabled");
|
||||
function enablePluginsForSchemaResolvers(schema) {
|
||||
if (schema[exports.symbolPluginsEnabled]) {
|
||||
return schema;
|
||||
}
|
||||
Object.defineProperty(schema, exports.symbolPluginsEnabled, {
|
||||
value: true,
|
||||
});
|
||||
forEachField(schema, wrapField);
|
||||
return schema;
|
||||
}
|
||||
exports.enablePluginsForSchemaResolvers = enablePluginsForSchemaResolvers;
|
||||
function wrapField(field) {
|
||||
const originalFieldResolve = field.resolve;
|
||||
field.resolve = (source, args, context, info) => {
|
||||
const parentPath = info.path.prev;
|
||||
const willResolveField = context === null || context === void 0 ? void 0 : context[exports.symbolExecutionDispatcherWillResolveField];
|
||||
const userFieldResolver = context === null || context === void 0 ? void 0 : context[exports.symbolUserFieldResolver];
|
||||
const didResolveField = typeof willResolveField === 'function' &&
|
||||
willResolveField({ source, args, context, info });
|
||||
const resolveObject = info.parentType.resolveObject;
|
||||
let whenObjectResolved;
|
||||
if (parentPath && resolveObject) {
|
||||
if (!parentPath.__fields) {
|
||||
parentPath.__fields = {};
|
||||
}
|
||||
parentPath.__fields[info.fieldName] = info.fieldNodes;
|
||||
whenObjectResolved = parentPath.__whenObjectResolved;
|
||||
if (!whenObjectResolved) {
|
||||
whenObjectResolved = Promise.resolve().then(() => {
|
||||
return resolveObject(source, parentPath.__fields, context, info);
|
||||
});
|
||||
parentPath.__whenObjectResolved = whenObjectResolved;
|
||||
}
|
||||
}
|
||||
const fieldResolver = originalFieldResolve || userFieldResolver || execution_1.defaultFieldResolver;
|
||||
try {
|
||||
let result;
|
||||
if (whenObjectResolved) {
|
||||
result = whenObjectResolved.then((resolvedObject) => {
|
||||
return fieldResolver(resolvedObject, args, context, info);
|
||||
});
|
||||
}
|
||||
else {
|
||||
result = fieldResolver(source, args, context, info);
|
||||
}
|
||||
if (typeof didResolveField === "function") {
|
||||
whenResultIsFinished(result, didResolveField);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
catch (error) {
|
||||
if (typeof didResolveField === "function") {
|
||||
didResolveField(error);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
;
|
||||
}
|
||||
function isPromise(x) {
|
||||
return x && typeof x.then === 'function';
|
||||
}
|
||||
function whenResultIsFinished(result, callback) {
|
||||
if (isPromise(result)) {
|
||||
result.then((r) => callback(null, r), (err) => callback(err));
|
||||
}
|
||||
else if (Array.isArray(result)) {
|
||||
if (result.some(isPromise)) {
|
||||
Promise.all(result).then((r) => callback(null, r), (err) => callback(err));
|
||||
}
|
||||
else {
|
||||
callback(null, result);
|
||||
}
|
||||
}
|
||||
else {
|
||||
callback(null, result);
|
||||
}
|
||||
}
|
||||
exports.whenResultIsFinished = whenResultIsFinished;
|
||||
function forEachField(schema, fn) {
|
||||
const typeMap = schema.getTypeMap();
|
||||
Object.entries(typeMap).forEach(([typeName, type]) => {
|
||||
if (!type_1.getNamedType(type).name.startsWith('__') &&
|
||||
type instanceof type_1.GraphQLObjectType) {
|
||||
const fields = type.getFields();
|
||||
Object.entries(fields).forEach(([fieldName, field]) => {
|
||||
fn(field, typeName, fieldName);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=schemaInstrumentation.js.map
|
||||
1
node_modules/apollo-server-core/dist/utils/schemaInstrumentation.js.map
generated
vendored
Normal file
1
node_modules/apollo-server-core/dist/utils/schemaInstrumentation.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"schemaInstrumentation.js","sourceRoot":"","sources":["../../src/utils/schemaInstrumentation.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AACtB,iDAAyD;AAK5C,QAAA,yCAAyC,GACpD,MAAM,CAAC,iDAAiD,CAAC,CAAC;AAC/C,QAAA,uBAAuB,GAClC,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAC7B,QAAA,oBAAoB,GAAG,MAAM,CAAC,4BAA4B,CAAC,CAAC;AAEzE,SA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