@graphitation/supermassive 0.4.5 → 0.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.json +16 -1
- package/CHANGELOG.md +10 -2
- package/lib/benchmarks/swapi-schema/resolvers.d.ts.map +1 -1
- package/lib/benchmarks/swapi-schema/resolvers.js +56 -0
- package/lib/benchmarks/swapi-schema/resolvers.mjs +41 -0
- package/lib/executeWithoutSchema.d.ts +6 -5
- package/lib/executeWithoutSchema.d.ts.map +1 -1
- package/lib/executeWithoutSchema.js +5 -1
- package/lib/executeWithoutSchema.mjs +5 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.mjs +7 -1
- package/lib/subscribeWithSchema.d.ts +3 -0
- package/lib/subscribeWithSchema.d.ts.map +1 -0
- package/lib/subscribeWithSchema.js +78 -0
- package/lib/subscribeWithSchema.mjs +64 -0
- package/lib/subscribeWithoutSchema.d.ts +57 -0
- package/lib/subscribeWithoutSchema.d.ts.map +1 -0
- package/lib/subscribeWithoutSchema.js +155 -0
- package/lib/subscribeWithoutSchema.mjs +144 -0
- package/lib/types.d.ts +7 -2
- package/lib/types.d.ts.map +1 -1
- package/lib/utilities/mapAsyncIterator.d.ts +7 -0
- package/lib/utilities/mapAsyncIterator.d.ts.map +1 -0
- package/lib/utilities/mapAsyncIterator.js +71 -0
- package/lib/utilities/mapAsyncIterator.mjs +66 -0
- package/package.json +2 -1
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/home/runner/work/graphitation/graphitation/packages/supermassive/src/__tests__/execute.test.ts":"1","/home/runner/work/graphitation/graphitation/packages/supermassive/src/__tests__/extractImplicitTypes.test.ts":"2","/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/TypedAST.ts":"3","/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/__tests__/addTypesToRequestDocument.test.ts":"4","/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/addTypesToRequestDocument.ts":"5","/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/index.ts":"6","/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/nice-benchmark.ts":"7","/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/index.ts":"8","/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/models.ts":"9","/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/resolvers.ts":"10","/home/runner/work/graphitation/graphitation/packages/supermassive/src/bin/__tests__/typeDefsToImplicitResolvers.test.ts":"11","/home/runner/work/graphitation/graphitation/packages/supermassive/src/bin/supermassive.ts":"12","/home/runner/work/graphitation/graphitation/packages/supermassive/src/collectFields.ts":"13","/home/runner/work/graphitation/graphitation/packages/supermassive/src/compiledQuery.ts":"14","/home/runner/work/graphitation/graphitation/packages/supermassive/src/executeWithSchema.ts":"15","/home/runner/work/graphitation/graphitation/packages/supermassive/src/executeWithoutSchema.ts":"16","/home/runner/work/graphitation/graphitation/packages/supermassive/src/extractImplicitTypesRuntime.ts":"17","/home/runner/work/graphitation/graphitation/packages/supermassive/src/extractImplicitTypesToTypescript.ts":"18","/home/runner/work/graphitation/graphitation/packages/supermassive/src/index.ts":"19","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/Maybe.ts":"20","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/ObjMap.ts":"21","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/Path.ts":"22","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/PromiseOrValue.ts":"23","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/devAssert.ts":"24","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/didYouMean.ts":"25","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/identityFunc.ts":"26","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/inspect.ts":"27","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/instanceOf.ts":"28","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/invariant.ts":"29","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isAsyncIterable.ts":"30","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isIterableObject.ts":"31","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isObjectLike.ts":"32","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isPromise.ts":"33","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/keyMap.ts":"34","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/keyValMap.ts":"35","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/mapValue.ts":"36","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/memoize3.ts":"37","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/naturalCompare.ts":"38","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/printPathArray.ts":"39","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/promiseForObject.ts":"40","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/promiseReduce.ts":"41","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/suggestionList.ts":"42","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/toObjMap.ts":"43","/home/runner/work/graphitation/graphitation/packages/supermassive/src/transforms/annotateDocumentGraphQLTransform.ts":"44","/home/runner/work/graphitation/graphitation/packages/supermassive/src/transforms/transformerTestUtils.ts":"45","/home/runner/work/graphitation/graphitation/packages/supermassive/src/types.ts":"46","/home/runner/work/graphitation/graphitation/packages/supermassive/src/utilities/typeNameFromAST.ts":"47","/home/runner/work/graphitation/graphitation/packages/supermassive/src/values.ts":"48"},{"size":4277,"mtime":1642158764936,"results":"49","hashOfConfig":"50"},{"size":3025,"mtime":1642158764936,"results":"51","hashOfConfig":"50"},{"size":14345,"mtime":1642158764936,"results":"52","hashOfConfig":"50"},{"size":5291,"mtime":1642158764936,"results":"53","hashOfConfig":"50"},{"size":2186,"mtime":1642158764936,"results":"54","hashOfConfig":"50"},{"size":3145,"mtime":1642158764936,"results":"55","hashOfConfig":"50"},{"size":712,"mtime":1642158764936,"results":"56","hashOfConfig":"50"},{"size":381,"mtime":1642158764936,"results":"57","hashOfConfig":"50"},{"size":128,"mtime":1642158764936,"results":"58","hashOfConfig":"50"},{"size":9598,"mtime":1642158764936,"results":"59","hashOfConfig":"50"},{"size":846,"mtime":1642158764940,"results":"60","hashOfConfig":"50"},{"size":1650,"mtime":1642158764940,"results":"61","hashOfConfig":"50"},{"size":3913,"mtime":1642158764940,"results":"62","hashOfConfig":"50"},{"size":3431,"mtime":1642158764940,"results":"63","hashOfConfig":"50"},{"size":1387,"mtime":1642158764940,"results":"64","hashOfConfig":"50"},{"size":26993,"mtime":1642158764940,"results":"65","hashOfConfig":"50"},{"size":3998,"mtime":1642158764940,"results":"66","hashOfConfig":"50"},{"size":10386,"mtime":1642158764940,"results":"67","hashOfConfig":"50"},{"size":457,"mtime":1642158764940,"results":"68","hashOfConfig":"50"},{"size":134,"mtime":1642158764940,"results":"69","hashOfConfig":"50"},{"size":277,"mtime":1642158764940,"results":"70","hashOfConfig":"50"},{"size":711,"mtime":1642158764940,"results":"71","hashOfConfig":"50"},{"size":48,"mtime":1642158764940,"results":"72","hashOfConfig":"50"},{"size":269,"mtime":1642158764940,"results":"73","hashOfConfig":"50"},{"size":1038,"mtime":1642158764940,"results":"74","hashOfConfig":"50"},{"size":108,"mtime":1642158764940,"results":"75","hashOfConfig":"50"},{"size":2797,"mtime":1642158764940,"results":"76","hashOfConfig":"50"},{"size":2294,"mtime":1642158764940,"results":"77","hashOfConfig":"50"},{"size":357,"mtime":1642158764940,"results":"78","hashOfConfig":"50"},{"size":325,"mtime":1642158764940,"results":"79","hashOfConfig":"50"},{"size":778,"mtime":1642158764940,"results":"80","hashOfConfig":"50"},{"size":278,"mtime":1642158764940,"results":"81","hashOfConfig":"50"},{"size":227,"mtime":1642158764940,"results":"82","hashOfConfig":"50"},{"size":921,"mtime":1642158764940,"results":"83","hashOfConfig":"50"},{"size":764,"mtime":1642158764940,"results":"84","hashOfConfig":"50"},{"size":441,"mtime":1642158764940,"results":"85","hashOfConfig":"50"},{"size":821,"mtime":1642158764940,"results":"86","hashOfConfig":"50"},{"size":1314,"mtime":1642158764940,"results":"87","hashOfConfig":"50"},{"size":253,"mtime":1642158764940,"results":"88","hashOfConfig":"50"},{"size":650,"mtime":1642158764940,"results":"89","hashOfConfig":"50"},{"size":803,"mtime":1642158764940,"results":"90","hashOfConfig":"50"},{"size":3938,"mtime":1642158764940,"results":"91","hashOfConfig":"50"},{"size":503,"mtime":1642158764940,"results":"92","hashOfConfig":"50"},{"size":495,"mtime":1642158764940,"results":"93","hashOfConfig":"50"},{"size":6644,"mtime":1642158764940,"results":"94","hashOfConfig":"50"},{"size":3414,"mtime":1642158764940,"results":"95","hashOfConfig":"50"},{"size":308,"mtime":1642158764940,"results":"96","hashOfConfig":"50"},{"size":9234,"mtime":1642158764940,"results":"97","hashOfConfig":"50"},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"2qg1xb",{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"136","messages":"137","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"142","messages":"143","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"148","messages":"149","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"154","messages":"155","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"160","messages":"161","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"162","messages":"163","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"164","messages":"165","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"166","messages":"167","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"168","messages":"169","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"172","messages":"173","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"174","messages":"175","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"176","messages":"177","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"178","messages":"179","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"180","messages":"181","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"182","messages":"183","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"184","messages":"185","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"186","messages":"187","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"188","messages":"189","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"190","messages":"191","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"192","messages":"193","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/graphitation/graphitation/packages/supermassive/src/__tests__/execute.test.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/__tests__/extractImplicitTypes.test.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/TypedAST.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/__tests__/addTypesToRequestDocument.test.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/addTypesToRequestDocument.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/index.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/nice-benchmark.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/index.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/models.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/resolvers.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/bin/__tests__/typeDefsToImplicitResolvers.test.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/bin/supermassive.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/collectFields.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/compiledQuery.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/executeWithSchema.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/executeWithoutSchema.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/extractImplicitTypesRuntime.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/extractImplicitTypesToTypescript.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/index.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/Maybe.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/ObjMap.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/Path.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/PromiseOrValue.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/devAssert.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/didYouMean.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/identityFunc.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/inspect.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/instanceOf.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/invariant.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isAsyncIterable.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isIterableObject.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isObjectLike.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isPromise.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/keyMap.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/keyValMap.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/mapValue.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/memoize3.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/naturalCompare.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/printPathArray.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/promiseForObject.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/promiseReduce.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/suggestionList.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/toObjMap.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/transforms/annotateDocumentGraphQLTransform.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/transforms/transformerTestUtils.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/types.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/utilities/typeNameFromAST.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/values.ts",[]]
|
|
1
|
+
[{"/home/runner/work/graphitation/graphitation/packages/supermassive/src/__tests__/execute.test.ts":"1","/home/runner/work/graphitation/graphitation/packages/supermassive/src/__tests__/extractImplicitTypes.test.ts":"2","/home/runner/work/graphitation/graphitation/packages/supermassive/src/__tests__/subscribe.test.ts":"3","/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/TypedAST.ts":"4","/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/__tests__/addTypesToRequestDocument.test.ts":"5","/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/addTypesToRequestDocument.ts":"6","/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/index.ts":"7","/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/nice-benchmark.ts":"8","/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/index.ts":"9","/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/models.ts":"10","/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/resolvers.ts":"11","/home/runner/work/graphitation/graphitation/packages/supermassive/src/bin/__tests__/typeDefsToImplicitResolvers.test.ts":"12","/home/runner/work/graphitation/graphitation/packages/supermassive/src/bin/supermassive.ts":"13","/home/runner/work/graphitation/graphitation/packages/supermassive/src/collectFields.ts":"14","/home/runner/work/graphitation/graphitation/packages/supermassive/src/compiledQuery.ts":"15","/home/runner/work/graphitation/graphitation/packages/supermassive/src/executeWithSchema.ts":"16","/home/runner/work/graphitation/graphitation/packages/supermassive/src/executeWithoutSchema.ts":"17","/home/runner/work/graphitation/graphitation/packages/supermassive/src/extractImplicitTypesRuntime.ts":"18","/home/runner/work/graphitation/graphitation/packages/supermassive/src/extractImplicitTypesToTypescript.ts":"19","/home/runner/work/graphitation/graphitation/packages/supermassive/src/index.ts":"20","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/Maybe.ts":"21","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/ObjMap.ts":"22","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/Path.ts":"23","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/PromiseOrValue.ts":"24","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/devAssert.ts":"25","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/didYouMean.ts":"26","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/identityFunc.ts":"27","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/inspect.ts":"28","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/instanceOf.ts":"29","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/invariant.ts":"30","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isAsyncIterable.ts":"31","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isIterableObject.ts":"32","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isObjectLike.ts":"33","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isPromise.ts":"34","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/keyMap.ts":"35","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/keyValMap.ts":"36","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/mapValue.ts":"37","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/memoize3.ts":"38","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/naturalCompare.ts":"39","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/printPathArray.ts":"40","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/promiseForObject.ts":"41","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/promiseReduce.ts":"42","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/suggestionList.ts":"43","/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/toObjMap.ts":"44","/home/runner/work/graphitation/graphitation/packages/supermassive/src/subscribeWithSchema.ts":"45","/home/runner/work/graphitation/graphitation/packages/supermassive/src/subscribeWithoutSchema.ts":"46","/home/runner/work/graphitation/graphitation/packages/supermassive/src/transforms/annotateDocumentGraphQLTransform.ts":"47","/home/runner/work/graphitation/graphitation/packages/supermassive/src/transforms/transformerTestUtils.ts":"48","/home/runner/work/graphitation/graphitation/packages/supermassive/src/types.ts":"49","/home/runner/work/graphitation/graphitation/packages/supermassive/src/utilities/mapAsyncIterator.ts":"50","/home/runner/work/graphitation/graphitation/packages/supermassive/src/utilities/typeNameFromAST.ts":"51","/home/runner/work/graphitation/graphitation/packages/supermassive/src/values.ts":"52"},{"size":4277,"mtime":1642499860367,"results":"53","hashOfConfig":"54"},{"size":3107,"mtime":1642499860367,"results":"55","hashOfConfig":"54"},{"size":7241,"mtime":1642499860367,"results":"56","hashOfConfig":"54"},{"size":14345,"mtime":1642499860367,"results":"57","hashOfConfig":"54"},{"size":5291,"mtime":1642499860367,"results":"58","hashOfConfig":"54"},{"size":2186,"mtime":1642499860367,"results":"59","hashOfConfig":"54"},{"size":3145,"mtime":1642499860367,"results":"60","hashOfConfig":"54"},{"size":712,"mtime":1642499860367,"results":"61","hashOfConfig":"54"},{"size":381,"mtime":1642499860367,"results":"62","hashOfConfig":"54"},{"size":128,"mtime":1642499860367,"results":"63","hashOfConfig":"54"},{"size":10205,"mtime":1642499860367,"results":"64","hashOfConfig":"54"},{"size":846,"mtime":1642499860371,"results":"65","hashOfConfig":"54"},{"size":1650,"mtime":1642499860371,"results":"66","hashOfConfig":"54"},{"size":3913,"mtime":1642499860371,"results":"67","hashOfConfig":"54"},{"size":3431,"mtime":1642499860371,"results":"68","hashOfConfig":"54"},{"size":1387,"mtime":1642499860371,"results":"69","hashOfConfig":"54"},{"size":27153,"mtime":1642499860371,"results":"70","hashOfConfig":"54"},{"size":3998,"mtime":1642499860371,"results":"71","hashOfConfig":"54"},{"size":10386,"mtime":1642499860371,"results":"72","hashOfConfig":"54"},{"size":633,"mtime":1642499860371,"results":"73","hashOfConfig":"54"},{"size":134,"mtime":1642499860371,"results":"74","hashOfConfig":"54"},{"size":277,"mtime":1642499860371,"results":"75","hashOfConfig":"54"},{"size":711,"mtime":1642499860371,"results":"76","hashOfConfig":"54"},{"size":48,"mtime":1642499860371,"results":"77","hashOfConfig":"54"},{"size":269,"mtime":1642499860371,"results":"78","hashOfConfig":"54"},{"size":1038,"mtime":1642499860371,"results":"79","hashOfConfig":"54"},{"size":108,"mtime":1642499860371,"results":"80","hashOfConfig":"54"},{"size":2797,"mtime":1642499860371,"results":"81","hashOfConfig":"54"},{"size":2294,"mtime":1642499860371,"results":"82","hashOfConfig":"54"},{"size":357,"mtime":1642499860371,"results":"83","hashOfConfig":"54"},{"size":325,"mtime":1642499860371,"results":"84","hashOfConfig":"54"},{"size":778,"mtime":1642499860371,"results":"85","hashOfConfig":"54"},{"size":278,"mtime":1642499860371,"results":"86","hashOfConfig":"54"},{"size":227,"mtime":1642499860371,"results":"87","hashOfConfig":"54"},{"size":921,"mtime":1642499860371,"results":"88","hashOfConfig":"54"},{"size":764,"mtime":1642499860371,"results":"89","hashOfConfig":"54"},{"size":441,"mtime":1642499860371,"results":"90","hashOfConfig":"54"},{"size":821,"mtime":1642499860371,"results":"91","hashOfConfig":"54"},{"size":1314,"mtime":1642499860371,"results":"92","hashOfConfig":"54"},{"size":253,"mtime":1642499860371,"results":"93","hashOfConfig":"54"},{"size":650,"mtime":1642499860371,"results":"94","hashOfConfig":"54"},{"size":803,"mtime":1642499860371,"results":"95","hashOfConfig":"54"},{"size":3938,"mtime":1642499860371,"results":"96","hashOfConfig":"54"},{"size":503,"mtime":1642499860371,"results":"97","hashOfConfig":"54"},{"size":1438,"mtime":1642499860371,"results":"98","hashOfConfig":"54"},{"size":8927,"mtime":1642499860371,"results":"99","hashOfConfig":"54"},{"size":495,"mtime":1642499860371,"results":"100","hashOfConfig":"54"},{"size":6644,"mtime":1642499860371,"results":"101","hashOfConfig":"54"},{"size":3824,"mtime":1642499860371,"results":"102","hashOfConfig":"54"},{"size":1813,"mtime":1642499860371,"results":"103","hashOfConfig":"54"},{"size":308,"mtime":1642499860371,"results":"104","hashOfConfig":"54"},{"size":9234,"mtime":1642499860371,"results":"105","hashOfConfig":"54"},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"2qg1xb",{"filePath":"108","messages":"109","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"136","messages":"137","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"142","messages":"143","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"148","messages":"149","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"154","messages":"155","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"160","messages":"161","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"162","messages":"163","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"164","messages":"165","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"166","messages":"167","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"168","messages":"169","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"172","messages":"173","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"174","messages":"175","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"176","messages":"177","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"178","messages":"179","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"180","messages":"181","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"182","messages":"183","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"184","messages":"185","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"186","messages":"187","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"188","messages":"189","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"190","messages":"191","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"192","messages":"193","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"194","messages":"195","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"196","messages":"197","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"198","messages":"199","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"200","messages":"201","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"202","messages":"203","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"204","messages":"205","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"206","messages":"207","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"208","messages":"209","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/graphitation/graphitation/packages/supermassive/src/__tests__/execute.test.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/__tests__/extractImplicitTypes.test.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/__tests__/subscribe.test.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/TypedAST.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/__tests__/addTypesToRequestDocument.test.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/ast/addTypesToRequestDocument.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/index.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/nice-benchmark.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/index.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/models.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/benchmarks/swapi-schema/resolvers.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/bin/__tests__/typeDefsToImplicitResolvers.test.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/bin/supermassive.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/collectFields.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/compiledQuery.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/executeWithSchema.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/executeWithoutSchema.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/extractImplicitTypesRuntime.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/extractImplicitTypesToTypescript.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/index.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/Maybe.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/ObjMap.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/Path.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/PromiseOrValue.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/devAssert.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/didYouMean.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/identityFunc.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/inspect.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/instanceOf.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/invariant.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isAsyncIterable.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isIterableObject.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isObjectLike.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/isPromise.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/keyMap.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/keyValMap.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/mapValue.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/memoize3.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/naturalCompare.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/printPathArray.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/promiseForObject.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/promiseReduce.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/suggestionList.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/jsutils/toObjMap.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/subscribeWithSchema.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/subscribeWithoutSchema.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/transforms/annotateDocumentGraphQLTransform.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/transforms/transformerTestUtils.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/types.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/utilities/mapAsyncIterator.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/utilities/typeNameFromAST.ts",[],"/home/runner/work/graphitation/graphitation/packages/supermassive/src/values.ts",[]]
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@graphitation/supermassive",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 18 Jan 2022 09:59:46 GMT",
|
|
6
|
+
"tag": "@graphitation/supermassive_v0.5.0",
|
|
7
|
+
"version": "0.5.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "jakubvejr@microsoft.com",
|
|
12
|
+
"package": "@graphitation/supermassive",
|
|
13
|
+
"commit": "6a2790e55986f1ae77c6abacdc7e7b81255c68f2",
|
|
14
|
+
"comment": "Added support for subscribe operation"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Fri, 14 Jan 2022 11:15:34 GMT",
|
|
6
21
|
"tag": "@graphitation/supermassive_v0.4.5",
|
|
7
22
|
"version": "0.4.5",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - @graphitation/supermassive
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 18 Jan 2022 09:59:46 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.5.0
|
|
8
|
+
|
|
9
|
+
Tue, 18 Jan 2022 09:59:46 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Added support for subscribe operation (jakubvejr@microsoft.com)
|
|
14
|
+
|
|
7
15
|
## 0.4.5
|
|
8
16
|
|
|
9
|
-
Fri, 14 Jan 2022 11:15:
|
|
17
|
+
Fri, 14 Jan 2022 11:15:34 GMT
|
|
10
18
|
|
|
11
19
|
### Patches
|
|
12
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/benchmarks/swapi-schema/resolvers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/benchmarks/swapi-schema/resolvers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AA4NpE,QAAA,MAAM,SAAS,EAAE,2BAA2B,CAAC,WAAW,CAwKvD,CAAC;AAKF,eAAe,SAAS,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
2
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
7
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
8
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
9
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value;
|
|
@@ -19,10 +23,42 @@ var __export = (target, all) => {
|
|
|
19
23
|
for (var name in all)
|
|
20
24
|
__defProp(target, name, {get: all[name], enumerable: true});
|
|
21
25
|
};
|
|
26
|
+
var __reExport = (target, module2, desc) => {
|
|
27
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
28
|
+
for (let key of __getOwnPropNames(module2))
|
|
29
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
30
|
+
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
var __toModule = (module2) => {
|
|
35
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
|
|
36
|
+
};
|
|
37
|
+
var __async = (__this, __arguments, generator) => {
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
var fulfilled = (value) => {
|
|
40
|
+
try {
|
|
41
|
+
step(generator.next(value));
|
|
42
|
+
} catch (e) {
|
|
43
|
+
reject(e);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var rejected = (value) => {
|
|
47
|
+
try {
|
|
48
|
+
step(generator.throw(value));
|
|
49
|
+
} catch (e) {
|
|
50
|
+
reject(e);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
54
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
55
|
+
});
|
|
56
|
+
};
|
|
22
57
|
__markAsModule(exports);
|
|
23
58
|
__export(exports, {
|
|
24
59
|
default: () => resolvers_default
|
|
25
60
|
});
|
|
61
|
+
var import_iterall = __toModule(require("iterall"));
|
|
26
62
|
const films = (parent, args, {models}) => {
|
|
27
63
|
return models.getData("/films").filter(({id}) => parent.films.includes(id));
|
|
28
64
|
};
|
|
@@ -85,6 +121,21 @@ const searchStarshipsByName = (parent, {search}, {models}) => {
|
|
|
85
121
|
const searchVehiclesByName = (parent, {search}, {models}) => {
|
|
86
122
|
return models.getData("/vehicles").filter((vehicle2) => new RegExp(search, "i").test(vehicle2.name));
|
|
87
123
|
};
|
|
124
|
+
const emitPersons = function(_0, _1, _2) {
|
|
125
|
+
return __async(this, arguments, function* (parent, {limit, throwError}, {models}) {
|
|
126
|
+
if (throwError) {
|
|
127
|
+
throw new Error("error");
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const persons = yield models.getData("/people");
|
|
131
|
+
const personsLimit = Math.min(limit, persons.length);
|
|
132
|
+
const output = {length: personsLimit};
|
|
133
|
+
for (let i = 0; i < personsLimit; i++) {
|
|
134
|
+
output[i] = {emitPersons: persons[i]};
|
|
135
|
+
}
|
|
136
|
+
return (0, import_iterall.createAsyncIterator)(output);
|
|
137
|
+
});
|
|
138
|
+
};
|
|
88
139
|
const searchTransportsByName = (parent, {search}, {models}) => {
|
|
89
140
|
return models.getData("/transport").filter((transport2) => new RegExp(search, "i").test(transport2.name));
|
|
90
141
|
};
|
|
@@ -94,6 +145,11 @@ const resolvers = {
|
|
|
94
145
|
return parent.__typename;
|
|
95
146
|
}
|
|
96
147
|
},
|
|
148
|
+
Subscription: {
|
|
149
|
+
emitPersons: {
|
|
150
|
+
subscribe: emitPersons
|
|
151
|
+
}
|
|
152
|
+
},
|
|
97
153
|
Query: {
|
|
98
154
|
search(parent, {search}, {models}, info) {
|
|
99
155
|
const result = [
|
|
@@ -14,8 +14,29 @@ var __objSpread = (a, b) => {
|
|
|
14
14
|
}
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
|
+
var __async = (__this, __arguments, generator) => {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
var fulfilled = (value) => {
|
|
20
|
+
try {
|
|
21
|
+
step(generator.next(value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var rejected = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.throw(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
34
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
17
37
|
|
|
18
38
|
// src/benchmarks/swapi-schema/resolvers.ts
|
|
39
|
+
import {createAsyncIterator} from "iterall";
|
|
19
40
|
var films = (parent, args, {models}) => {
|
|
20
41
|
return models.getData("/films").filter(({id}) => parent.films.includes(id));
|
|
21
42
|
};
|
|
@@ -75,6 +96,21 @@ var searchStarshipsByName = (parent, {search}, {models}) => {
|
|
|
75
96
|
var searchVehiclesByName = (parent, {search}, {models}) => {
|
|
76
97
|
return models.getData("/vehicles").filter((vehicle2) => new RegExp(search, "i").test(vehicle2.name));
|
|
77
98
|
};
|
|
99
|
+
var emitPersons = function(_0, _1, _2) {
|
|
100
|
+
return __async(this, arguments, function* (parent, {limit, throwError}, {models}) {
|
|
101
|
+
if (throwError) {
|
|
102
|
+
throw new Error("error");
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const persons = yield models.getData("/people");
|
|
106
|
+
const personsLimit = Math.min(limit, persons.length);
|
|
107
|
+
const output = {length: personsLimit};
|
|
108
|
+
for (let i = 0; i < personsLimit; i++) {
|
|
109
|
+
output[i] = {emitPersons: persons[i]};
|
|
110
|
+
}
|
|
111
|
+
return createAsyncIterator(output);
|
|
112
|
+
});
|
|
113
|
+
};
|
|
78
114
|
var searchTransportsByName = (parent, {search}, {models}) => {
|
|
79
115
|
return models.getData("/transport").filter((transport2) => new RegExp(search, "i").test(transport2.name));
|
|
80
116
|
};
|
|
@@ -84,6 +120,11 @@ var resolvers = {
|
|
|
84
120
|
return parent.__typename;
|
|
85
121
|
}
|
|
86
122
|
},
|
|
123
|
+
Subscription: {
|
|
124
|
+
emitPersons: {
|
|
125
|
+
subscribe: emitPersons
|
|
126
|
+
}
|
|
127
|
+
},
|
|
87
128
|
Query: {
|
|
88
129
|
search(parent, {search}, {models}, info) {
|
|
89
130
|
const result = [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GraphQLError } from "graphql";
|
|
2
|
-
import { DocumentNode, FieldNode, FragmentDefinitionNode, OperationDefinitionNode, TypeNode } from "./ast/TypedAST";
|
|
2
|
+
import { DocumentNode, FieldNode, FragmentDefinitionNode, OperationDefinitionNode, OperationTypeDefinitionNode, TypeNode } from "./ast/TypedAST";
|
|
3
3
|
import type { Maybe } from "./jsutils/Maybe";
|
|
4
4
|
import type { ObjMap } from "./jsutils/ObjMap";
|
|
5
5
|
import type { Path } from "./jsutils/Path";
|
|
6
6
|
import type { PromiseOrValue } from "./jsutils/PromiseOrValue";
|
|
7
|
-
import { ExecutionWithoutSchemaArgs,
|
|
7
|
+
import { ExecutionWithoutSchemaArgs, FunctionFieldResolver, ResolveInfo, Resolvers, TypeResolver, ExecutionResult } from "./types";
|
|
8
8
|
/**
|
|
9
9
|
* Terminology
|
|
10
10
|
*
|
|
@@ -39,7 +39,7 @@ export interface ExecutionContext {
|
|
|
39
39
|
variableValues: {
|
|
40
40
|
[variable: string]: unknown;
|
|
41
41
|
};
|
|
42
|
-
fieldResolver:
|
|
42
|
+
fieldResolver: FunctionFieldResolver<any, any>;
|
|
43
43
|
typeResolver: TypeResolver<any, any>;
|
|
44
44
|
errors: Array<GraphQLError>;
|
|
45
45
|
}
|
|
@@ -73,7 +73,7 @@ export declare function assertValidExecutionArguments(document: DocumentNode, ra
|
|
|
73
73
|
*/
|
|
74
74
|
export declare function buildExecutionContext(resolvers: Resolvers, document: DocumentNode, rootValue: unknown, contextValue: unknown, rawVariableValues: Maybe<{
|
|
75
75
|
[variable: string]: unknown;
|
|
76
|
-
}>, operationName: Maybe<string>, fieldResolver: Maybe<
|
|
76
|
+
}>, operationName: Maybe<string>, fieldResolver: Maybe<FunctionFieldResolver<unknown, unknown>>, typeResolver?: Maybe<TypeResolver<unknown, unknown>>): Array<GraphQLError> | ExecutionContext;
|
|
77
77
|
/**
|
|
78
78
|
* @internal
|
|
79
79
|
*/
|
|
@@ -95,5 +95,6 @@ export declare const defaultTypeResolver: TypeResolver<unknown, unknown>;
|
|
|
95
95
|
* and returns it as the result, or if it's a function, returns the result
|
|
96
96
|
* of calling that function while passing along args and context value.
|
|
97
97
|
*/
|
|
98
|
-
export declare const defaultFieldResolver:
|
|
98
|
+
export declare const defaultFieldResolver: FunctionFieldResolver<unknown, unknown>;
|
|
99
|
+
export declare function getOperationRootTypeName(operation: OperationDefinitionNode | OperationTypeDefinitionNode): string;
|
|
99
100
|
//# sourceMappingURL=executeWithoutSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeWithoutSchema.d.ts","sourceRoot":"","sources":["../src/executeWithoutSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EASb,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"executeWithoutSchema.d.ts","sourceRoot":"","sources":["../src/executeWithoutSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EASb,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAQxB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EACL,0BAA0B,EAE1B,qBAAqB,EAGrB,WAAW,EAEX,SAAS,EACT,YAAY,EAEZ,eAAe,EAChB,MAAM,SAAS,CAAC;AAQjB;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,uBAAuB,CAAC;IACnC,cAAc,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAChD,aAAa,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC/C,YAAY,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACrC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,0BAA0B,GAC/B,cAAc,CAAC,eAAe,CAAC,CA0CjC;AAoBD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,YAAY,EACtB,iBAAiB,EAAE,KAAK,CAAC;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC,GACxD,IAAI,CAQN;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,OAAO,EACrB,iBAAiB,EAAE,KAAK,CAAC;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC,EACzD,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,EAC5B,aAAa,EAAE,KAAK,CAAC,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,EAC7D,YAAY,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,GACnD,KAAK,CAAC,YAAY,CAAC,GAAG,gBAAgB,CAyDxC;AAoPD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,gBAAgB,EAC5B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,EAC5B,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,QAAQ,EACxB,IAAI,EAAE,IAAI,GACT,WAAW,CAeb;AAoWD;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAM9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,qBAAqB,CACtD,OAAO,EACP,OAAO,CAUR,CAAC;AAGF,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,uBAAuB,GAAG,2BAA2B,GAC/D,MAAM,CASR"}
|
|
@@ -27,7 +27,8 @@ __export(exports, {
|
|
|
27
27
|
buildResolveInfo: () => buildResolveInfo,
|
|
28
28
|
defaultFieldResolver: () => defaultFieldResolver,
|
|
29
29
|
defaultTypeResolver: () => defaultTypeResolver,
|
|
30
|
-
executeWithoutSchema: () => executeWithoutSchema
|
|
30
|
+
executeWithoutSchema: () => executeWithoutSchema,
|
|
31
|
+
getOperationRootTypeName: () => getOperationRootTypeName
|
|
31
32
|
});
|
|
32
33
|
var import_graphql = __toModule(require("graphql"));
|
|
33
34
|
var import_collectFields = __toModule(require("./collectFields"));
|
|
@@ -191,6 +192,9 @@ function executeField(exeContext, parentTypeName, source, fieldNodes, path) {
|
|
|
191
192
|
returnTypeName = (0, import_typeNameFromAST.typeNameFromAST)(returnTypeNode);
|
|
192
193
|
const typeResolvers = exeContext.resolvers[parentTypeName];
|
|
193
194
|
resolveFn = typeResolvers == null ? void 0 : typeResolvers[fieldName];
|
|
195
|
+
if (typeof resolveFn !== "function" && resolveFn != null) {
|
|
196
|
+
resolveFn = resolveFn.resolve;
|
|
197
|
+
}
|
|
194
198
|
}
|
|
195
199
|
if (!resolveFn) {
|
|
196
200
|
resolveFn = exeContext.fieldResolver;
|
|
@@ -173,6 +173,9 @@ function executeField(exeContext, parentTypeName, source, fieldNodes, path) {
|
|
|
173
173
|
returnTypeName = typeNameFromAST(returnTypeNode);
|
|
174
174
|
const typeResolvers = exeContext.resolvers[parentTypeName];
|
|
175
175
|
resolveFn = typeResolvers == null ? void 0 : typeResolvers[fieldName];
|
|
176
|
+
if (typeof resolveFn !== "function" && resolveFn != null) {
|
|
177
|
+
resolveFn = resolveFn.resolve;
|
|
178
|
+
}
|
|
176
179
|
}
|
|
177
180
|
if (!resolveFn) {
|
|
178
181
|
resolveFn = exeContext.fieldResolver;
|
|
@@ -359,5 +362,6 @@ export {
|
|
|
359
362
|
buildResolveInfo,
|
|
360
363
|
defaultFieldResolver,
|
|
361
364
|
defaultTypeResolver,
|
|
362
|
-
executeWithoutSchema
|
|
365
|
+
executeWithoutSchema,
|
|
366
|
+
getOperationRootTypeName
|
|
363
367
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export { executeWithoutSchema } from "./executeWithoutSchema";
|
|
2
2
|
export { executeWithSchema } from "./executeWithSchema";
|
|
3
|
+
export { subscribeWithSchema } from "./subscribeWithSchema";
|
|
4
|
+
export { subscribeWithoutSchema } from "./subscribeWithoutSchema";
|
|
3
5
|
export type { Resolvers } from "./types";
|
|
4
6
|
export { addTypesToRequestDocument } from "./ast/addTypesToRequestDocument";
|
|
5
7
|
export { extractImplicitTypes } from "./extractImplicitTypesRuntime";
|
|
6
8
|
export { specifiedScalars } from "./values";
|
|
7
9
|
export { annotateDocumentGraphQLTransform } from "./transforms/annotateDocumentGraphQLTransform";
|
|
10
|
+
export { DocumentNode } from "./ast/TypedAST";
|
|
8
11
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,gCAAgC,EAAE,MAAM,+CAA+C,CAAC;AAEjG,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -22,16 +22,22 @@ var __toModule = (module2) => {
|
|
|
22
22
|
};
|
|
23
23
|
__markAsModule(exports);
|
|
24
24
|
__export(exports, {
|
|
25
|
+
DocumentNode: () => import_TypedAST.DocumentNode,
|
|
25
26
|
addTypesToRequestDocument: () => import_addTypesToRequestDocument.addTypesToRequestDocument,
|
|
26
27
|
annotateDocumentGraphQLTransform: () => import_annotateDocumentGraphQLTransform.annotateDocumentGraphQLTransform,
|
|
27
28
|
executeWithSchema: () => import_executeWithSchema.executeWithSchema,
|
|
28
29
|
executeWithoutSchema: () => import_executeWithoutSchema.executeWithoutSchema,
|
|
29
30
|
extractImplicitTypes: () => import_extractImplicitTypesRuntime.extractImplicitTypes,
|
|
30
|
-
specifiedScalars: () => import_values.specifiedScalars
|
|
31
|
+
specifiedScalars: () => import_values.specifiedScalars,
|
|
32
|
+
subscribeWithSchema: () => import_subscribeWithSchema.subscribeWithSchema,
|
|
33
|
+
subscribeWithoutSchema: () => import_subscribeWithoutSchema.subscribeWithoutSchema
|
|
31
34
|
});
|
|
32
35
|
var import_executeWithoutSchema = __toModule(require("./executeWithoutSchema"));
|
|
33
36
|
var import_executeWithSchema = __toModule(require("./executeWithSchema"));
|
|
37
|
+
var import_subscribeWithSchema = __toModule(require("./subscribeWithSchema"));
|
|
38
|
+
var import_subscribeWithoutSchema = __toModule(require("./subscribeWithoutSchema"));
|
|
34
39
|
var import_addTypesToRequestDocument = __toModule(require("./ast/addTypesToRequestDocument"));
|
|
35
40
|
var import_extractImplicitTypesRuntime = __toModule(require("./extractImplicitTypesRuntime"));
|
|
36
41
|
var import_values = __toModule(require("./values"));
|
|
37
42
|
var import_annotateDocumentGraphQLTransform = __toModule(require("./transforms/annotateDocumentGraphQLTransform"));
|
|
43
|
+
var import_TypedAST = __toModule(require("./ast/TypedAST"));
|
package/lib/index.mjs
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import {executeWithoutSchema} from "./executeWithoutSchema.mjs";
|
|
3
3
|
import {executeWithSchema} from "./executeWithSchema.mjs";
|
|
4
|
+
import {subscribeWithSchema} from "./subscribeWithSchema.mjs";
|
|
5
|
+
import {subscribeWithoutSchema} from "./subscribeWithoutSchema.mjs";
|
|
4
6
|
import {addTypesToRequestDocument} from "./ast/addTypesToRequestDocument.mjs";
|
|
5
7
|
import {extractImplicitTypes} from "./extractImplicitTypesRuntime.mjs";
|
|
6
8
|
import {specifiedScalars} from "./values.mjs";
|
|
7
9
|
import {annotateDocumentGraphQLTransform} from "./transforms/annotateDocumentGraphQLTransform.mjs";
|
|
10
|
+
import {DocumentNode} from "./ast/TypedAST.mjs";
|
|
8
11
|
export {
|
|
12
|
+
DocumentNode,
|
|
9
13
|
addTypesToRequestDocument,
|
|
10
14
|
annotateDocumentGraphQLTransform,
|
|
11
15
|
executeWithSchema,
|
|
12
16
|
executeWithoutSchema,
|
|
13
17
|
extractImplicitTypes,
|
|
14
|
-
specifiedScalars
|
|
18
|
+
specifiedScalars,
|
|
19
|
+
subscribeWithSchema,
|
|
20
|
+
subscribeWithoutSchema
|
|
15
21
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ExecutionResult, ExecutionWithSchemaArgs } from "./types";
|
|
2
|
+
export declare function subscribeWithSchema({ typeDefs, resolvers, document: rawDocument, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver, }: ExecutionWithSchemaArgs): Promise<AsyncGenerator<ExecutionResult, void, void> | ExecutionResult>;
|
|
3
|
+
//# sourceMappingURL=subscribeWithSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribeWithSchema.d.ts","sourceRoot":"","sources":["../src/subscribeWithSchema.ts"],"names":[],"mappings":"AASA,OAAO,EAAa,eAAe,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAE9E,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,SAAS,EACT,QAAQ,EAAE,WAAW,EACrB,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,YAAY,GACb,EAAE,uBAAuB,GAAG,OAAO,CAClC,cAAc,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,eAAe,CAC9D,CA6BA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value;
|
|
10
|
+
var __objSpread = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
|
|
22
|
+
var __export = (target, all) => {
|
|
23
|
+
for (var name in all)
|
|
24
|
+
__defProp(target, name, {get: all[name], enumerable: true});
|
|
25
|
+
};
|
|
26
|
+
var __reExport = (target, module2, desc) => {
|
|
27
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
28
|
+
for (let key of __getOwnPropNames(module2))
|
|
29
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
30
|
+
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
var __toModule = (module2) => {
|
|
35
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
|
|
36
|
+
};
|
|
37
|
+
__markAsModule(exports);
|
|
38
|
+
__export(exports, {
|
|
39
|
+
subscribeWithSchema: () => subscribeWithSchema
|
|
40
|
+
});
|
|
41
|
+
var import_schema = __toModule(require("@graphql-tools/schema"));
|
|
42
|
+
var import_graphql = __toModule(require("graphql"));
|
|
43
|
+
var import_index = __toModule(require("./index"));
|
|
44
|
+
function subscribeWithSchema({
|
|
45
|
+
typeDefs,
|
|
46
|
+
resolvers,
|
|
47
|
+
document: rawDocument,
|
|
48
|
+
rootValue,
|
|
49
|
+
contextValue,
|
|
50
|
+
variableValues,
|
|
51
|
+
operationName,
|
|
52
|
+
fieldResolver,
|
|
53
|
+
typeResolver
|
|
54
|
+
}) {
|
|
55
|
+
const schema = (0, import_schema.makeExecutableSchema)({typeDefs, resolvers});
|
|
56
|
+
let extractedResolvers = {};
|
|
57
|
+
const getTypeByName = (name) => {
|
|
58
|
+
const type = import_index.specifiedScalars[name] || extractedResolvers[name];
|
|
59
|
+
if ((0, import_graphql.isInputType)(type)) {
|
|
60
|
+
return type;
|
|
61
|
+
} else {
|
|
62
|
+
throw new Error("Invalid type");
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
extractedResolvers = (0, import_index.extractImplicitTypes)(typeDefs, getTypeByName);
|
|
66
|
+
const fullResolvers = __objSpread(__objSpread({}, extractedResolvers), resolvers);
|
|
67
|
+
const document = (0, import_index.addTypesToRequestDocument)(schema, rawDocument);
|
|
68
|
+
return (0, import_index.subscribeWithoutSchema)({
|
|
69
|
+
document,
|
|
70
|
+
resolvers: fullResolvers,
|
|
71
|
+
rootValue,
|
|
72
|
+
contextValue,
|
|
73
|
+
variableValues,
|
|
74
|
+
operationName,
|
|
75
|
+
fieldResolver,
|
|
76
|
+
typeResolver
|
|
77
|
+
});
|
|
78
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value;
|
|
6
|
+
var __objSpread = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/subscribeWithSchema.ts
|
|
19
|
+
import {makeExecutableSchema} from "@graphql-tools/schema";
|
|
20
|
+
import {isInputType} from "graphql";
|
|
21
|
+
import {
|
|
22
|
+
addTypesToRequestDocument,
|
|
23
|
+
subscribeWithoutSchema,
|
|
24
|
+
extractImplicitTypes,
|
|
25
|
+
specifiedScalars
|
|
26
|
+
} from "./index.mjs";
|
|
27
|
+
function subscribeWithSchema({
|
|
28
|
+
typeDefs,
|
|
29
|
+
resolvers,
|
|
30
|
+
document: rawDocument,
|
|
31
|
+
rootValue,
|
|
32
|
+
contextValue,
|
|
33
|
+
variableValues,
|
|
34
|
+
operationName,
|
|
35
|
+
fieldResolver,
|
|
36
|
+
typeResolver
|
|
37
|
+
}) {
|
|
38
|
+
const schema = makeExecutableSchema({typeDefs, resolvers});
|
|
39
|
+
let extractedResolvers = {};
|
|
40
|
+
const getTypeByName = (name) => {
|
|
41
|
+
const type = specifiedScalars[name] || extractedResolvers[name];
|
|
42
|
+
if (isInputType(type)) {
|
|
43
|
+
return type;
|
|
44
|
+
} else {
|
|
45
|
+
throw new Error("Invalid type");
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
extractedResolvers = extractImplicitTypes(typeDefs, getTypeByName);
|
|
49
|
+
const fullResolvers = __objSpread(__objSpread({}, extractedResolvers), resolvers);
|
|
50
|
+
const document = addTypesToRequestDocument(schema, rawDocument);
|
|
51
|
+
return subscribeWithoutSchema({
|
|
52
|
+
document,
|
|
53
|
+
resolvers: fullResolvers,
|
|
54
|
+
rootValue,
|
|
55
|
+
contextValue,
|
|
56
|
+
variableValues,
|
|
57
|
+
operationName,
|
|
58
|
+
fieldResolver,
|
|
59
|
+
typeResolver
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
subscribeWithSchema
|
|
64
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Maybe } from "./jsutils/Maybe";
|
|
2
|
+
import { DocumentNode } from "./ast/TypedAST";
|
|
3
|
+
import { FunctionFieldResolver, ExecutionWithoutSchemaArgs, Resolvers, ExecutionResult } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Implements the "Subscribe" algorithm described in the GraphQL specification.
|
|
6
|
+
*
|
|
7
|
+
* Returns a Promise which resolves to either an AsyncIterator (if successful)
|
|
8
|
+
* or an ExecutionResult (error). The promise will be rejected if the schema or
|
|
9
|
+
* other arguments to this function are invalid, or if the resolved event stream
|
|
10
|
+
* is not an async iterable.
|
|
11
|
+
*
|
|
12
|
+
* If the client-provided arguments to this function do not result in a
|
|
13
|
+
* compliant subscription, a GraphQL Response (ExecutionResult) with
|
|
14
|
+
* descriptive errors and no data will be returned.
|
|
15
|
+
*
|
|
16
|
+
* If the source stream could not be created due to faulty subscription
|
|
17
|
+
* resolver logic or underlying systems, the promise will resolve to a single
|
|
18
|
+
* ExecutionResult containing `errors` and no `data`.
|
|
19
|
+
*
|
|
20
|
+
* If the operation succeeded, the promise resolves to an AsyncIterator, which
|
|
21
|
+
* yields a stream of ExecutionResults representing the response stream.
|
|
22
|
+
*
|
|
23
|
+
* Accepts either an object with named arguments, or individual arguments.
|
|
24
|
+
*/
|
|
25
|
+
export declare function subscribeWithoutSchema(args: ExecutionWithoutSchemaArgs): Promise<AsyncGenerator<ExecutionResult, void, void> | ExecutionResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Implements the "CreateSourceEventStream" algorithm described in the
|
|
28
|
+
* GraphQL specification, resolving the subscription source event stream.
|
|
29
|
+
*
|
|
30
|
+
* Returns a Promise which resolves to either an AsyncIterable (if successful)
|
|
31
|
+
* or an ExecutionResult (error). The promise will be rejected if the schema or
|
|
32
|
+
* other arguments to this function are invalid, or if the resolved event stream
|
|
33
|
+
* is not an async iterable.
|
|
34
|
+
*
|
|
35
|
+
* If the client-provided arguments to this function do not result in a
|
|
36
|
+
* compliant subscription, a GraphQL Response (ExecutionResult) with
|
|
37
|
+
* descriptive errors and no data will be returned.
|
|
38
|
+
*
|
|
39
|
+
* If the the source stream could not be created due to faulty subscription
|
|
40
|
+
* resolver logic or underlying systems, the promise will resolve to a single
|
|
41
|
+
* ExecutionResult containing `errors` and no `data`.
|
|
42
|
+
*
|
|
43
|
+
* If the operation succeeded, the promise resolves to the AsyncIterable for the
|
|
44
|
+
* event stream returned by the resolver.
|
|
45
|
+
*
|
|
46
|
+
* A Source Event Stream represents a sequence of events, each of which triggers
|
|
47
|
+
* a GraphQL execution for that event.
|
|
48
|
+
*
|
|
49
|
+
* This may be useful when hosting the stateful subscription service in a
|
|
50
|
+
* different process or machine than the stateless GraphQL execution engine,
|
|
51
|
+
* or otherwise separating these two steps. For more on this, see the
|
|
52
|
+
* "Supporting Subscriptions at Scale" information in the GraphQL specification.
|
|
53
|
+
*/
|
|
54
|
+
export declare function createSourceEventStream(resolvers: Resolvers, document: DocumentNode, rootValue?: unknown, contextValue?: unknown, variableValues?: Maybe<{
|
|
55
|
+
readonly [variable: string]: unknown;
|
|
56
|
+
}>, operationName?: Maybe<string>, fieldResolver?: Maybe<FunctionFieldResolver<any, any>>): Promise<AsyncIterable<unknown> | ExecutionResult>;
|
|
57
|
+
//# sourceMappingURL=subscribeWithoutSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribeWithoutSchema.d.ts","sourceRoot":"","sources":["../src/subscribeWithoutSchema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAQ7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAgB9C,OAAO,EAEL,qBAAqB,EACrB,0BAA0B,EAE1B,SAAS,EACT,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,cAAc,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,eAAe,CAAC,CA6CxE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,YAAY,EACtB,SAAS,CAAC,EAAE,OAAO,EACnB,YAAY,CAAC,EAAE,OAAO,EACtB,cAAc,CAAC,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC,EAChE,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,EAC7B,aAAa,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GACrD,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,CAyCnD"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, {get: all[name], enumerable: true});
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
16
|
+
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toModule = (module2) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
|
|
22
|
+
};
|
|
23
|
+
var __async = (__this, __arguments, generator) => {
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
var fulfilled = (value) => {
|
|
26
|
+
try {
|
|
27
|
+
step(generator.next(value));
|
|
28
|
+
} catch (e) {
|
|
29
|
+
reject(e);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var rejected = (value) => {
|
|
33
|
+
try {
|
|
34
|
+
step(generator.throw(value));
|
|
35
|
+
} catch (e) {
|
|
36
|
+
reject(e);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
40
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
__markAsModule(exports);
|
|
44
|
+
__export(exports, {
|
|
45
|
+
createSourceEventStream: () => createSourceEventStream,
|
|
46
|
+
subscribeWithoutSchema: () => subscribeWithoutSchema
|
|
47
|
+
});
|
|
48
|
+
var import_inspect = __toModule(require("./jsutils/inspect"));
|
|
49
|
+
var import_isAsyncIterable = __toModule(require("./jsutils/isAsyncIterable"));
|
|
50
|
+
var import_Path = __toModule(require("./jsutils/Path"));
|
|
51
|
+
var import_graphql = __toModule(require("graphql"));
|
|
52
|
+
var import_executeWithoutSchema = __toModule(require("./executeWithoutSchema"));
|
|
53
|
+
var import_collectFields = __toModule(require("./collectFields"));
|
|
54
|
+
var import_values = __toModule(require("./values"));
|
|
55
|
+
var import_typeNameFromAST = __toModule(require("./utilities/typeNameFromAST"));
|
|
56
|
+
var import_mapAsyncIterator = __toModule(require("./utilities/mapAsyncIterator"));
|
|
57
|
+
function subscribeWithoutSchema(args) {
|
|
58
|
+
return __async(this, null, function* () {
|
|
59
|
+
const {
|
|
60
|
+
resolvers,
|
|
61
|
+
document,
|
|
62
|
+
rootValue,
|
|
63
|
+
contextValue,
|
|
64
|
+
variableValues,
|
|
65
|
+
operationName,
|
|
66
|
+
fieldResolver,
|
|
67
|
+
subscribeFieldResolver
|
|
68
|
+
} = args;
|
|
69
|
+
const resultOrStream = yield createSourceEventStream(resolvers, document, rootValue, contextValue, variableValues, operationName, subscribeFieldResolver);
|
|
70
|
+
if (!(0, import_isAsyncIterable.isAsyncIterable)(resultOrStream)) {
|
|
71
|
+
return resultOrStream;
|
|
72
|
+
}
|
|
73
|
+
const mapSourceToResponse = (payload) => (0, import_executeWithoutSchema.executeWithoutSchema)({
|
|
74
|
+
resolvers,
|
|
75
|
+
document,
|
|
76
|
+
rootValue: payload,
|
|
77
|
+
contextValue,
|
|
78
|
+
variableValues,
|
|
79
|
+
operationName,
|
|
80
|
+
fieldResolver
|
|
81
|
+
});
|
|
82
|
+
return (0, import_mapAsyncIterator.mapAsyncIterator)(resultOrStream, mapSourceToResponse);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function createSourceEventStream(resolvers, document, rootValue, contextValue, variableValues, operationName, fieldResolver) {
|
|
86
|
+
return __async(this, null, function* () {
|
|
87
|
+
(0, import_executeWithoutSchema.assertValidExecutionArguments)(document, variableValues);
|
|
88
|
+
try {
|
|
89
|
+
const exeContext = (0, import_executeWithoutSchema.buildExecutionContext)(resolvers, document, rootValue, contextValue, variableValues, operationName, fieldResolver);
|
|
90
|
+
if (!("resolvers" in exeContext)) {
|
|
91
|
+
return {errors: exeContext};
|
|
92
|
+
}
|
|
93
|
+
const eventStream = yield executeSubscription(exeContext);
|
|
94
|
+
if (!(0, import_isAsyncIterable.isAsyncIterable)(eventStream)) {
|
|
95
|
+
throw new Error(`Subscription field must return Async Iterable. Received: ${(0, import_inspect.inspect)(eventStream)}.`);
|
|
96
|
+
}
|
|
97
|
+
return eventStream;
|
|
98
|
+
} catch (error) {
|
|
99
|
+
if (error instanceof import_graphql.GraphQLError) {
|
|
100
|
+
return {errors: [error]};
|
|
101
|
+
}
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function executeSubscription(exeContext) {
|
|
107
|
+
return __async(this, null, function* () {
|
|
108
|
+
const {
|
|
109
|
+
resolvers,
|
|
110
|
+
fragments,
|
|
111
|
+
operation,
|
|
112
|
+
variableValues,
|
|
113
|
+
rootValue
|
|
114
|
+
} = exeContext;
|
|
115
|
+
const typeName = (0, import_executeWithoutSchema.getOperationRootTypeName)(operation);
|
|
116
|
+
const fields = (0, import_collectFields.collectFields)(resolvers, fragments, variableValues, typeName, operation.selectionSet, new Map(), new Set());
|
|
117
|
+
const [responseName, fieldNodes] = [...fields.entries()][0];
|
|
118
|
+
const fieldName = fieldNodes[0].name.value;
|
|
119
|
+
let resolveFn;
|
|
120
|
+
let returnTypeName;
|
|
121
|
+
let returnTypeNode;
|
|
122
|
+
if (fieldName === "__typename" && !resolveFn) {
|
|
123
|
+
resolveFn = () => typeName;
|
|
124
|
+
returnTypeName = "String";
|
|
125
|
+
returnTypeNode = {
|
|
126
|
+
kind: import_graphql.Kind.NAMED_TYPE,
|
|
127
|
+
name: {
|
|
128
|
+
kind: import_graphql.Kind.NAME,
|
|
129
|
+
value: "String"
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
} else {
|
|
133
|
+
returnTypeNode = fieldNodes[0].__type;
|
|
134
|
+
returnTypeName = (0, import_typeNameFromAST.typeNameFromAST)(returnTypeNode);
|
|
135
|
+
const typeResolvers = exeContext.resolvers[typeName];
|
|
136
|
+
resolveFn = (typeResolvers == null ? void 0 : typeResolvers[fieldName]).subscribe;
|
|
137
|
+
}
|
|
138
|
+
if (!resolveFn) {
|
|
139
|
+
resolveFn = exeContext.fieldResolver;
|
|
140
|
+
}
|
|
141
|
+
const path = (0, import_Path.addPath)(void 0, responseName, typeName);
|
|
142
|
+
const info = (0, import_executeWithoutSchema.buildResolveInfo)(exeContext, fieldName, fieldNodes, typeName, returnTypeName, returnTypeNode, path);
|
|
143
|
+
try {
|
|
144
|
+
const args = (0, import_values.getArgumentValues)(resolvers, fieldNodes[0], variableValues);
|
|
145
|
+
const contextValue = exeContext.contextValue;
|
|
146
|
+
const eventStream = yield resolveFn(rootValue, args, contextValue, info);
|
|
147
|
+
if (eventStream instanceof Error) {
|
|
148
|
+
throw eventStream;
|
|
149
|
+
}
|
|
150
|
+
return eventStream;
|
|
151
|
+
} catch (error) {
|
|
152
|
+
throw (0, import_graphql.locatedError)(error, fieldNodes, (0, import_Path.pathToArray)(path));
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// src/subscribeWithoutSchema.ts
|
|
23
|
+
import {inspect} from "./jsutils/inspect.mjs";
|
|
24
|
+
import {isAsyncIterable} from "./jsutils/isAsyncIterable.mjs";
|
|
25
|
+
import {addPath, pathToArray} from "./jsutils/Path.mjs";
|
|
26
|
+
import {
|
|
27
|
+
GraphQLError,
|
|
28
|
+
locatedError,
|
|
29
|
+
Kind
|
|
30
|
+
} from "graphql";
|
|
31
|
+
import {
|
|
32
|
+
assertValidExecutionArguments,
|
|
33
|
+
buildExecutionContext,
|
|
34
|
+
buildResolveInfo,
|
|
35
|
+
executeWithoutSchema,
|
|
36
|
+
getOperationRootTypeName
|
|
37
|
+
} from "./executeWithoutSchema.mjs";
|
|
38
|
+
import {collectFields} from "./collectFields.mjs";
|
|
39
|
+
import {getArgumentValues} from "./values.mjs";
|
|
40
|
+
import {typeNameFromAST} from "./utilities/typeNameFromAST.mjs";
|
|
41
|
+
import {mapAsyncIterator} from "./utilities/mapAsyncIterator.mjs";
|
|
42
|
+
function subscribeWithoutSchema(args) {
|
|
43
|
+
return __async(this, null, function* () {
|
|
44
|
+
const {
|
|
45
|
+
resolvers,
|
|
46
|
+
document,
|
|
47
|
+
rootValue,
|
|
48
|
+
contextValue,
|
|
49
|
+
variableValues,
|
|
50
|
+
operationName,
|
|
51
|
+
fieldResolver,
|
|
52
|
+
subscribeFieldResolver
|
|
53
|
+
} = args;
|
|
54
|
+
const resultOrStream = yield createSourceEventStream(resolvers, document, rootValue, contextValue, variableValues, operationName, subscribeFieldResolver);
|
|
55
|
+
if (!isAsyncIterable(resultOrStream)) {
|
|
56
|
+
return resultOrStream;
|
|
57
|
+
}
|
|
58
|
+
const mapSourceToResponse = (payload) => executeWithoutSchema({
|
|
59
|
+
resolvers,
|
|
60
|
+
document,
|
|
61
|
+
rootValue: payload,
|
|
62
|
+
contextValue,
|
|
63
|
+
variableValues,
|
|
64
|
+
operationName,
|
|
65
|
+
fieldResolver
|
|
66
|
+
});
|
|
67
|
+
return mapAsyncIterator(resultOrStream, mapSourceToResponse);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function createSourceEventStream(resolvers, document, rootValue, contextValue, variableValues, operationName, fieldResolver) {
|
|
71
|
+
return __async(this, null, function* () {
|
|
72
|
+
assertValidExecutionArguments(document, variableValues);
|
|
73
|
+
try {
|
|
74
|
+
const exeContext = buildExecutionContext(resolvers, document, rootValue, contextValue, variableValues, operationName, fieldResolver);
|
|
75
|
+
if (!("resolvers" in exeContext)) {
|
|
76
|
+
return {errors: exeContext};
|
|
77
|
+
}
|
|
78
|
+
const eventStream = yield executeSubscription(exeContext);
|
|
79
|
+
if (!isAsyncIterable(eventStream)) {
|
|
80
|
+
throw new Error(`Subscription field must return Async Iterable. Received: ${inspect(eventStream)}.`);
|
|
81
|
+
}
|
|
82
|
+
return eventStream;
|
|
83
|
+
} catch (error) {
|
|
84
|
+
if (error instanceof GraphQLError) {
|
|
85
|
+
return {errors: [error]};
|
|
86
|
+
}
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function executeSubscription(exeContext) {
|
|
92
|
+
return __async(this, null, function* () {
|
|
93
|
+
const {
|
|
94
|
+
resolvers,
|
|
95
|
+
fragments,
|
|
96
|
+
operation,
|
|
97
|
+
variableValues,
|
|
98
|
+
rootValue
|
|
99
|
+
} = exeContext;
|
|
100
|
+
const typeName = getOperationRootTypeName(operation);
|
|
101
|
+
const fields = collectFields(resolvers, fragments, variableValues, typeName, operation.selectionSet, new Map(), new Set());
|
|
102
|
+
const [responseName, fieldNodes] = [...fields.entries()][0];
|
|
103
|
+
const fieldName = fieldNodes[0].name.value;
|
|
104
|
+
let resolveFn;
|
|
105
|
+
let returnTypeName;
|
|
106
|
+
let returnTypeNode;
|
|
107
|
+
if (fieldName === "__typename" && !resolveFn) {
|
|
108
|
+
resolveFn = () => typeName;
|
|
109
|
+
returnTypeName = "String";
|
|
110
|
+
returnTypeNode = {
|
|
111
|
+
kind: Kind.NAMED_TYPE,
|
|
112
|
+
name: {
|
|
113
|
+
kind: Kind.NAME,
|
|
114
|
+
value: "String"
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
} else {
|
|
118
|
+
returnTypeNode = fieldNodes[0].__type;
|
|
119
|
+
returnTypeName = typeNameFromAST(returnTypeNode);
|
|
120
|
+
const typeResolvers = exeContext.resolvers[typeName];
|
|
121
|
+
resolveFn = (typeResolvers == null ? void 0 : typeResolvers[fieldName]).subscribe;
|
|
122
|
+
}
|
|
123
|
+
if (!resolveFn) {
|
|
124
|
+
resolveFn = exeContext.fieldResolver;
|
|
125
|
+
}
|
|
126
|
+
const path = addPath(void 0, responseName, typeName);
|
|
127
|
+
const info = buildResolveInfo(exeContext, fieldName, fieldNodes, typeName, returnTypeName, returnTypeNode, path);
|
|
128
|
+
try {
|
|
129
|
+
const args = getArgumentValues(resolvers, fieldNodes[0], variableValues);
|
|
130
|
+
const contextValue = exeContext.contextValue;
|
|
131
|
+
const eventStream = yield resolveFn(rootValue, args, contextValue, info);
|
|
132
|
+
if (eventStream instanceof Error) {
|
|
133
|
+
throw eventStream;
|
|
134
|
+
}
|
|
135
|
+
return eventStream;
|
|
136
|
+
} catch (error) {
|
|
137
|
+
throw locatedError(error, fieldNodes, pathToArray(path));
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
export {
|
|
142
|
+
createSourceEventStream,
|
|
143
|
+
subscribeWithoutSchema
|
|
144
|
+
};
|
package/lib/types.d.ts
CHANGED
|
@@ -6,7 +6,11 @@ import { ObjMap } from "./jsutils/ObjMap";
|
|
|
6
6
|
import { Path } from "./jsutils/Path";
|
|
7
7
|
export declare type ScalarTypeResolver = GraphQLScalarType;
|
|
8
8
|
export declare type EnumTypeResolver = GraphQLEnumType;
|
|
9
|
-
export declare type
|
|
9
|
+
export declare type FunctionFieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: ResolveInfo) => TReturn;
|
|
10
|
+
export declare type FieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = FunctionFieldResolver<TSource, TContext, TArgs, TReturn> | {
|
|
11
|
+
subscribe?: FunctionFieldResolver<TSource, TContext, TArgs, TReturn>;
|
|
12
|
+
resolve?: FunctionFieldResolver<TSource, TContext, TArgs, TReturn>;
|
|
13
|
+
};
|
|
10
14
|
export declare type TypeResolver<TSource, TContext> = (value: TSource, context: TContext, info: ResolveInfo) => PromiseOrValue<Maybe<string>>;
|
|
11
15
|
export declare type ObjectTypeResolver<TSource = any, TContext = any, TArgs = any> = {
|
|
12
16
|
[key: string]: FieldResolver<TSource, TContext, TArgs>;
|
|
@@ -61,8 +65,9 @@ export interface CommonExecutionArgs {
|
|
|
61
65
|
[variable: string]: unknown;
|
|
62
66
|
}>;
|
|
63
67
|
operationName?: Maybe<string>;
|
|
64
|
-
fieldResolver?: Maybe<
|
|
68
|
+
fieldResolver?: Maybe<FunctionFieldResolver<any, any>>;
|
|
65
69
|
typeResolver?: Maybe<TypeResolver<any, any>>;
|
|
70
|
+
subscribeFieldResolver?: Maybe<FunctionFieldResolver<any, any>>;
|
|
66
71
|
}
|
|
67
72
|
export declare type ExecutionWithoutSchemaArgs = CommonExecutionArgs & {
|
|
68
73
|
document: DocumentNode;
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EAEjB,YAAY,IAAI,mBAAmB,EACpC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,uBAAuB,EACvB,QAAQ,EACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,oBAAY,kBAAkB,GAAG,iBAAiB,CAAC;AACnD,oBAAY,gBAAgB,GAAG,eAAe,CAAC;AAC/C,oBAAY,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EAEjB,YAAY,IAAI,mBAAmB,EACpC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,uBAAuB,EACvB,QAAQ,EACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,oBAAY,kBAAkB,GAAG,iBAAiB,CAAC;AACnD,oBAAY,gBAAgB,GAAG,eAAe,CAAC;AAC/C,oBAAY,qBAAqB,CAC/B,OAAO,EACP,QAAQ,EACR,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,OAAO,GAAG,GAAG,IACX,CACF,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,EACX,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,WAAW,KACd,OAAO,CAAC;AAEb,oBAAY,aAAa,CACvB,OAAO,EACP,QAAQ,EACR,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,OAAO,GAAG,GAAG,IAEX,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,GACxD;IACE,SAAS,CAAC,EAAE,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACrE,OAAO,CAAC,EAAE,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;CACpE,CAAC;AAEN,oBAAY,YAAY,CAAC,OAAO,EAAE,QAAQ,IAAI,CAC5C,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,WAAW,KACd,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAEnC,oBAAY,kBAAkB,CAAC,OAAO,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI;IAC3E,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;CACxD,CAAC;AACF,oBAAY,qBAAqB,CAC/B,OAAO,GAAG,GAAG,EACb,QAAQ,GAAG,GAAG,EACd,KAAK,GAAG,GAAG,IACT;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;CACxD,GAAG;IACF,aAAa,CAAC,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CACxC,CAAC;AACF,oBAAY,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CACxC,CAAC;AACF,oBAAY,uBAAuB,GAAG,sBAAsB,CAAC;AAE7D,oBAAY,QAAQ,CAAC,OAAO,EAAE,QAAQ,IAClC,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,GACrC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,GACxC,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,uBAAuB,CAAC;AAE5B,oBAAY,SAAS,CAAC,OAAO,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG,IAAI,MAAM,CAC3D,MAAM,EACN,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAC5B,CAAC;AACF,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,QAAQ,CAAC;IAGzB,IAAI,EAAE,IAAI,CAAC;IAEX,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,uBAAuB,CAAC;IACnC,cAAc,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACjD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe,CAC9B,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAE7B,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,wBAAwB,CACvC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAE7B,MAAM,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACtC,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,KAAK,CAAC;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IACxD,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,aAAa,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAC7C,sBAAsB,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;CACjE;AACD,oBAAY,0BAA0B,GAAG,mBAAmB,GAAG;IAC7D,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF,oBAAY,uBAAuB,GAAG,mBAAmB,GAAG;IAC1D,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,QAAQ,EAAE,mBAAmB,CAAC;CAC/B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PromiseOrValue } from "../jsutils/PromiseOrValue";
|
|
2
|
+
/**
|
|
3
|
+
* Given an AsyncIterable and a callback function, return an AsyncIterator
|
|
4
|
+
* which produces values mapped via calling the callback function.
|
|
5
|
+
*/
|
|
6
|
+
export declare function mapAsyncIterator<T, U, R = undefined>(iterable: AsyncGenerator<T, R, void> | AsyncIterable<T>, callback: (value: T) => PromiseOrValue<U>): AsyncGenerator<U, R, void>;
|
|
7
|
+
//# sourceMappingURL=mapAsyncIterator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapAsyncIterator.d.ts","sourceRoot":"","sources":["../../src/utilities/mapAsyncIterator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,SAAS,EAClD,QAAQ,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EACvD,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,GACxC,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CA4C5B"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, {get: all[name], enumerable: true});
|
|
6
|
+
};
|
|
7
|
+
var __async = (__this, __arguments, generator) => {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
var fulfilled = (value) => {
|
|
10
|
+
try {
|
|
11
|
+
step(generator.next(value));
|
|
12
|
+
} catch (e) {
|
|
13
|
+
reject(e);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var rejected = (value) => {
|
|
17
|
+
try {
|
|
18
|
+
step(generator.throw(value));
|
|
19
|
+
} catch (e) {
|
|
20
|
+
reject(e);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
24
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
__markAsModule(exports);
|
|
28
|
+
__export(exports, {
|
|
29
|
+
mapAsyncIterator: () => mapAsyncIterator
|
|
30
|
+
});
|
|
31
|
+
function mapAsyncIterator(iterable, callback) {
|
|
32
|
+
const iterator = iterable[Symbol.asyncIterator]();
|
|
33
|
+
function mapResult(result) {
|
|
34
|
+
return __async(this, null, function* () {
|
|
35
|
+
if (result.done) {
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
return {value: yield callback(result.value), done: false};
|
|
40
|
+
} catch (error) {
|
|
41
|
+
if (typeof iterator.return === "function") {
|
|
42
|
+
try {
|
|
43
|
+
yield iterator.return();
|
|
44
|
+
} catch (_e) {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
next() {
|
|
53
|
+
return __async(this, null, function* () {
|
|
54
|
+
return mapResult(yield iterator.next());
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
return() {
|
|
58
|
+
return __async(this, null, function* () {
|
|
59
|
+
return typeof iterator.return === "function" ? mapResult(yield iterator.return()) : {value: void 0, done: true};
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
throw(error) {
|
|
63
|
+
return __async(this, null, function* () {
|
|
64
|
+
return typeof iterator.throw === "function" ? mapResult(yield iterator.throw(error)) : Promise.reject(error);
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
[Symbol.asyncIterator]() {
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// src/utilities/mapAsyncIterator.ts
|
|
23
|
+
function mapAsyncIterator(iterable, callback) {
|
|
24
|
+
const iterator = iterable[Symbol.asyncIterator]();
|
|
25
|
+
function mapResult(result) {
|
|
26
|
+
return __async(this, null, function* () {
|
|
27
|
+
if (result.done) {
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
return {value: yield callback(result.value), done: false};
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (typeof iterator.return === "function") {
|
|
34
|
+
try {
|
|
35
|
+
yield iterator.return();
|
|
36
|
+
} catch (_e) {
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
next() {
|
|
45
|
+
return __async(this, null, function* () {
|
|
46
|
+
return mapResult(yield iterator.next());
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
return() {
|
|
50
|
+
return __async(this, null, function* () {
|
|
51
|
+
return typeof iterator.return === "function" ? mapResult(yield iterator.return()) : {value: void 0, done: true};
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
throw(error) {
|
|
55
|
+
return __async(this, null, function* () {
|
|
56
|
+
return typeof iterator.throw === "function" ? mapResult(yield iterator.throw(error)) : Promise.reject(error);
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
[Symbol.asyncIterator]() {
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
mapAsyncIterator
|
|
66
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphitation/supermassive",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"supermassive": "./bin/supermassive.js"
|
|
7
7
|
},
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"@types/node-json-db": "^0.9.3",
|
|
28
28
|
"benchmark": "^2.1.4",
|
|
29
29
|
"graphql-jit": "^0.5.1",
|
|
30
|
+
"iterall": "^1.3.0",
|
|
30
31
|
"monorepo-scripts": "*",
|
|
31
32
|
"node-json-db": "^1.3.0",
|
|
32
33
|
"ts-node": "^10.0.0"
|