Set Cookies inside a mutation resolver #2646
Unanswered
MarcosBustamante
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am currently learning GoLang and choose to write my APIs on top of gqlgen.
The documentation has a really good example on how systems should handle reads on cookies in order to authenticate users. However it is missing the write part through mutations.
In my case, I split my graphql schema into auth and non-auth schemas. On my non-auth schema I have a mutation to login users, however I couldn't find the recommended way to write my JWT token inside the httpOnly cookie.
How should I implement my login function using gqlgen resolvers? Should I add the ctx.Writer as a context Value param, like suggested on this post?
Beta Was this translation helpful? Give feedback.
All reactions