Best approach to set headers through helix resolver in SvelteKit
See original GitHub issueHello,
I want to know what is the best approach to set (or return) headers (cookies to be exact) through helix resolver in SvelteKit?
After use login I need to set the jwt
and session information in cookies. You can see the Mutation code in here:
https://github.com/MirrorBytes/phorm-kit-vercel/blob/283b0c4036db13b799f22cd2b85a3f89ffab6e1b/src/resolvers/user.ts#L53
And the jwt is generated here:
https://github.com/MirrorBytes/phorm-kit-vercel/blob/283b0c4036db13b799f22cd2b85a3f89ffab6e1b/src/entities/user.ts#L98
I have noticed that processRequest()
function return a result
with headers
in here:
https://github.com/MirrorBytes/phorm-kit-vercel/blob/283b0c4036db13b799f22cd2b85a3f89ffab6e1b/src/routes/graphql.ts#L37
Is there is a way to access the header when processing a request (or resolving a schema) ? Or can you suggest me a good a approach to do this ?
Thank you.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (1 by maintainers)
Top GitHub Comments
@AndreasHald I’m using version
1.7.0
it’s working fine (it was released 2 months ago). PS: latest version is1.8.0
, but it should work fine.Thank you @benbender , I have been thinking about doing this. I just needed another opinion on doing this. Thank you for the confirmation.