Skip to content

Commit

Permalink
Merge pull request #79 from smeijer/patch-1
Browse files Browse the repository at this point in the history
feat: pass `res` to contextResolver
  • Loading branch information
theodorDiaconu authored Oct 1, 2020
2 parents 142d4e1 + bfd2ddf commit 018d98f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function getContextCreator(meteorApolloConfig, initialApolloConfig) {
} = initialApolloConfig;

const baseContext = { db };
return async function getContext({ req: request, connection }) {
return async function getContext({ req: request, res, connection }) {
// This function is called whenever a normal graphql request is being made,
// as well as when a client initiates a new subscription. However, when a
// client subscribes, the request headers are not being send along. The
Expand All @@ -112,6 +112,7 @@ function getContextCreator(meteorApolloConfig, initialApolloConfig) {
const defaultContext = defaultContextResolver
? await defaultContextResolver({
req,
res,
connection,
...baseContext,
...userContext,
Expand Down

0 comments on commit 018d98f

Please sign in to comment.