@envelop/types
Advanced tools
Comparing version 1.2.0 to 1.3.0-alpha-9e83229.0
import { DefaultContext, OnExecuteDoneEventPayload, OnExecuteDoneHookResult, OnExecuteDoneHookResultOnNextHook } from '@envelop/core'; | ||
import { ExecutionResult } from 'graphql'; | ||
/** | ||
@@ -9,3 +8,3 @@ * Returns true if the provided object implements the AsyncIterator protocol via | ||
*/ | ||
export declare function isAsyncIterable(maybeAsyncIterable: any): maybeAsyncIterable is AsyncIterableIterator<ExecutionResult>; | ||
export declare function isAsyncIterable<T = any>(maybeAsyncIterable: any): maybeAsyncIterable is AsyncIterable<T>; | ||
/** | ||
@@ -12,0 +11,0 @@ * A utility function for hanlding `onExecuteDone` hook result, for simplifying the hanlding of AsyncIterable returned from `execute`. |
import { Plugin } from './plugin'; | ||
import { GraphQLSchema } from 'graphql'; | ||
import { PromiseOrValue } from 'graphql/jsutils/PromiseOrValue'; | ||
import { ExecuteFunction, ParseFunction, SubscribeFunction, ValidateFunction } from './graphql'; | ||
import { ArbitraryObject, Spread } from './utils'; | ||
import { ArbitraryObject, Spread, PromiseOrValue } from './utils'; | ||
export { ArbitraryObject } from './utils'; | ||
@@ -7,0 +6,0 @@ export declare type EnvelopContextFnWrapper<TFunction extends Function, ContextType = unknown> = (context: ContextType) => TFunction; |
@@ -1,2 +0,2 @@ | ||
import type { DocumentNode, GraphQLFieldResolver, GraphQLSchema, SubscriptionArgs, ExecutionArgs, GraphQLTypeResolver, subscribe, execute, parse, validate } from 'graphql'; | ||
import type { DocumentNode, GraphQLFieldResolver, GraphQLSchema, SubscriptionArgs, ExecutionArgs, GraphQLTypeResolver, subscribe, execute, parse, validate, GraphQLResolveInfo } from 'graphql'; | ||
import type { Maybe } from './utils'; | ||
@@ -53,1 +53,2 @@ /** @private */ | ||
}; | ||
export declare type Path = GraphQLResolveInfo['path']; |
import type { DocumentNode, ExecutionArgs, ExecutionResult, GraphQLError, GraphQLResolveInfo, GraphQLSchema, ParseOptions, Source, SubscriptionArgs, ValidationRule } from 'graphql'; | ||
import { Maybe } from 'graphql/jsutils/Maybe'; | ||
import { PromiseOrValue } from 'graphql/jsutils/PromiseOrValue'; | ||
import { Maybe, PromiseOrValue } from './utils'; | ||
import { DefaultContext } from './context-types'; | ||
import { AsyncIterableIteratorOrValue, ExecuteFunction, ParseFunction, ValidateFunction, ValidateFunctionParameter } from '@envelop/core'; | ||
import { ExecuteFunction, ParseFunction, ValidateFunction, ValidateFunctionParameter } from '@envelop/core'; | ||
import { SubscribeFunction } from './graphql'; | ||
@@ -320,7 +319,7 @@ import { Plugin } from './plugin'; | ||
*/ | ||
result: AsyncIterableIteratorOrValue<ExecutionResult>; | ||
result: AsyncIterableIterator<ExecutionResult> | ExecutionResult; | ||
/** | ||
* Replace the execution result with a new execution result. | ||
*/ | ||
setResult: (newResult: AsyncIterableIteratorOrValue<ExecutionResult>) => void; | ||
setResult: (newResult: AsyncIterableIterator<ExecutionResult> | ExecutionResult) => void; | ||
}; | ||
@@ -327,0 +326,0 @@ /** |
@@ -12,3 +12,5 @@ 'use strict'; | ||
function isAsyncIterable(maybeAsyncIterable) { | ||
return typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 ? void 0 : maybeAsyncIterable[Symbol.asyncIterator]) === 'function'; | ||
return (maybeAsyncIterable != null && | ||
typeof maybeAsyncIterable === 'object' && | ||
typeof maybeAsyncIterable[Symbol.asyncIterator] === 'function'); | ||
} | ||
@@ -15,0 +17,0 @@ /** |
{ | ||
"name": "@envelop/types", | ||
"version": "1.2.0", | ||
"version": "1.3.0-alpha-9e83229.0", | ||
"sideEffects": false, | ||
"peerDependencies": { | ||
"graphql": "^14.0.0 || ^15.0.0" | ||
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" | ||
}, | ||
@@ -8,0 +8,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
680
27104
2