@graphql-tools/executor
Advanced tools
Comparing version 0.0.1-alpha-20221027112615-deb575af to 0.0.1-alpha-20221027113606-f6e39ea8
{ | ||
"name": "@graphql-tools/executor", | ||
"version": "0.0.1-alpha-20221027112615-deb575af", | ||
"version": "0.0.1-alpha-20221027113606-f6e39ea8", | ||
"sideEffects": false, | ||
@@ -9,3 +9,3 @@ "peerDependencies": { | ||
"dependencies": { | ||
"@graphql-tools/utils": "8.13.0-alpha-20221027112615-deb575af", | ||
"@graphql-tools/utils": "8.13.0-alpha-20221027113606-f6e39ea8", | ||
"@graphql-typed-document-node/core": "3.1.1" | ||
@@ -12,0 +12,0 @@ }, |
import { GraphQLFormattedError, GraphQLError, FieldNode, FragmentDefinitionNode, OperationDefinitionNode, GraphQLField, GraphQLFieldResolver, GraphQLObjectType, GraphQLResolveInfo, GraphQLTypeResolver, GraphQLSchema } from 'graphql'; | ||
import { Maybe, Path, MaybePromise } from '@graphql-tools/utils'; | ||
import { Maybe, Path, MaybePromise, ExecutionResult } from '@graphql-tools/utils'; | ||
import { TypedDocumentNode } from '@graphql-typed-document-node/core'; | ||
@@ -29,7 +29,7 @@ /** | ||
*/ | ||
export interface ExecutionContext { | ||
export interface ExecutionContext<TContext = any> { | ||
schema: GraphQLSchema; | ||
fragments: Record<string, FragmentDefinitionNode>; | ||
rootValue: unknown; | ||
contextValue: unknown; | ||
contextValue: TContext; | ||
operation: OperationDefinitionNode; | ||
@@ -39,20 +39,8 @@ variableValues: { | ||
}; | ||
fieldResolver: GraphQLFieldResolver<any, any>; | ||
typeResolver: GraphQLTypeResolver<any, any>; | ||
subscribeFieldResolver: GraphQLFieldResolver<any, any>; | ||
fieldResolver: GraphQLFieldResolver<any, TContext>; | ||
typeResolver: GraphQLTypeResolver<any, TContext>; | ||
subscribeFieldResolver: GraphQLFieldResolver<any, TContext>; | ||
errors: Array<GraphQLError>; | ||
} | ||
/** | ||
* The result of GraphQL execution. | ||
* | ||
* - `errors` is included when any errors occurred as a non-empty array. | ||
* - `data` is the result of a successful execution of the query. | ||
* - `extensions` is reserved for adding non-standard properties. | ||
*/ | ||
export interface ExecutionResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> { | ||
errors?: ReadonlyArray<GraphQLError>; | ||
data?: TData | null; | ||
extensions?: TExtensions; | ||
} | ||
export interface FormattedExecutionResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> { | ||
export interface FormattedExecutionResult<TData = any, TExtensions = any> { | ||
errors?: ReadonlyArray<GraphQLFormattedError>; | ||
@@ -62,7 +50,3 @@ data?: TData | null; | ||
} | ||
export interface ExecutionArgs<TData = { | ||
[key: string]: any; | ||
}, TVariables = { | ||
[key: string]: any; | ||
}, TContext = any> { | ||
export interface ExecutionArgs<TData = any, TVariables = any, TContext = any> { | ||
schema: GraphQLSchema; | ||
@@ -88,3 +72,7 @@ document: TypedDocumentNode<TData, TVariables>; | ||
*/ | ||
export declare function execute(args: ExecutionArgs): MaybePromise<ExecutionResult>; | ||
export declare function execute<TData = { | ||
[key: string]: any; | ||
}, TVariables = { | ||
[key: string]: any; | ||
}, TContext = any>(args: ExecutionArgs<TData, TVariables, TContext>): MaybePromise<ExecutionResult<TData>>; | ||
/** | ||
@@ -91,0 +79,0 @@ * Also implements the "Executing requests" section of the GraphQL specification. |
import { GraphQLFieldResolver, GraphQLSchema } from 'graphql'; | ||
import { Maybe } from '@graphql-tools/utils'; | ||
import type { ExecutionArgs, ExecutionResult } from './execute.js'; | ||
import { Maybe, ExecutionResult } from '@graphql-tools/utils'; | ||
import type { ExecutionArgs } from './execute.js'; | ||
import { TypedDocumentNode } from '@graphql-typed-document-node/core'; | ||
@@ -5,0 +5,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
122982
2291
+ Added@graphql-tools/utils@8.13.0-alpha-20221027113606-f6e39ea8(transitive)
- Removed@graphql-tools/utils@8.13.0-alpha-20221027112615-deb575af(transitive)
Updated@graphql-tools/utils@8.13.0-alpha-20221027113606-f6e39ea8