-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(execution): add max coercion errors option to execution context #4366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
531c6a2
610c76a
e6789ef
0231740
7911bc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,16 +29,20 @@ const { execute } = require('graphql'); // CommonJS | |
| ### execute | ||
|
|
||
| ```ts | ||
| export function execute( | ||
| export function execute({ | ||
| schema: GraphQLSchema, | ||
| documentAST: Document, | ||
| rootValue?: mixed, | ||
| contextValue?: mixed, | ||
| document: DocumentNode, | ||
| rootValue?: unknown, | ||
| contextValue?: unknown, | ||
| variableValues?: { [key: string]: mixed }, | ||
| operationName?: string, | ||
| ): MaybePromise<ExecutionResult>; | ||
| fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>; | ||
| typeResolver?: Maybe<GraphQLTypeResolver<any, any>>; | ||
| subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>; | ||
| options?: { maxCoercionErrors?: number }; | ||
| }): PromiseOrValue<ExecutionResult>; | ||
|
|
||
| type MaybePromise<T> = Promise<T> | T; | ||
| type PromiseOrValue<T> = Promise<T> | T; | ||
|
|
||
| interface ExecutionResult< | ||
| TData = ObjMap<unknown>, | ||
|
|
@@ -61,21 +65,32 @@ a GraphQLError will be thrown immediately explaining the invalid input. | |
| executing the query, `errors` is null if no errors occurred, and is a | ||
| non-empty array if an error occurred. | ||
|
|
||
| #### options | ||
|
|
||
| ##### maxCoercionErrors | ||
|
|
||
| Set the maximum number of errors allowed for coercing (defaults to 50). | ||
|
||
|
|
||
| ### executeSync | ||
|
|
||
| ```ts | ||
| export function executeSync( | ||
| export function executeSync({ | ||
| schema: GraphQLSchema, | ||
| documentAST: Document, | ||
| rootValue?: mixed, | ||
| contextValue?: mixed, | ||
| document: DocumentNode, | ||
| rootValue?: unknown, | ||
| contextValue?: unknown, | ||
| variableValues?: { [key: string]: mixed }, | ||
| operationName?: string, | ||
| ): ExecutionResult; | ||
| fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>; | ||
| typeResolver?: Maybe<GraphQLTypeResolver<any, any>>; | ||
| subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>; | ||
| options?: { maxCoercionErrors?: number }; | ||
| }): ExecutionResult; | ||
|
|
||
| type ExecutionResult = { | ||
| data: Object; | ||
| errors?: GraphQLError[]; | ||
| errors?: ReadonlyArray<GraphQLError>; | ||
| data?: TData | null; | ||
| extensions?: TExtensions; | ||
| }; | ||
| ``` | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this object syntax wasn't intended