Has anyone successfully setup supertokens with nes...
# general
v
Has anyone successfully setup supertokens with nestjs + graphql? I've had no trouble setting it up for nestjs without graphql, but I'm not able to adapt the supertokens graphql guide to work with the nestjs grapqhl module.
r
Are you facing any errors specifically? We have had people implement this combination before
v
The verifySession method in my guard errors out because the request object is undefined.
r
Hmmm. Are you applying the guard to the graphql endpoint?
v
Yes. I'm applying the auth middleware to every route, so the graphql endpoint should be included. I probably have to differentiate between http and graphql requests in the guard, because the application context is different. But I'm really not sure.
r
I see. We will have to look into it a bit. If you open an issue about it on our GitHub, then we can make a demo app for this
v
I'll try a couple more things, but if I can't get it to run by the end of the day I'll open an issue. Thanks 👍
r
Sounds good!
If you do get it to work, feel free to contribute the example to open source 🙂
v
Got it to work. Accessing the request object is different for the graphql executioncontext. Checking the context type before calling verifySession fixes the issue. I can probably build an example for this. If I do, where can I put it?
r
You can create a PR for the demo in here: https://github.com/supertokens/supertokens-node/tree/master/examples A folder name like
nestjs-graphql
would work well
v
Alright, sounds good.
5 Views