@n1ru4l/in-memory-live-query-store
Advanced tools
Comparing version 0.8.0-alpha-e2bf954.0 to 0.8.0
import { visit, visitWithTypeInfo, isNonNullType, isScalarType, execute, getOperationAST, GraphQLError, defaultFieldResolver, TypeInfo } from 'graphql'; | ||
import { mapSchema, MapperKind } from '@graphql-tools/utils'; | ||
import { makePushPullAsyncIterableIterator } from '@n1ru4l/push-pull-async-iterable-iterator'; | ||
import { makePushPullAsyncIterableIterator, isAsyncIterable } from '@n1ru4l/push-pull-async-iterable-iterator'; | ||
import { getLiveDirectiveNode, getLiveDirectiveArgumentValues } from '@n1ru4l/graphql-live-query'; | ||
@@ -299,2 +299,3 @@ import { getArgumentValues } from 'graphql/execution/values.js'; | ||
...additionalArguments, | ||
// TODO: remove this type-cast once GraphQL.js 16-defer-stream with fixed return type got released | ||
}); | ||
@@ -304,4 +305,4 @@ // result cannot be a AsyncIterableIterator if the `NoLiveMixedWithDeferStreamRule` was used. | ||
const handleAsyncIterator = (iterator) => { | ||
var _a, _b; | ||
(_b = (_a = iterator[Symbol.asyncIterator]()).return) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
var _a; | ||
(_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator); | ||
record.pushValue({ | ||
@@ -319,7 +320,2 @@ errors: [ | ||
}; | ||
const isAsyncIterable = (value) => { | ||
return (typeof value === "object" && | ||
value !== null && | ||
Symbol.asyncIterator in value); | ||
}; | ||
runWith(result, (result) => { | ||
@@ -326,0 +322,0 @@ if (isAsyncIterable(result)) { |
12
index.js
@@ -303,2 +303,3 @@ 'use strict'; | ||
...additionalArguments, | ||
// TODO: remove this type-cast once GraphQL.js 16-defer-stream with fixed return type got released | ||
}); | ||
@@ -308,4 +309,4 @@ // result cannot be a AsyncIterableIterator if the `NoLiveMixedWithDeferStreamRule` was used. | ||
const handleAsyncIterator = (iterator) => { | ||
var _a, _b; | ||
(_b = (_a = iterator[Symbol.asyncIterator]()).return) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
var _a; | ||
(_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator); | ||
record.pushValue({ | ||
@@ -323,9 +324,4 @@ errors: [ | ||
}; | ||
const isAsyncIterable = (value) => { | ||
return (typeof value === "object" && | ||
value !== null && | ||
Symbol.asyncIterator in value); | ||
}; | ||
runWith(result, (result) => { | ||
if (isAsyncIterable(result)) { | ||
if (pushPullAsyncIterableIterator.isAsyncIterable(result)) { | ||
handleAsyncIterator(result); | ||
@@ -332,0 +328,0 @@ return; |
{ | ||
"name": "@n1ru4l/in-memory-live-query-store", | ||
"version": "0.8.0-alpha-e2bf954.0", | ||
"version": "0.8.0", | ||
"peerDependencies": { | ||
@@ -9,3 +9,3 @@ "graphql": "^15.4.0 || ^16.0.0" | ||
"@graphql-tools/utils": "^8.5.2", | ||
"@n1ru4l/graphql-live-query": "0.9.0-alpha-e2bf954.0", | ||
"@n1ru4l/graphql-live-query": "0.9.0", | ||
"@n1ru4l/push-pull-async-iterable-iterator": "^3.0.0" | ||
@@ -12,0 +12,0 @@ }, |
49311
926
+ Added@n1ru4l/graphql-live-query@0.9.0(transitive)
- Removed@n1ru4l/graphql-live-query@0.9.0-alpha-e2bf954.0(transitive)