@graphitation/supermassive 2.4.7 → 2.5.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/.eslintcache +1 -1
- package/CHANGELOG.md +18 -2
- package/README.md +2 -42
- package/lib/benchmarks/index.js +3 -3
- package/lib/benchmarks/index.js.map +7 -0
- package/lib/benchmarks/index.mjs +2 -2
- package/lib/benchmarks/index.mjs.map +7 -0
- package/lib/benchmarks/nice-benchmark.js.map +7 -0
- package/lib/benchmarks/nice-benchmark.mjs.map +7 -0
- package/lib/benchmarks/swapi-schema/index.js.map +7 -0
- package/lib/benchmarks/swapi-schema/index.mjs.map +7 -0
- package/lib/benchmarks/swapi-schema/models.js.map +7 -0
- package/lib/benchmarks/swapi-schema/models.mjs.map +7 -0
- package/lib/benchmarks/swapi-schema/resolvers.js.map +7 -0
- package/lib/benchmarks/swapi-schema/resolvers.mjs.map +7 -0
- package/lib/collectFields.d.ts +1 -1
- package/lib/collectFields.d.ts.map +1 -1
- package/lib/collectFields.js.map +7 -0
- package/lib/collectFields.mjs.map +7 -0
- package/lib/definition.js.map +7 -0
- package/lib/definition.mjs.map +7 -0
- package/lib/directives.d.ts +1 -1
- package/lib/directives.d.ts.map +1 -1
- package/lib/directives.js.map +7 -0
- package/lib/directives.mjs.map +7 -0
- package/lib/executeWithSchema.js.map +7 -0
- package/lib/executeWithSchema.mjs.map +7 -0
- package/lib/executeWithoutSchema.d.ts +1 -1
- package/lib/executeWithoutSchema.d.ts.map +1 -1
- package/lib/executeWithoutSchema.js.map +7 -0
- package/lib/executeWithoutSchema.mjs.map +7 -0
- package/lib/extractImplicitTypesRuntime.js.map +7 -0
- package/lib/extractImplicitTypesRuntime.mjs.map +7 -0
- package/lib/hooks/types.js.map +7 -0
- package/lib/hooks/types.mjs.map +7 -0
- package/lib/index.d.ts +6 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -4
- package/lib/index.js.map +7 -0
- package/lib/index.mjs +4 -2
- package/lib/index.mjs.map +7 -0
- package/lib/jsutils/Maybe.js.map +7 -0
- package/lib/jsutils/Maybe.mjs.map +7 -0
- package/lib/jsutils/ObjMap.js.map +7 -0
- package/lib/jsutils/ObjMap.mjs.map +7 -0
- package/lib/jsutils/Path.js.map +7 -0
- package/lib/jsutils/Path.mjs.map +7 -0
- package/lib/jsutils/PromiseOrValue.js.map +7 -0
- package/lib/jsutils/PromiseOrValue.mjs.map +7 -0
- package/lib/jsutils/devAssert.js.map +7 -0
- package/lib/jsutils/devAssert.mjs.map +7 -0
- package/lib/jsutils/didYouMean.js.map +7 -0
- package/lib/jsutils/didYouMean.mjs.map +7 -0
- package/lib/jsutils/identityFunc.js.map +7 -0
- package/lib/jsutils/identityFunc.mjs.map +7 -0
- package/lib/jsutils/inspect.js.map +7 -0
- package/lib/jsutils/inspect.mjs.map +7 -0
- package/lib/jsutils/instanceOf.d.ts.map +1 -1
- package/lib/jsutils/instanceOf.js +1 -4
- package/lib/jsutils/instanceOf.js.map +7 -0
- package/lib/jsutils/instanceOf.mjs +1 -4
- package/lib/jsutils/instanceOf.mjs.map +7 -0
- package/lib/jsutils/invariant.js.map +7 -0
- package/lib/jsutils/invariant.mjs.map +7 -0
- package/lib/jsutils/isAsyncIterable.js.map +7 -0
- package/lib/jsutils/isAsyncIterable.mjs.map +7 -0
- package/lib/jsutils/isIterableObject.js.map +7 -0
- package/lib/jsutils/isIterableObject.mjs.map +7 -0
- package/lib/jsutils/isObjectLike.js.map +7 -0
- package/lib/jsutils/isObjectLike.mjs.map +7 -0
- package/lib/jsutils/isPromise.js.map +7 -0
- package/lib/jsutils/isPromise.mjs.map +7 -0
- package/lib/jsutils/keyMap.js.map +7 -0
- package/lib/jsutils/keyMap.mjs.map +7 -0
- package/lib/jsutils/keyValMap.js.map +7 -0
- package/lib/jsutils/keyValMap.mjs.map +7 -0
- package/lib/jsutils/mapValue.js.map +7 -0
- package/lib/jsutils/mapValue.mjs.map +7 -0
- package/lib/jsutils/memoize3.js.map +7 -0
- package/lib/jsutils/memoize3.mjs.map +7 -0
- package/lib/jsutils/naturalCompare.js.map +7 -0
- package/lib/jsutils/naturalCompare.mjs.map +7 -0
- package/lib/jsutils/printPathArray.js.map +7 -0
- package/lib/jsutils/printPathArray.mjs.map +7 -0
- package/lib/jsutils/promiseForObject.js.map +7 -0
- package/lib/jsutils/promiseForObject.mjs.map +7 -0
- package/lib/jsutils/promiseReduce.js.map +7 -0
- package/lib/jsutils/promiseReduce.mjs.map +7 -0
- package/lib/jsutils/suggestionList.js.map +7 -0
- package/lib/jsutils/suggestionList.mjs.map +7 -0
- package/lib/jsutils/toObjMap.js.map +7 -0
- package/lib/jsutils/toObjMap.mjs.map +7 -0
- package/lib/subscribeWithSchema.js.map +7 -0
- package/lib/subscribeWithSchema.mjs.map +7 -0
- package/lib/subscribeWithoutSchema.d.ts +1 -1
- package/lib/subscribeWithoutSchema.d.ts.map +1 -1
- package/lib/subscribeWithoutSchema.js.map +7 -0
- package/lib/subscribeWithoutSchema.mjs.map +7 -0
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +7 -0
- package/lib/types.mjs.map +7 -0
- package/lib/utilities/array.js.map +7 -0
- package/lib/utilities/array.mjs.map +7 -0
- package/lib/utilities/blankGraphQLTag.js.map +7 -0
- package/lib/utilities/blankGraphQLTag.mjs.map +7 -0
- package/lib/utilities/mapAsyncIterator.js.map +7 -0
- package/lib/utilities/mapAsyncIterator.mjs.map +7 -0
- package/lib/utilities/mergeResolvers.d.ts.map +1 -1
- package/lib/utilities/mergeResolvers.js +2 -1
- package/lib/utilities/mergeResolvers.js.map +7 -0
- package/lib/utilities/mergeResolvers.mjs +2 -1
- package/lib/utilities/mergeResolvers.mjs.map +7 -0
- package/lib/utilities/typeNameFromAST.d.ts +1 -1
- package/lib/utilities/typeNameFromAST.d.ts.map +1 -1
- package/lib/utilities/typeNameFromAST.js.map +7 -0
- package/lib/utilities/typeNameFromAST.mjs.map +7 -0
- package/lib/values.d.ts +1 -1
- package/lib/values.d.ts.map +1 -1
- package/lib/values.js.map +7 -0
- package/lib/values.mjs.map +7 -0
- package/package.json +7 -3
- package/lib/ast/TypedAST.d.ts +0 -367
- package/lib/ast/TypedAST.d.ts.map +0 -1
- package/lib/ast/TypedAST.js +0 -16
- package/lib/ast/TypedAST.mjs +0 -0
- package/lib/ast/addTypesToRequestDocument.d.ts +0 -6
- package/lib/ast/addTypesToRequestDocument.d.ts.map +0 -1
- package/lib/ast/addTypesToRequestDocument.js +0 -161
- package/lib/ast/addTypesToRequestDocument.mjs +0 -153
- package/lib/transforms/annotateDocumentGraphQLTransform.d.ts +0 -3
- package/lib/transforms/annotateDocumentGraphQLTransform.d.ts.map +0 -1
- package/lib/transforms/annotateDocumentGraphQLTransform.js +0 -34
- package/lib/transforms/annotateDocumentGraphQLTransform.mjs +0 -17
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/array.ts"],
|
|
4
|
+
"sourcesContent": ["export function arraysAreEqual(\n array1: readonly unknown[],\n array2: readonly unknown[],\n): boolean {\n if (array1.length !== array2.length) {\n return false;\n }\n for (let i = 0; i < array1.length - 1; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}\n"],
|
|
5
|
+
"mappings": ";AAAO,SAAS,eACd,QACA,QACS;AACT,MAAI,OAAO,WAAW,OAAO,QAAQ;AACnC,WAAO;AAAA,EACT;AACA,WAAS,IAAI,GAAG,IAAI,OAAO,SAAS,GAAG,KAAK;AAC1C,QAAI,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG;AAC3B,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/blankGraphQLTag.ts"],
|
|
4
|
+
"sourcesContent": ["export default function blankGraphQLTag(strings: TemplateStringsArray): string {\n return strings[0];\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAe,SAAR,gBAAiC,SAAuC;AAC7E,SAAO,QAAQ,CAAC;AAClB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/blankGraphQLTag.ts"],
|
|
4
|
+
"sourcesContent": ["export default function blankGraphQLTag(strings: TemplateStringsArray): string {\n return strings[0];\n}\n"],
|
|
5
|
+
"mappings": ";AAAe,SAAR,gBAAiC,SAAuC;AAC7E,SAAO,QAAQ,CAAC;AAClB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/mapAsyncIterator.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Taken from https://github.com/graphql/graphql-js/blob/40c160e9fb0e1ff92fc954c03274adf94c3004a9/src/execution/mapAsyncIterator.ts\n * MIT license https://github.com/graphql/graphql-js/blob/40c160e9fb0e1ff92fc954c03274adf94c3004a9/LICENSE\n */\n\nimport type { PromiseOrValue } from \"../jsutils/PromiseOrValue\";\n\n/**\n * Given an AsyncIterable and a callback function, return an AsyncIterator\n * which produces values mapped via calling the callback function.\n */\nexport function mapAsyncIterator<T, U, R = undefined>(\n iterable: AsyncGenerator<T, R, void> | AsyncIterable<T>,\n callback: (value: T) => PromiseOrValue<U>,\n): AsyncGenerator<U, R, void> {\n const iterator = iterable[Symbol.asyncIterator]();\n\n async function mapResult(\n result: IteratorResult<T, R>,\n ): Promise<IteratorResult<U, R>> {\n if (result.done) {\n return result;\n }\n\n try {\n return { value: await callback(result.value), done: false };\n } catch (error) {\n // istanbul ignore else (FIXME: add test case)\n if (typeof iterator.return === \"function\") {\n try {\n await iterator.return();\n } catch (_e) {\n /* ignore error */\n }\n }\n throw error;\n }\n }\n\n return {\n async next() {\n return mapResult(await iterator.next());\n },\n async return(): Promise<IteratorResult<U, R>> {\n // If iterator.return() does not exist, then type R must be undefined.\n return typeof iterator.return === \"function\"\n ? mapResult(await iterator.return())\n : { value: undefined as unknown as R, done: true };\n },\n async throw(error?: unknown) {\n return typeof iterator.throw === \"function\"\n ? mapResult(await iterator.throw(error))\n : Promise.reject(error);\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,SAAS,iBACd,UACA,UAC4B;AAC5B,QAAM,WAAW,SAAS,OAAO,aAAa,EAAE;AAEhD,WAAe,UACb,QAC+B;AAAA;AAC/B,UAAI,OAAO,MAAM;AACf,eAAO;AAAA,MACT;AAEA,UAAI;AACF,eAAO,EAAE,OAAO,MAAM,SAAS,OAAO,KAAK,GAAG,MAAM,MAAM;AAAA,MAC5D,SAAS,OAAP;AAEA,YAAI,OAAO,SAAS,WAAW,YAAY;AACzC,cAAI;AACF,kBAAM,SAAS,OAAO;AAAA,UACxB,SAAS,IAAP;AAAA,UAEF;AAAA,QACF;AACA,cAAM;AAAA,MACR;AAAA,IACF;AAAA;AAEA,SAAO;AAAA,IACC,OAAO;AAAA;AACX,eAAO,UAAU,MAAM,SAAS,KAAK,CAAC;AAAA,MACxC;AAAA;AAAA,IACM,SAAwC;AAAA;AAE5C,eAAO,OAAO,SAAS,WAAW,aAC9B,UAAU,MAAM,SAAS,OAAO,CAAC,IACjC,EAAE,OAAO,QAA2B,MAAM,KAAK;AAAA,MACrD;AAAA;AAAA,IACM,MAAM,OAAiB;AAAA;AAC3B,eAAO,OAAO,SAAS,UAAU,aAC7B,UAAU,MAAM,SAAS,MAAM,KAAK,CAAC,IACrC,QAAQ,OAAO,KAAK;AAAA,MAC1B;AAAA;AAAA,IACA,CAAC,OAAO,aAAa,IAAI;AACvB,aAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/mapAsyncIterator.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Taken from https://github.com/graphql/graphql-js/blob/40c160e9fb0e1ff92fc954c03274adf94c3004a9/src/execution/mapAsyncIterator.ts\n * MIT license https://github.com/graphql/graphql-js/blob/40c160e9fb0e1ff92fc954c03274adf94c3004a9/LICENSE\n */\n\nimport type { PromiseOrValue } from \"../jsutils/PromiseOrValue\";\n\n/**\n * Given an AsyncIterable and a callback function, return an AsyncIterator\n * which produces values mapped via calling the callback function.\n */\nexport function mapAsyncIterator<T, U, R = undefined>(\n iterable: AsyncGenerator<T, R, void> | AsyncIterable<T>,\n callback: (value: T) => PromiseOrValue<U>,\n): AsyncGenerator<U, R, void> {\n const iterator = iterable[Symbol.asyncIterator]();\n\n async function mapResult(\n result: IteratorResult<T, R>,\n ): Promise<IteratorResult<U, R>> {\n if (result.done) {\n return result;\n }\n\n try {\n return { value: await callback(result.value), done: false };\n } catch (error) {\n // istanbul ignore else (FIXME: add test case)\n if (typeof iterator.return === \"function\") {\n try {\n await iterator.return();\n } catch (_e) {\n /* ignore error */\n }\n }\n throw error;\n }\n }\n\n return {\n async next() {\n return mapResult(await iterator.next());\n },\n async return(): Promise<IteratorResult<U, R>> {\n // If iterator.return() does not exist, then type R must be undefined.\n return typeof iterator.return === \"function\"\n ? mapResult(await iterator.return())\n : { value: undefined as unknown as R, done: true };\n },\n async throw(error?: unknown) {\n return typeof iterator.throw === \"function\"\n ? mapResult(await iterator.throw(error))\n : Promise.reject(error);\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,iBACd,UACA,UAC4B;AAC5B,QAAM,WAAW,SAAS,OAAO,aAAa,EAAE;AAEhD,WAAe,UACb,QAC+B;AAAA;AAC/B,UAAI,OAAO,MAAM;AACf,eAAO;AAAA,MACT;AAEA,UAAI;AACF,eAAO,EAAE,OAAO,MAAM,SAAS,OAAO,KAAK,GAAG,MAAM,MAAM;AAAA,MAC5D,SAAS,OAAP;AAEA,YAAI,OAAO,SAAS,WAAW,YAAY;AACzC,cAAI;AACF,kBAAM,SAAS,OAAO;AAAA,UACxB,SAAS,IAAP;AAAA,UAEF;AAAA,QACF;AACA,cAAM;AAAA,MACR;AAAA,IACF;AAAA;AAEA,SAAO;AAAA,IACC,OAAO;AAAA;AACX,eAAO,UAAU,MAAM,SAAS,KAAK,CAAC;AAAA,MACxC;AAAA;AAAA,IACM,SAAwC;AAAA;AAE5C,eAAO,OAAO,SAAS,WAAW,aAC9B,UAAU,MAAM,SAAS,OAAO,CAAC,IACjC,EAAE,OAAO,QAA2B,MAAM,KAAK;AAAA,MACrD;AAAA;AAAA,IACM,MAAM,OAAiB;AAAA;AAC3B,eAAO,OAAO,SAAS,UAAU,aAC7B,UAAU,MAAM,SAAS,MAAM,KAAK,CAAC,IACrC,QAAQ,OAAO,KAAK;AAAA,MAC1B;AAAA;AAAA,IACA,CAAC,OAAO,aAAa,IAAI;AACvB,aAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeResolvers.d.ts","sourceRoot":"","sources":["../../src/utilities/mergeResolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAY,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"mergeResolvers.d.ts","sourceRoot":"","sources":["../../src/utilities/mergeResolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAY,MAAM,UAAU,CAAC;AAG9D,wBAAgB,cAAc,CAC5B,SAAS,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,EAC1C,kBAAkB,EAAE,SAAS,GAC5B,SAAS,CAoBX"}
|
|
@@ -35,10 +35,11 @@ __export(mergeResolvers_exports, {
|
|
|
35
35
|
mergeResolvers: () => mergeResolvers
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(mergeResolvers_exports);
|
|
38
|
+
var import_isObjectLike = require("../jsutils/isObjectLike");
|
|
38
39
|
function mergeResolvers(resolvers, extractedResolvers) {
|
|
39
40
|
const fullResolvers = __spreadValues({}, extractedResolvers);
|
|
40
41
|
Object.keys(resolvers).forEach((resolverKey) => {
|
|
41
|
-
if (fullResolvers[resolverKey]
|
|
42
|
+
if ((0, import_isObjectLike.isObjectLike)(fullResolvers[resolverKey])) {
|
|
42
43
|
fullResolvers[resolverKey] = __spreadValues(__spreadValues({}, fullResolvers[resolverKey]), resolvers[resolverKey]);
|
|
43
44
|
} else {
|
|
44
45
|
fullResolvers[resolverKey] = resolvers[resolverKey];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/mergeResolvers.ts"],
|
|
4
|
+
"sourcesContent": ["import { UserResolvers, Resolvers, Resolver } from \"../types\";\nimport { isObjectLike } from \"../jsutils/isObjectLike\";\n\nexport function mergeResolvers(\n resolvers: UserResolvers<unknown, unknown>,\n extractedResolvers: Resolvers,\n): Resolvers {\n const fullResolvers = {\n ...extractedResolvers,\n } as Resolvers;\n\n Object.keys(resolvers).forEach((resolverKey: string) => {\n if (isObjectLike(fullResolvers[resolverKey])) {\n fullResolvers[resolverKey] = {\n ...fullResolvers[resolverKey],\n ...resolvers[resolverKey],\n } as Resolver<unknown, unknown>;\n } else {\n fullResolvers[resolverKey] = resolvers[resolverKey] as Resolver<\n unknown,\n unknown\n >;\n }\n });\n\n return fullResolvers;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAA6B;AAEtB,SAAS,eACd,WACA,oBACW;AACX,QAAM,gBAAgB,mBACjB;AAGL,SAAO,KAAK,SAAS,EAAE,QAAQ,CAAC,gBAAwB;AACtD,YAAI,kCAAa,cAAc,WAAW,CAAC,GAAG;AAC5C,oBAAc,WAAW,IAAI,kCACxB,cAAc,WAAW,IACzB,UAAU,WAAW;AAAA,IAE5B,OAAO;AACL,oBAAc,WAAW,IAAI,UAAU,WAAW;AAAA,IAIpD;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -16,10 +16,11 @@ var __spreadValues = (a, b) => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
// src/utilities/mergeResolvers.ts
|
|
19
|
+
import { isObjectLike } from "../jsutils/isObjectLike.mjs";
|
|
19
20
|
function mergeResolvers(resolvers, extractedResolvers) {
|
|
20
21
|
const fullResolvers = __spreadValues({}, extractedResolvers);
|
|
21
22
|
Object.keys(resolvers).forEach((resolverKey) => {
|
|
22
|
-
if (fullResolvers[resolverKey]
|
|
23
|
+
if (isObjectLike(fullResolvers[resolverKey])) {
|
|
23
24
|
fullResolvers[resolverKey] = __spreadValues(__spreadValues({}, fullResolvers[resolverKey]), resolvers[resolverKey]);
|
|
24
25
|
} else {
|
|
25
26
|
fullResolvers[resolverKey] = resolvers[resolverKey];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/mergeResolvers.ts"],
|
|
4
|
+
"sourcesContent": ["import { UserResolvers, Resolvers, Resolver } from \"../types\";\nimport { isObjectLike } from \"../jsutils/isObjectLike\";\n\nexport function mergeResolvers(\n resolvers: UserResolvers<unknown, unknown>,\n extractedResolvers: Resolvers,\n): Resolvers {\n const fullResolvers = {\n ...extractedResolvers,\n } as Resolvers;\n\n Object.keys(resolvers).forEach((resolverKey: string) => {\n if (isObjectLike(fullResolvers[resolverKey])) {\n fullResolvers[resolverKey] = {\n ...fullResolvers[resolverKey],\n ...resolvers[resolverKey],\n } as Resolver<unknown, unknown>;\n } else {\n fullResolvers[resolverKey] = resolvers[resolverKey] as Resolver<\n unknown,\n unknown\n >;\n }\n });\n\n return fullResolvers;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AACA,SAAS,oBAAoB;AAEtB,SAAS,eACd,WACA,oBACW;AACX,QAAM,gBAAgB,mBACjB;AAGL,SAAO,KAAK,SAAS,EAAE,QAAQ,CAAC,gBAAwB;AACtD,QAAI,aAAa,cAAc,WAAW,CAAC,GAAG;AAC5C,oBAAc,WAAW,IAAI,kCACxB,cAAc,WAAW,IACzB,UAAU,WAAW;AAAA,IAE5B,OAAO;AACL,oBAAc,WAAW,IAAI,UAAU,WAAW;AAAA,IAIpD;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeNameFromAST.d.ts","sourceRoot":"","sources":["../../src/utilities/typeNameFromAST.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"typeNameFromAST.d.ts","sourceRoot":"","sources":["../../src/utilities/typeNameFromAST.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,wBAAgB,eAAe,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,CAMzD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/typeNameFromAST.ts"],
|
|
4
|
+
"sourcesContent": ["import { Kind } from \"graphql\";\nimport { TypeNode } from \"@graphitation/supermassive-ast\";\n\nexport function typeNameFromAST(typeAst: TypeNode): string {\n if (typeAst.kind === Kind.LIST_TYPE || typeAst.kind === Kind.NON_NULL_TYPE) {\n return typeNameFromAST(typeAst.type);\n } else {\n return typeAst.name.value;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAqB;AAGd,SAAS,gBAAgB,SAA2B;AACzD,MAAI,QAAQ,SAAS,oBAAK,aAAa,QAAQ,SAAS,oBAAK,eAAe;AAC1E,WAAO,gBAAgB,QAAQ,IAAI;AAAA,EACrC,OAAO;AACL,WAAO,QAAQ,KAAK;AAAA,EACtB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/typeNameFromAST.ts"],
|
|
4
|
+
"sourcesContent": ["import { Kind } from \"graphql\";\nimport { TypeNode } from \"@graphitation/supermassive-ast\";\n\nexport function typeNameFromAST(typeAst: TypeNode): string {\n if (typeAst.kind === Kind.LIST_TYPE || typeAst.kind === Kind.NON_NULL_TYPE) {\n return typeNameFromAST(typeAst.type);\n } else {\n return typeAst.name.value;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,YAAY;AAGd,SAAS,gBAAgB,SAA2B;AACzD,MAAI,QAAQ,SAAS,KAAK,aAAa,QAAQ,SAAS,KAAK,eAAe;AAC1E,WAAO,gBAAgB,QAAQ,IAAI;AAAA,EACrC,OAAO;AACL,WAAO,QAAQ,KAAK;AAAA,EACtB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/lib/values.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLError, GraphQLScalarType } from "graphql";
|
|
2
|
-
import { DirectiveNode, FieldNode, VariableDefinitionNode } from "
|
|
2
|
+
import { DirectiveNode, FieldNode, VariableDefinitionNode } from "@graphitation/supermassive-ast";
|
|
3
3
|
import type { Maybe } from "./jsutils/Maybe";
|
|
4
4
|
import type { ObjMap } from "./jsutils/ObjMap";
|
|
5
5
|
import { Resolvers } from "./types";
|
package/lib/values.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../src/values.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAMZ,iBAAiB,EAYlB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,aAAa,EACb,SAAS,EAET,sBAAsB,EACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../src/values.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAMZ,iBAAiB,EAYlB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,aAAa,EACb,SAAS,EAET,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,aAAK,qBAAqB,GACtB;IAAE,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,GAChD;IAAE,OAAO,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,aAAa,CAAC,sBAAsB,CAAC,EAClD,MAAM,EAAE;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EACvC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/B,qBAAqB,CA0BvB;AAmFD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,SAAS,GAAG,aAAa,EAC/B,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GACtC;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CA8DjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,gBAAgB,EAC9B,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;CAAE,EACnD,SAAS,EAAE,SAAS,EACpB,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GACtC,SAAS,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAS7C;AAMD,eAAO,MAAM,gBAAgB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAA;CAMhE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/values.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n ArgumentNode as GraphQLArgumentNode,\n GraphQLBoolean,\n GraphQLError,\n GraphQLFloat,\n GraphQLID,\n GraphQLInt,\n GraphQLList,\n GraphQLNonNull,\n GraphQLScalarType,\n GraphQLString,\n GraphQLType,\n isInputType,\n isNonNullType,\n Kind,\n print,\n TypeNode as GraphQLTypeNode,\n ValueNode as GraphQLValueNode,\n VariableDefinitionNode as GraphQLVariableDefinitionNode,\n valueFromAST,\n coerceInputValue,\n} from \"graphql\";\nimport {\n DirectiveNode,\n FieldNode,\n TypeNode,\n VariableDefinitionNode,\n} from \"@graphitation/supermassive-ast\";\nimport { inspect } from \"./jsutils/inspect\";\nimport type { Maybe } from \"./jsutils/Maybe\";\nimport type { ObjMap } from \"./jsutils/ObjMap\";\nimport { printPathArray } from \"./jsutils/printPathArray\";\nimport { Resolvers } from \"./types\";\nimport { GraphQLDirective } from \"./directives\";\n\ntype CoercedVariableValues =\n | { errors: Array<GraphQLError>; coerced?: never }\n | { coerced: { [variable: string]: unknown }; errors?: never };\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, a GraphQLError will be thrown.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n *\n * @internal\n */\nexport function getVariableValues(\n resolvers: Resolvers,\n varDefNodes: ReadonlyArray<VariableDefinitionNode>,\n inputs: { [variable: string]: unknown },\n options?: { maxErrors?: number },\n): CoercedVariableValues {\n const errors = [];\n const maxErrors = options?.maxErrors;\n try {\n const coerced = coerceVariableValues(\n resolvers,\n varDefNodes,\n inputs,\n (error) => {\n if (maxErrors != null && errors.length >= maxErrors) {\n throw new GraphQLError(\n \"Too many errors processing variables, error limit reached. Execution aborted.\",\n );\n }\n errors.push(error);\n },\n );\n\n if (errors.length === 0) {\n return { coerced };\n }\n } catch (error) {\n errors.push(error);\n }\n\n return { errors: errors as GraphQLError[] };\n}\n\nfunction coerceVariableValues(\n resolvers: Resolvers,\n varDefNodes: ReadonlyArray<VariableDefinitionNode>,\n inputs: { [variable: string]: unknown },\n onError: (error: GraphQLError) => void,\n): { [variable: string]: unknown } {\n const coercedValues: { [variable: string]: unknown } = {};\n for (const varDefNode of varDefNodes) {\n const varName = varDefNode.variable.name.value;\n const varTypeAst = varDefNode.type;\n const varType: GraphQLType = graphqlTypeFromTypeAst(resolvers, varTypeAst);\n\n if (!isInputType(varType)) {\n // Must use input types for variables. This should be caught during\n // validation, however is checked again here for safety.\n const varTypeStr = inspect(varType);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" expected value of type \"${varTypeStr}\" which cannot be used as an input type.`,\n varDefNode.type as GraphQLTypeNode,\n ),\n );\n continue;\n }\n\n if (!hasOwnProperty(inputs, varName)) {\n if (varDefNode.defaultValue) {\n coercedValues[varName] = valueFromAST(\n varDefNode.defaultValue as Maybe<GraphQLValueNode>,\n varType,\n );\n } else if (isNonNullType(varType)) {\n const varTypeStr = print(varDefNode.type as GraphQLTypeNode);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" of required type \"${varTypeStr}\" was not provided.`,\n varDefNode as GraphQLVariableDefinitionNode,\n ),\n );\n }\n continue;\n }\n\n const value = inputs[varName];\n if (value === null && isNonNullType(varType)) {\n const varTypeStr = inspect(varType);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" of non-null type \"${varTypeStr}\" must not be null.`,\n varDefNode as GraphQLVariableDefinitionNode,\n ),\n );\n continue;\n }\n\n coercedValues[varName] = coerceInputValue(\n value,\n varType,\n (path, invalidValue, error) => {\n let prefix =\n `Variable \"$${varName}\" got invalid value ` + inspect(invalidValue);\n if (path.length > 0) {\n prefix += ` at \"${varName}${printPathArray(path)}\"`;\n }\n onError(\n new GraphQLError(\n prefix + \"; \" + error.message,\n varDefNode as GraphQLVariableDefinitionNode,\n undefined,\n undefined,\n undefined,\n error.originalError,\n ),\n );\n },\n );\n }\n\n return coercedValues;\n}\n\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n *\n * @internal\n */\nexport function getArgumentValues(\n resolvers: Resolvers,\n node: FieldNode | DirectiveNode,\n variableValues?: Maybe<ObjMap<unknown>>,\n): { [argument: string]: unknown } {\n const coercedValues: { [argument: string]: unknown } = {};\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n const argumentNodes = node.arguments ?? [];\n\n for (const argumentNode of argumentNodes) {\n const name = argumentNode.name.value;\n const argTypeNode = argumentNode.__type;\n const argType = graphqlTypeFromTypeAst(resolvers, argTypeNode);\n\n if (!isInputType(argType)) {\n throw new GraphQLError(\n `Argument \"$${name}\" expected value of type \"${inspect(\n argType,\n )}\" which cannot be used as an input type.`,\n argumentNode as GraphQLArgumentNode,\n );\n }\n\n let valueNode = argumentNode.value;\n\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n if (\n variableValues == null ||\n !hasOwnProperty(variableValues, variableName)\n ) {\n if (argumentNode.__defaultValue) {\n valueNode = argumentNode.__defaultValue;\n } else if (isNonNullType(argType)) {\n throw new GraphQLError(\n `Argument \"${name}\" of required type \"${inspect(argType)}\" ` +\n `was provided the variable \"$${variableName}\" which was not provided a runtime value.`,\n valueNode as GraphQLValueNode,\n );\n }\n\n continue;\n }\n }\n\n const coercedValue = valueFromAST(\n valueNode as GraphQLValueNode,\n argType,\n variableValues,\n );\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\n `Argument \"${name}\" has invalid value ${print(\n valueNode as GraphQLValueNode,\n )}.`,\n valueNode as GraphQLValueNode,\n );\n }\n coercedValues[name] = coercedValue;\n }\n\n return coercedValues;\n}\n\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\nexport function getDirectiveValues(\n directiveDef: GraphQLDirective,\n node: { directives?: ReadonlyArray<DirectiveNode> },\n resolvers: Resolvers,\n variableValues?: Maybe<ObjMap<unknown>>,\n): undefined | { [argument: string]: unknown } {\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n const directiveNode = node.directives?.find(\n (directive) => directive.name.value === directiveDef.name,\n );\n\n if (directiveNode) {\n return getArgumentValues(resolvers, directiveNode, variableValues);\n }\n}\n\nfunction hasOwnProperty(obj: unknown, prop: string): boolean {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport const specifiedScalars: { [key: string]: GraphQLScalarType } = {\n ID: GraphQLID,\n String: GraphQLString,\n Int: GraphQLInt,\n Float: GraphQLFloat,\n Boolean: GraphQLBoolean,\n};\n\nfunction graphqlTypeFromTypeAst(\n resolvers: Resolvers,\n node: TypeNode,\n): GraphQLType {\n if (node.kind === Kind.NON_NULL_TYPE) {\n return new GraphQLNonNull(graphqlTypeFromTypeAst(resolvers, node.type));\n } else if (node.kind === Kind.LIST_TYPE) {\n return new GraphQLList(graphqlTypeFromTypeAst(resolvers, node.type));\n } else {\n const typeName = node.name.value;\n const type = specifiedScalars[typeName] || resolvers[typeName];\n return type as unknown as GraphQLType;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAqBO;AAOP,qBAAwB;AAGxB,4BAA+B;AAmBxB,SAAS,kBACd,WACA,aACA,QACA,SACuB;AACvB,QAAM,SAAS,CAAC;AAChB,QAAM,YAAY,mCAAS;AAC3B,MAAI;AACF,UAAM,UAAU;AAAA,MACd;AAAA,MACA;AAAA,MACA;AAAA,MACA,CAAC,UAAU;AACT,YAAI,aAAa,QAAQ,OAAO,UAAU,WAAW;AACnD,gBAAM,IAAI;AAAA,YACR;AAAA,UACF;AAAA,QACF;AACA,eAAO,KAAK,KAAK;AAAA,MACnB;AAAA,IACF;AAEA,QAAI,OAAO,WAAW,GAAG;AACvB,aAAO,EAAE,QAAQ;AAAA,IACnB;AAAA,EACF,SAAS,OAAP;AACA,WAAO,KAAK,KAAK;AAAA,EACnB;AAEA,SAAO,EAAE,OAAiC;AAC5C;AAEA,SAAS,qBACP,WACA,aACA,QACA,SACiC;AACjC,QAAM,gBAAiD,CA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B;AAC3D,SAAO,OAAO,UAAU,eAAe,KAAK,KAAK,IAAI;AACvD;AAEO,MAAM,mBAAyD;AAAA,EACpE,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AACX;AAEA,SAAS,uBACP,WACA,MACa;AACb,MAAI,KAAK,SAAS,oBAAK,eAAe;AACpC,WAAO,IAAI,8BAAe,uBAAuB,WAAW,KAAK,IAAI,CAAC;AAAA,EACxE,WAAW,KAAK,SAAS,oBAAK,WAAW;AACvC,WAAO,IAAI,2BAAY,uBAAuB,WAAW,KAAK,IAAI,CAAC;AAAA,EACrE,OAAO;AACL,UAAM,WAAW,KAAK,KAAK;AAC3B,UAAM,OAAO,iBAAiB,QAAQ,KAAK,UAAU,QAAQ;AAC7D,WAAO;AAAA,EACT;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/values.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n ArgumentNode as GraphQLArgumentNode,\n GraphQLBoolean,\n GraphQLError,\n GraphQLFloat,\n GraphQLID,\n GraphQLInt,\n GraphQLList,\n GraphQLNonNull,\n GraphQLScalarType,\n GraphQLString,\n GraphQLType,\n isInputType,\n isNonNullType,\n Kind,\n print,\n TypeNode as GraphQLTypeNode,\n ValueNode as GraphQLValueNode,\n VariableDefinitionNode as GraphQLVariableDefinitionNode,\n valueFromAST,\n coerceInputValue,\n} from \"graphql\";\nimport {\n DirectiveNode,\n FieldNode,\n TypeNode,\n VariableDefinitionNode,\n} from \"@graphitation/supermassive-ast\";\nimport { inspect } from \"./jsutils/inspect\";\nimport type { Maybe } from \"./jsutils/Maybe\";\nimport type { ObjMap } from \"./jsutils/ObjMap\";\nimport { printPathArray } from \"./jsutils/printPathArray\";\nimport { Resolvers } from \"./types\";\nimport { GraphQLDirective } from \"./directives\";\n\ntype CoercedVariableValues =\n | { errors: Array<GraphQLError>; coerced?: never }\n | { coerced: { [variable: string]: unknown }; errors?: never };\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, a GraphQLError will be thrown.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n *\n * @internal\n */\nexport function getVariableValues(\n resolvers: Resolvers,\n varDefNodes: ReadonlyArray<VariableDefinitionNode>,\n inputs: { [variable: string]: unknown },\n options?: { maxErrors?: number },\n): CoercedVariableValues {\n const errors = [];\n const maxErrors = options?.maxErrors;\n try {\n const coerced = coerceVariableValues(\n resolvers,\n varDefNodes,\n inputs,\n (error) => {\n if (maxErrors != null && errors.length >= maxErrors) {\n throw new GraphQLError(\n \"Too many errors processing variables, error limit reached. Execution aborted.\",\n );\n }\n errors.push(error);\n },\n );\n\n if (errors.length === 0) {\n return { coerced };\n }\n } catch (error) {\n errors.push(error);\n }\n\n return { errors: errors as GraphQLError[] };\n}\n\nfunction coerceVariableValues(\n resolvers: Resolvers,\n varDefNodes: ReadonlyArray<VariableDefinitionNode>,\n inputs: { [variable: string]: unknown },\n onError: (error: GraphQLError) => void,\n): { [variable: string]: unknown } {\n const coercedValues: { [variable: string]: unknown } = {};\n for (const varDefNode of varDefNodes) {\n const varName = varDefNode.variable.name.value;\n const varTypeAst = varDefNode.type;\n const varType: GraphQLType = graphqlTypeFromTypeAst(resolvers, varTypeAst);\n\n if (!isInputType(varType)) {\n // Must use input types for variables. This should be caught during\n // validation, however is checked again here for safety.\n const varTypeStr = inspect(varType);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" expected value of type \"${varTypeStr}\" which cannot be used as an input type.`,\n varDefNode.type as GraphQLTypeNode,\n ),\n );\n continue;\n }\n\n if (!hasOwnProperty(inputs, varName)) {\n if (varDefNode.defaultValue) {\n coercedValues[varName] = valueFromAST(\n varDefNode.defaultValue as Maybe<GraphQLValueNode>,\n varType,\n );\n } else if (isNonNullType(varType)) {\n const varTypeStr = print(varDefNode.type as GraphQLTypeNode);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" of required type \"${varTypeStr}\" was not provided.`,\n varDefNode as GraphQLVariableDefinitionNode,\n ),\n );\n }\n continue;\n }\n\n const value = inputs[varName];\n if (value === null && isNonNullType(varType)) {\n const varTypeStr = inspect(varType);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" of non-null type \"${varTypeStr}\" must not be null.`,\n varDefNode as GraphQLVariableDefinitionNode,\n ),\n );\n continue;\n }\n\n coercedValues[varName] = coerceInputValue(\n value,\n varType,\n (path, invalidValue, error) => {\n let prefix =\n `Variable \"$${varName}\" got invalid value ` + inspect(invalidValue);\n if (path.length > 0) {\n prefix += ` at \"${varName}${printPathArray(path)}\"`;\n }\n onError(\n new GraphQLError(\n prefix + \"; \" + error.message,\n varDefNode as GraphQLVariableDefinitionNode,\n undefined,\n undefined,\n undefined,\n error.originalError,\n ),\n );\n },\n );\n }\n\n return coercedValues;\n}\n\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n *\n * @internal\n */\nexport function getArgumentValues(\n resolvers: Resolvers,\n node: FieldNode | DirectiveNode,\n variableValues?: Maybe<ObjMap<unknown>>,\n): { [argument: string]: unknown } {\n const coercedValues: { [argument: string]: unknown } = {};\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n const argumentNodes = node.arguments ?? [];\n\n for (const argumentNode of argumentNodes) {\n const name = argumentNode.name.value;\n const argTypeNode = argumentNode.__type;\n const argType = graphqlTypeFromTypeAst(resolvers, argTypeNode);\n\n if (!isInputType(argType)) {\n throw new GraphQLError(\n `Argument \"$${name}\" expected value of type \"${inspect(\n argType,\n )}\" which cannot be used as an input type.`,\n argumentNode as GraphQLArgumentNode,\n );\n }\n\n let valueNode = argumentNode.value;\n\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n if (\n variableValues == null ||\n !hasOwnProperty(variableValues, variableName)\n ) {\n if (argumentNode.__defaultValue) {\n valueNode = argumentNode.__defaultValue;\n } else if (isNonNullType(argType)) {\n throw new GraphQLError(\n `Argument \"${name}\" of required type \"${inspect(argType)}\" ` +\n `was provided the variable \"$${variableName}\" which was not provided a runtime value.`,\n valueNode as GraphQLValueNode,\n );\n }\n\n continue;\n }\n }\n\n const coercedValue = valueFromAST(\n valueNode as GraphQLValueNode,\n argType,\n variableValues,\n );\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\n `Argument \"${name}\" has invalid value ${print(\n valueNode as GraphQLValueNode,\n )}.`,\n valueNode as GraphQLValueNode,\n );\n }\n coercedValues[name] = coercedValue;\n }\n\n return coercedValues;\n}\n\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\nexport function getDirectiveValues(\n directiveDef: GraphQLDirective,\n node: { directives?: ReadonlyArray<DirectiveNode> },\n resolvers: Resolvers,\n variableValues?: Maybe<ObjMap<unknown>>,\n): undefined | { [argument: string]: unknown } {\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n const directiveNode = node.directives?.find(\n (directive) => directive.name.value === directiveDef.name,\n );\n\n if (directiveNode) {\n return getArgumentValues(resolvers, directiveNode, variableValues);\n }\n}\n\nfunction hasOwnProperty(obj: unknown, prop: string): boolean {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport const specifiedScalars: { [key: string]: GraphQLScalarType } = {\n ID: GraphQLID,\n String: GraphQLString,\n Int: GraphQLInt,\n Float: GraphQLFloat,\n Boolean: GraphQLBoolean,\n};\n\nfunction graphqlTypeFromTypeAst(\n resolvers: Resolvers,\n node: TypeNode,\n): GraphQLType {\n if (node.kind === Kind.NON_NULL_TYPE) {\n return new GraphQLNonNull(graphqlTypeFromTypeAst(resolvers, node.type));\n } else if (node.kind === Kind.LIST_TYPE) {\n return new GraphQLList(graphqlTypeFromTypeAst(resolvers, node.type));\n } else {\n const typeName = node.name.value;\n const type = specifiedScalars[typeName] || resolvers[typeName];\n return type as unknown as GraphQLType;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,OACK;AAOP,SAAS,eAAe;AAGxB,SAAS,sBAAsB;AAmBxB,SAAS,kBACd,WACA,aACA,QACA,SACuB;AACvB,QAAM,SAAS,CAAC;AAChB,QAAM,YAAY,mCAAS;AAC3B,MAAI;AACF,UAAM,UAAU;AAAA,MACd;AAAA,MACA;AAAA,MACA;AAAA,MACA,CAAC,UAAU;AACT,YAAI,aAAa,QAAQ,OAAO,UAAU,WAAW;AACnD,gBAAM,IAAI;AAAA,YACR;AAAA,UACF;AAAA,QACF;AACA,eAAO,KAAK,KAAK;AAAA,MACnB;AAAA,IACF;AAEA,QAAI,OAAO,WAAW,GAAG;AACvB,aAAO,EAAE,QAAQ;AAAA,IACnB;AAAA,EACF,SAAS,OAAP;AACA,WAAO,KAAK,KAAK;AAAA,EACnB;AAEA,SAAO,EAAE,OAAiC;AAC5C;AAEA,SAAS,qBACP,WACA,aACA,QACA,SACiC;AACjC,QAAM,gBAAiD,CAAC;AACxD,aAAW,cAAc,aAAa;AACpC,UAAM,UAAU,WAAW,SAAS,KAAK;AACzC,UAAM,aAAa,WAAW;AAC9B,UAAM,UAAuB,uBA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;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AACX;AAEA,SAAS,uBACP,WACA,MACa;AACb,MAAI,KAAK,SAAS,KAAK,eAAe;AACpC,WAAO,IAAI,eAAe,uBAAuB,WAAW,KAAK,IAAI,CAAC;AAAA,EACxE,WAAW,KAAK,SAAS,KAAK,WAAW;AACvC,WAAO,IAAI,YAAY,uBAAuB,WAAW,KAAK,IAAI,CAAC;AAAA,EACrE,OAAO;AACL,UAAM,WAAW,KAAK,KAAK;AAC3B,UAAM,OAAO,iBAAiB,QAAQ,KAAK,UAAU,QAAQ;AAC7D,WAAO;AAAA,EACT;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphitation/supermassive",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"main": "./lib/index",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@graphitation/graphql-js-tag": "*",
|
|
22
22
|
"@graphitation/supermassive-extractors": "*",
|
|
23
23
|
"@graphitation/cli": "*",
|
|
24
|
-
"@graphql-tools/schema": "^
|
|
24
|
+
"@graphql-tools/schema": "^9.0.19",
|
|
25
25
|
"@ts-morph/bootstrap": "^0.11.0",
|
|
26
26
|
"@types/benchmark": "^2.1.0",
|
|
27
27
|
"@types/jest": "^26.0.22",
|
|
@@ -37,7 +37,11 @@
|
|
|
37
37
|
"access": "public",
|
|
38
38
|
"publishConfig": {},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"
|
|
40
|
+
"@graphitation/supermassive-ast": "*",
|
|
41
|
+
"@graphql-tools/schema": "^9.0.19",
|
|
42
|
+
"commander": "^8.3.0",
|
|
43
|
+
"graphql": "^15.6.1",
|
|
44
|
+
"typescript": "^4.4.3 <4.5.0"
|
|
41
45
|
},
|
|
42
46
|
"types": "./lib/index.d.ts",
|
|
43
47
|
"module": "./lib/index.mjs",
|
package/lib/ast/TypedAST.d.ts
DELETED
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Taken from node_modules/graphql/language/ast.d.ts
|
|
3
|
-
* License: MIT License
|
|
4
|
-
* Copyright (c): GraphQL Contributors
|
|
5
|
-
*
|
|
6
|
-
* Our changes MUST be annotated inline for ease of future merging.
|
|
7
|
-
*/
|
|
8
|
-
import { Maybe } from "../jsutils/Maybe";
|
|
9
|
-
/**
|
|
10
|
-
* [SUPERMASSIVE]
|
|
11
|
-
*
|
|
12
|
-
* We don't need `Location`, `Token`, and `isNode` , so remove it and its dependencies.
|
|
13
|
-
*/
|
|
14
|
-
declare type Location = unknown;
|
|
15
|
-
/**
|
|
16
|
-
* The list of all possible AST node types.
|
|
17
|
-
*/
|
|
18
|
-
export declare type ASTNode = NameNode | DocumentNode | OperationDefinitionNode | VariableDefinitionNode | VariableNode | SelectionSetNode | FieldNode | ArgumentNode | FragmentSpreadNode | InlineFragmentNode | FragmentDefinitionNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode | ObjectFieldNode | DirectiveNode | NamedTypeNode | ListTypeNode | NonNullTypeNode | SchemaDefinitionNode | OperationTypeDefinitionNode | ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | FieldDefinitionNode | InputValueDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | EnumValueDefinitionNode | InputObjectTypeDefinitionNode | DirectiveDefinitionNode | SchemaExtensionNode | ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode;
|
|
19
|
-
/**
|
|
20
|
-
* Utility type listing all nodes indexed by their kind.
|
|
21
|
-
*/
|
|
22
|
-
export interface ASTKindToNode {
|
|
23
|
-
Name: NameNode;
|
|
24
|
-
Document: DocumentNode;
|
|
25
|
-
OperationDefinition: OperationDefinitionNode;
|
|
26
|
-
VariableDefinition: VariableDefinitionNode;
|
|
27
|
-
Variable: VariableNode;
|
|
28
|
-
SelectionSet: SelectionSetNode;
|
|
29
|
-
Field: FieldNode;
|
|
30
|
-
Argument: ArgumentNode;
|
|
31
|
-
FragmentSpread: FragmentSpreadNode;
|
|
32
|
-
InlineFragment: InlineFragmentNode;
|
|
33
|
-
FragmentDefinition: FragmentDefinitionNode;
|
|
34
|
-
IntValue: IntValueNode;
|
|
35
|
-
FloatValue: FloatValueNode;
|
|
36
|
-
StringValue: StringValueNode;
|
|
37
|
-
BooleanValue: BooleanValueNode;
|
|
38
|
-
NullValue: NullValueNode;
|
|
39
|
-
EnumValue: EnumValueNode;
|
|
40
|
-
ListValue: ListValueNode;
|
|
41
|
-
ObjectValue: ObjectValueNode;
|
|
42
|
-
ObjectField: ObjectFieldNode;
|
|
43
|
-
Directive: DirectiveNode;
|
|
44
|
-
NamedType: NamedTypeNode;
|
|
45
|
-
ListType: ListTypeNode;
|
|
46
|
-
NonNullType: NonNullTypeNode;
|
|
47
|
-
SchemaDefinition: SchemaDefinitionNode;
|
|
48
|
-
OperationTypeDefinition: OperationTypeDefinitionNode;
|
|
49
|
-
ScalarTypeDefinition: ScalarTypeDefinitionNode;
|
|
50
|
-
ObjectTypeDefinition: ObjectTypeDefinitionNode;
|
|
51
|
-
FieldDefinition: FieldDefinitionNode;
|
|
52
|
-
InputValueDefinition: InputValueDefinitionNode;
|
|
53
|
-
InterfaceTypeDefinition: InterfaceTypeDefinitionNode;
|
|
54
|
-
UnionTypeDefinition: UnionTypeDefinitionNode;
|
|
55
|
-
EnumTypeDefinition: EnumTypeDefinitionNode;
|
|
56
|
-
EnumValueDefinition: EnumValueDefinitionNode;
|
|
57
|
-
InputObjectTypeDefinition: InputObjectTypeDefinitionNode;
|
|
58
|
-
DirectiveDefinition: DirectiveDefinitionNode;
|
|
59
|
-
SchemaExtension: SchemaExtensionNode;
|
|
60
|
-
ScalarTypeExtension: ScalarTypeExtensionNode;
|
|
61
|
-
ObjectTypeExtension: ObjectTypeExtensionNode;
|
|
62
|
-
InterfaceTypeExtension: InterfaceTypeExtensionNode;
|
|
63
|
-
UnionTypeExtension: UnionTypeExtensionNode;
|
|
64
|
-
EnumTypeExtension: EnumTypeExtensionNode;
|
|
65
|
-
InputObjectTypeExtension: InputObjectTypeExtensionNode;
|
|
66
|
-
}
|
|
67
|
-
export interface NameNode {
|
|
68
|
-
readonly kind: "Name";
|
|
69
|
-
readonly loc?: Location;
|
|
70
|
-
readonly value: string;
|
|
71
|
-
}
|
|
72
|
-
export interface DocumentNode {
|
|
73
|
-
readonly kind: "Document";
|
|
74
|
-
readonly loc?: Location;
|
|
75
|
-
readonly definitions: ReadonlyArray<DefinitionNode>;
|
|
76
|
-
}
|
|
77
|
-
export declare type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode | TypeSystemExtensionNode;
|
|
78
|
-
export declare type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode;
|
|
79
|
-
export interface OperationDefinitionNode {
|
|
80
|
-
readonly kind: "OperationDefinition";
|
|
81
|
-
readonly loc?: Location;
|
|
82
|
-
readonly operation: OperationTypeNode;
|
|
83
|
-
readonly name?: NameNode;
|
|
84
|
-
readonly variableDefinitions?: ReadonlyArray<VariableDefinitionNode>;
|
|
85
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
86
|
-
readonly selectionSet: SelectionSetNode;
|
|
87
|
-
}
|
|
88
|
-
export declare type OperationTypeNode = "query" | "mutation" | "subscription";
|
|
89
|
-
export interface VariableDefinitionNode {
|
|
90
|
-
readonly kind: "VariableDefinition";
|
|
91
|
-
readonly loc?: Location;
|
|
92
|
-
readonly variable: VariableNode;
|
|
93
|
-
readonly type: TypeNode;
|
|
94
|
-
readonly defaultValue?: ValueNode;
|
|
95
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
96
|
-
}
|
|
97
|
-
export interface VariableNode {
|
|
98
|
-
readonly kind: "Variable";
|
|
99
|
-
readonly loc?: Location;
|
|
100
|
-
readonly name: NameNode;
|
|
101
|
-
}
|
|
102
|
-
export interface SelectionSetNode {
|
|
103
|
-
kind: "SelectionSet";
|
|
104
|
-
loc?: Location;
|
|
105
|
-
selections: ReadonlyArray<SelectionNode>;
|
|
106
|
-
}
|
|
107
|
-
export declare type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode;
|
|
108
|
-
export interface FieldNode {
|
|
109
|
-
readonly __type: TypeNode;
|
|
110
|
-
readonly kind: "Field";
|
|
111
|
-
readonly loc?: Location;
|
|
112
|
-
readonly alias?: NameNode;
|
|
113
|
-
readonly name: NameNode;
|
|
114
|
-
readonly arguments?: ReadonlyArray<ArgumentNode>;
|
|
115
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
116
|
-
readonly selectionSet?: SelectionSetNode;
|
|
117
|
-
}
|
|
118
|
-
export interface ArgumentNode {
|
|
119
|
-
readonly __type: TypeNode;
|
|
120
|
-
readonly __defaultValue?: Maybe<ValueNode>;
|
|
121
|
-
readonly kind: "Argument";
|
|
122
|
-
readonly loc?: Location;
|
|
123
|
-
readonly name: NameNode;
|
|
124
|
-
readonly value: ValueNode;
|
|
125
|
-
}
|
|
126
|
-
export interface FragmentSpreadNode {
|
|
127
|
-
readonly kind: "FragmentSpread";
|
|
128
|
-
readonly loc?: Location;
|
|
129
|
-
readonly name: NameNode;
|
|
130
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
131
|
-
}
|
|
132
|
-
export interface InlineFragmentNode {
|
|
133
|
-
readonly kind: "InlineFragment";
|
|
134
|
-
readonly loc?: Location;
|
|
135
|
-
readonly typeCondition?: NamedTypeNode;
|
|
136
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
137
|
-
readonly selectionSet: SelectionSetNode;
|
|
138
|
-
}
|
|
139
|
-
export interface FragmentDefinitionNode {
|
|
140
|
-
readonly kind: "FragmentDefinition";
|
|
141
|
-
readonly loc?: Location;
|
|
142
|
-
readonly name: NameNode;
|
|
143
|
-
readonly variableDefinitions?: ReadonlyArray<VariableDefinitionNode>;
|
|
144
|
-
readonly typeCondition: NamedTypeNode;
|
|
145
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
146
|
-
readonly selectionSet: SelectionSetNode;
|
|
147
|
-
}
|
|
148
|
-
export declare type ValueNode = VariableNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode;
|
|
149
|
-
export interface IntValueNode {
|
|
150
|
-
readonly kind: "IntValue";
|
|
151
|
-
readonly loc?: Location;
|
|
152
|
-
readonly value: string;
|
|
153
|
-
}
|
|
154
|
-
export interface FloatValueNode {
|
|
155
|
-
readonly kind: "FloatValue";
|
|
156
|
-
readonly loc?: Location;
|
|
157
|
-
readonly value: string;
|
|
158
|
-
}
|
|
159
|
-
export interface StringValueNode {
|
|
160
|
-
readonly kind: "StringValue";
|
|
161
|
-
readonly loc?: Location;
|
|
162
|
-
readonly value: string;
|
|
163
|
-
readonly block?: boolean;
|
|
164
|
-
}
|
|
165
|
-
export interface BooleanValueNode {
|
|
166
|
-
readonly kind: "BooleanValue";
|
|
167
|
-
readonly loc?: Location;
|
|
168
|
-
readonly value: boolean;
|
|
169
|
-
}
|
|
170
|
-
export interface NullValueNode {
|
|
171
|
-
readonly kind: "NullValue";
|
|
172
|
-
readonly loc?: Location;
|
|
173
|
-
}
|
|
174
|
-
export interface EnumValueNode {
|
|
175
|
-
readonly kind: "EnumValue";
|
|
176
|
-
readonly loc?: Location;
|
|
177
|
-
readonly value: string;
|
|
178
|
-
}
|
|
179
|
-
export interface ListValueNode {
|
|
180
|
-
readonly kind: "ListValue";
|
|
181
|
-
readonly loc?: Location;
|
|
182
|
-
readonly values: ReadonlyArray<ValueNode>;
|
|
183
|
-
}
|
|
184
|
-
export interface ObjectValueNode {
|
|
185
|
-
readonly kind: "ObjectValue";
|
|
186
|
-
readonly loc?: Location;
|
|
187
|
-
readonly fields: ReadonlyArray<ObjectFieldNode>;
|
|
188
|
-
}
|
|
189
|
-
export interface ObjectFieldNode {
|
|
190
|
-
readonly kind: "ObjectField";
|
|
191
|
-
readonly loc?: Location;
|
|
192
|
-
readonly name: NameNode;
|
|
193
|
-
readonly value: ValueNode;
|
|
194
|
-
}
|
|
195
|
-
export interface DirectiveNode {
|
|
196
|
-
readonly kind: "Directive";
|
|
197
|
-
readonly loc?: Location;
|
|
198
|
-
readonly name: NameNode;
|
|
199
|
-
readonly arguments?: ReadonlyArray<ArgumentNode>;
|
|
200
|
-
}
|
|
201
|
-
export declare type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode;
|
|
202
|
-
export interface NamedTypeNode {
|
|
203
|
-
readonly kind: "NamedType";
|
|
204
|
-
readonly loc?: Location;
|
|
205
|
-
readonly name: NameNode;
|
|
206
|
-
}
|
|
207
|
-
export interface ListTypeNode {
|
|
208
|
-
readonly kind: "ListType";
|
|
209
|
-
readonly loc?: Location;
|
|
210
|
-
readonly type: TypeNode;
|
|
211
|
-
}
|
|
212
|
-
export interface NonNullTypeNode {
|
|
213
|
-
readonly kind: "NonNullType";
|
|
214
|
-
readonly loc?: Location;
|
|
215
|
-
readonly type: NamedTypeNode | ListTypeNode;
|
|
216
|
-
}
|
|
217
|
-
export declare type TypeSystemDefinitionNode = SchemaDefinitionNode | TypeDefinitionNode | DirectiveDefinitionNode;
|
|
218
|
-
export interface SchemaDefinitionNode {
|
|
219
|
-
readonly kind: "SchemaDefinition";
|
|
220
|
-
readonly loc?: Location;
|
|
221
|
-
readonly description?: StringValueNode;
|
|
222
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
223
|
-
readonly operationTypes: ReadonlyArray<OperationTypeDefinitionNode>;
|
|
224
|
-
}
|
|
225
|
-
export interface OperationTypeDefinitionNode {
|
|
226
|
-
readonly kind: "OperationTypeDefinition";
|
|
227
|
-
readonly loc?: Location;
|
|
228
|
-
readonly operation: OperationTypeNode;
|
|
229
|
-
readonly type: NamedTypeNode;
|
|
230
|
-
}
|
|
231
|
-
export declare type TypeDefinitionNode = ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | InputObjectTypeDefinitionNode;
|
|
232
|
-
export interface ScalarTypeDefinitionNode {
|
|
233
|
-
readonly kind: "ScalarTypeDefinition";
|
|
234
|
-
readonly loc?: Location;
|
|
235
|
-
readonly description?: StringValueNode;
|
|
236
|
-
readonly name: NameNode;
|
|
237
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
238
|
-
}
|
|
239
|
-
export interface ObjectTypeDefinitionNode {
|
|
240
|
-
readonly kind: "ObjectTypeDefinition";
|
|
241
|
-
readonly loc?: Location;
|
|
242
|
-
readonly description?: StringValueNode;
|
|
243
|
-
readonly name: NameNode;
|
|
244
|
-
readonly interfaces?: ReadonlyArray<NamedTypeNode>;
|
|
245
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
246
|
-
readonly fields?: ReadonlyArray<FieldDefinitionNode>;
|
|
247
|
-
}
|
|
248
|
-
export interface FieldDefinitionNode {
|
|
249
|
-
readonly kind: "FieldDefinition";
|
|
250
|
-
readonly loc?: Location;
|
|
251
|
-
readonly description?: StringValueNode;
|
|
252
|
-
readonly name: NameNode;
|
|
253
|
-
readonly arguments?: ReadonlyArray<InputValueDefinitionNode>;
|
|
254
|
-
readonly type: TypeNode;
|
|
255
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
256
|
-
}
|
|
257
|
-
export interface InputValueDefinitionNode {
|
|
258
|
-
readonly kind: "InputValueDefinition";
|
|
259
|
-
readonly loc?: Location;
|
|
260
|
-
readonly description?: StringValueNode;
|
|
261
|
-
readonly name: NameNode;
|
|
262
|
-
readonly type: TypeNode;
|
|
263
|
-
readonly defaultValue?: ValueNode;
|
|
264
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
265
|
-
}
|
|
266
|
-
export interface InterfaceTypeDefinitionNode {
|
|
267
|
-
readonly kind: "InterfaceTypeDefinition";
|
|
268
|
-
readonly loc?: Location;
|
|
269
|
-
readonly description?: StringValueNode;
|
|
270
|
-
readonly name: NameNode;
|
|
271
|
-
readonly interfaces?: ReadonlyArray<NamedTypeNode>;
|
|
272
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
273
|
-
readonly fields?: ReadonlyArray<FieldDefinitionNode>;
|
|
274
|
-
}
|
|
275
|
-
export interface UnionTypeDefinitionNode {
|
|
276
|
-
readonly kind: "UnionTypeDefinition";
|
|
277
|
-
readonly loc?: Location;
|
|
278
|
-
readonly description?: StringValueNode;
|
|
279
|
-
readonly name: NameNode;
|
|
280
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
281
|
-
readonly types?: ReadonlyArray<NamedTypeNode>;
|
|
282
|
-
}
|
|
283
|
-
export interface EnumTypeDefinitionNode {
|
|
284
|
-
readonly kind: "EnumTypeDefinition";
|
|
285
|
-
readonly loc?: Location;
|
|
286
|
-
readonly description?: StringValueNode;
|
|
287
|
-
readonly name: NameNode;
|
|
288
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
289
|
-
readonly values?: ReadonlyArray<EnumValueDefinitionNode>;
|
|
290
|
-
}
|
|
291
|
-
export interface EnumValueDefinitionNode {
|
|
292
|
-
readonly kind: "EnumValueDefinition";
|
|
293
|
-
readonly loc?: Location;
|
|
294
|
-
readonly description?: StringValueNode;
|
|
295
|
-
readonly name: NameNode;
|
|
296
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
297
|
-
}
|
|
298
|
-
export interface InputObjectTypeDefinitionNode {
|
|
299
|
-
readonly kind: "InputObjectTypeDefinition";
|
|
300
|
-
readonly loc?: Location;
|
|
301
|
-
readonly description?: StringValueNode;
|
|
302
|
-
readonly name: NameNode;
|
|
303
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
304
|
-
readonly fields?: ReadonlyArray<InputValueDefinitionNode>;
|
|
305
|
-
}
|
|
306
|
-
export interface DirectiveDefinitionNode {
|
|
307
|
-
readonly kind: "DirectiveDefinition";
|
|
308
|
-
readonly loc?: Location;
|
|
309
|
-
readonly description?: StringValueNode;
|
|
310
|
-
readonly name: NameNode;
|
|
311
|
-
readonly arguments?: ReadonlyArray<InputValueDefinitionNode>;
|
|
312
|
-
readonly repeatable: boolean;
|
|
313
|
-
readonly locations: ReadonlyArray<NameNode>;
|
|
314
|
-
}
|
|
315
|
-
export declare type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode;
|
|
316
|
-
export interface SchemaExtensionNode {
|
|
317
|
-
readonly kind: "SchemaExtension";
|
|
318
|
-
readonly loc?: Location;
|
|
319
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
320
|
-
readonly operationTypes?: ReadonlyArray<OperationTypeDefinitionNode>;
|
|
321
|
-
}
|
|
322
|
-
export declare type TypeExtensionNode = ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode;
|
|
323
|
-
export interface ScalarTypeExtensionNode {
|
|
324
|
-
readonly kind: "ScalarTypeExtension";
|
|
325
|
-
readonly loc?: Location;
|
|
326
|
-
readonly name: NameNode;
|
|
327
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
328
|
-
}
|
|
329
|
-
export interface ObjectTypeExtensionNode {
|
|
330
|
-
readonly kind: "ObjectTypeExtension";
|
|
331
|
-
readonly loc?: Location;
|
|
332
|
-
readonly name: NameNode;
|
|
333
|
-
readonly interfaces?: ReadonlyArray<NamedTypeNode>;
|
|
334
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
335
|
-
readonly fields?: ReadonlyArray<FieldDefinitionNode>;
|
|
336
|
-
}
|
|
337
|
-
export interface InterfaceTypeExtensionNode {
|
|
338
|
-
readonly kind: "InterfaceTypeExtension";
|
|
339
|
-
readonly loc?: Location;
|
|
340
|
-
readonly name: NameNode;
|
|
341
|
-
readonly interfaces?: ReadonlyArray<NamedTypeNode>;
|
|
342
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
343
|
-
readonly fields?: ReadonlyArray<FieldDefinitionNode>;
|
|
344
|
-
}
|
|
345
|
-
export interface UnionTypeExtensionNode {
|
|
346
|
-
readonly kind: "UnionTypeExtension";
|
|
347
|
-
readonly loc?: Location;
|
|
348
|
-
readonly name: NameNode;
|
|
349
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
350
|
-
readonly types?: ReadonlyArray<NamedTypeNode>;
|
|
351
|
-
}
|
|
352
|
-
export interface EnumTypeExtensionNode {
|
|
353
|
-
readonly kind: "EnumTypeExtension";
|
|
354
|
-
readonly loc?: Location;
|
|
355
|
-
readonly name: NameNode;
|
|
356
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
357
|
-
readonly values?: ReadonlyArray<EnumValueDefinitionNode>;
|
|
358
|
-
}
|
|
359
|
-
export interface InputObjectTypeExtensionNode {
|
|
360
|
-
readonly kind: "InputObjectTypeExtension";
|
|
361
|
-
readonly loc?: Location;
|
|
362
|
-
readonly name: NameNode;
|
|
363
|
-
readonly directives?: ReadonlyArray<DirectiveNode>;
|
|
364
|
-
readonly fields?: ReadonlyArray<InputValueDefinitionNode>;
|
|
365
|
-
}
|
|
366
|
-
export {};
|
|
367
|
-
//# sourceMappingURL=TypedAST.d.ts.map
|