https://supertokens.com/ logo
Title
a

ansont

11/09/2022, 9:50 PM
Are there any examples of using supertokens with NestJS/GraphQL? Thanx!
r

rp

11/10/2022, 5:26 AM
hey @ansont we have examples for using with nest js only. But we have had people in the past who have used it with nestjs + graphql. Maybe search on discord and our github issues for this.
a

ansont

11/23/2022, 5:49 PM
I managed to get this to work by writing a session plugin for the NestJS graphql module. However, it's pretty hacky because verifySession takes request and response arguments which are not readily available in the plugin.
r

rp

11/24/2022, 5:15 AM
I see. What would be the ideal interface for verifySession which would work well for your use case?
a

ansont

11/25/2022, 9:28 PM
If there's an alternative (lower level) verifySession that just takes cookies and returns the response data and the session instead of applying to response object
r

rp

11/26/2022, 2:49 AM
There isn’t one yet. But in 1 months time, there will be.
Until then, you can hack around by providing a fake req and res object to the getSession function and reading from those.