Skip to content

Commit a904e67

Browse files
committed
fix: pass context fn to server middleware
1 parent 03fc641 commit a904e67

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/apollo/lib/drivers/apollo-base.driver.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ export abstract class ApolloBaseDriver<
133133

134134
await server.start();
135135

136-
app.use(path, expressMiddleware(server));
136+
app.use(
137+
path,
138+
expressMiddleware(server, {
139+
context: options.context,
140+
}),
141+
);
137142

138143
this.apolloServer = server;
139144
}
@@ -171,7 +176,9 @@ export abstract class ApolloBaseDriver<
171176
app.route({
172177
url: path,
173178
method: ['GET', 'POST', 'OPTIONS'],
174-
handler: fastifyApolloHandler(server),
179+
handler: fastifyApolloHandler(server, {
180+
context: options.context,
181+
}),
175182
});
176183

177184
this.apolloServer = server;

0 commit comments

Comments
 (0)