Skip to content

Commit 9dd7cb9

Browse files
committed
Fix bug in v1.14.4 that broke all GraphQL requests
We had been implicitly assuming the default context was an empty object. After switching to graphql-http, it's now undefined, so we have to set that object explicitly instead.
1 parent 6467956 commit 9dd7cb9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/api/graphql-api.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,8 @@ export function exposeGraphQLAPI(
170170
resolvers: buildResolvers(apiModel)
171171
});
172172

173-
server.post('/', createGraphQLHandler({ schema }));
173+
server.post('/', createGraphQLHandler({
174+
schema,
175+
context: () => ({}) // Fresh empty context for every request
176+
}));
174177
}

0 commit comments

Comments
 (0)