Skip to content

Commit 4b8f3b2

Browse files
Fix execution with graphql-js 0.12.x
This fixes executing a query if all fields it encounters have synchronous resolvers, for which behavior changed in 0.12.x due to graphql/graphql-js#1115. Closes #718, closes #720
1 parent 5939b5f commit 4b8f3b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/apollo-server-core/src/runQuery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ function doRunQuery(options: QueryOptions): Promise<GraphQLResponse> {
152152

153153
try {
154154
logFunction({action: LogAction.execute, step: LogStep.start});
155-
return execute(
155+
return Promise.resolve(execute(
156156
options.schema,
157157
documentAST,
158158
options.rootValue,
159159
context,
160160
options.variables,
161161
options.operationName,
162162
options.fieldResolver,
163-
).then(result => {
163+
)).then(result => {
164164
logFunction({action: LogAction.execute, step: LogStep.end});
165165
logFunction({action: LogAction.request, step: LogStep.end});
166166

0 commit comments

Comments
 (0)