Skip to content

Commit 82a0c33

Browse files
execute: Convert ExecutionResult to be an exact object (#2232)
1 parent 9663938 commit 82a0c33

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/execution/execute.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,10 @@ export type ExecutionContext = {|
111111
* - `errors` is included when any errors occurred as a non-empty array.
112112
* - `data` is the result of a successful execution of the query.
113113
*/
114-
export type ExecutionResult = {
114+
export type ExecutionResult = {|
115115
errors?: $ReadOnlyArray<GraphQLError>,
116116
data?: ObjMap<mixed> | null,
117-
...
118-
};
117+
|};
119118

120119
export type ExecutionArgs = {|
121120
schema: GraphQLSchema,
@@ -181,7 +180,7 @@ export function execute(
181180
});
182181
}
183182

184-
function executeImpl(args: ExecutionArgs): ExecutionResult {
183+
function executeImpl(args: ExecutionArgs): PromiseOrValue<ExecutionResult> {
185184
const {
186185
schema,
187186
document,
@@ -232,7 +231,7 @@ function executeImpl(args: ExecutionArgs): ExecutionResult {
232231
function buildResponse(
233232
exeContext: ExecutionContext,
234233
data: PromiseOrValue<ObjMap<mixed> | null>,
235-
): ExecutionResult {
234+
): PromiseOrValue<ExecutionResult> {
236235
if (isPromise(data)) {
237236
return data.then(resolved => buildResponse(exeContext, resolved));
238237
}

0 commit comments

Comments
 (0)