Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 9d261b4

Browse files
felixputeraIvanGoncharov
authored andcommitted
Fix customExecuteFn return type
customExecuteFn returns ExecutionResult | Promise<ExecutionResult> similar to graphql.execute
1 parent 44d37d4 commit 9d261b4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ export type OptionsData = {|
8888
* An optional function which will be used to execute instead of default `execute`
8989
* from `graphql-js`.
9090
*/
91-
customExecuteFn?: ?(args: ExecutionArgs) => Promise<ExecutionResult>,
91+
customExecuteFn?: ?(
92+
args: ExecutionArgs,
93+
) => ExecutionResult | Promise<ExecutionResult>,
9294

9395
/**
9496
* An optional function which will be used to format any errors produced by

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ declare namespace graphqlHTTP {
8585
* from `graphql-js`.
8686
*/
8787
customExecuteFn?:
88-
| ((args: ExecutionArgs) => Promise<ExecutionResult>)
88+
| ((args: ExecutionArgs) => ExecutionResult | Promise<ExecutionResult>)
8989
| null;
9090

9191
/**

0 commit comments

Comments
 (0)