Skip to content

How to access req object in resolver using express? #136

Answered by enisdenjo
yosletpp asked this question in Q&A
Discussion options

You must be logged in to vote

The request of the underlying server is inside the raw property.

router.post(
  '/business2',
  createHandler({
    schema: schema2,
    rootValue: root2,
    context: (req) => ({
-     user: req.user
+     user: req.raw.user
    })
    // Pass req.user into the context,
  })
);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yosletpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #135 on January 17, 2025 14:12.