Skip to content

Commit

Permalink
Make sure 'ctx.node' is defined for the V4 adaptor
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Mar 9, 2023
1 parent 3e43ad6 commit 5212c85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions @app/lib/src/GraphileApolloLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export class GraphileApolloLink extends ApolloLink {
await hookArgs(
args,
{
node: {
req,
res,
},
expressv4: {
req,
res,
Expand Down
6 changes: 5 additions & 1 deletion @app/server/__tests__/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ export const runGraphQLQuery = async function runGraphQLQuery(
},
variableValues: variables,
};
await hookArgs(args, { node: { req, res } }, resolvedPreset);
await hookArgs(
args,
{ node: { req, res }, expressv4: { req, res } },
resolvedPreset
);

// Because we're connected as the database owner, we should manually switch to
// the authenticator role
Expand Down

0 comments on commit 5212c85

Please sign in to comment.