Skip to content

Commit 7c22bce

Browse files
brabejileebyron
authored andcommitted
Fix docs on return type of execute (graphql#439)
API Reference incorrectly states that return type of `execute` is always a `Promise`
1 parent 87cc061 commit 7c22bce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

site/graphql-js/APIReference-Execution.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export function execute(
3838
contextValue?: mixed,
3939
variableValues?: ?{[key: string]: mixed},
4040
operationName?: ?string
41-
): Promise<ExecutionResult>
41+
): MaybePromise<ExecutionResult>
42+
43+
type MaybePromise<T> = Promise<T> | T;
4244

4345
type ExecutionResult = {
4446
data: ?Object;

0 commit comments

Comments
 (0)