Skip to content

Commit 85bfd13

Browse files
IvanGoncharovleebyron
authored andcommitted
Export "ExecutionArgs" type (#988)
1 parent 26023b3 commit 85bfd13

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

src/execution/execute.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ export type ExecutionResult = {
105105
data?: ?{[key: string]: mixed};
106106
};
107107

108+
export type ExecutionArgs = {|
109+
schema: GraphQLSchema,
110+
document: DocumentNode,
111+
rootValue?: mixed,
112+
contextValue?: mixed,
113+
variableValues?: ?{[key: string]: mixed},
114+
operationName?: ?string,
115+
fieldResolver?: ?GraphQLFieldResolver<any, any>
116+
|};
117+
108118
/**
109119
* Implements the "Evaluating requests" section of the GraphQL specification.
110120
*
@@ -115,15 +125,10 @@ export type ExecutionResult = {
115125
*
116126
* Accepts either an object with named arguments, or individual arguments.
117127
*/
118-
declare function execute({|
119-
schema: GraphQLSchema,
120-
document: DocumentNode,
121-
rootValue?: mixed,
122-
contextValue?: mixed,
123-
variableValues?: ?{[key: string]: mixed},
124-
operationName?: ?string,
125-
fieldResolver?: ?GraphQLFieldResolver<any, any>
126-
|}, ..._: []): Promise<ExecutionResult>;
128+
declare function execute(
129+
ExecutionArgs,
130+
..._: []
131+
): Promise<ExecutionResult>;
127132
/* eslint-disable no-redeclare */
128133
declare function execute(
129134
schema: GraphQLSchema,

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ export {
241241
} from './execution';
242242

243243
export type {
244+
ExecutionArgs,
244245
ExecutionResult,
245246
} from './execution';
246247

0 commit comments

Comments
 (0)