Skip to content

Commit 529a796

Browse files
committed
fix(server): fix graphql context issue
1 parent 8ec0e7b commit 529a796

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/smooth-core/src/server/expressApp.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ export function createExpressApp({
5050
app.use(webpackMiddleware)
5151
}
5252

53-
const apolloServer = new ApolloServer({ schema })
54-
55-
apolloServer.applyMiddleware({
56-
app,
53+
const apolloServer = new ApolloServer({
54+
schema,
5755
context: ({ req }) => getContext({ req, config }),
5856
})
5957

58+
apolloServer.applyMiddleware({ app })
59+
6060
app.use(ssr({ config, schema, fragmentTypes }))
6161

6262
if (config.env === 'development') {

0 commit comments

Comments
 (0)