-
I want to add headers to the response like Set-Cookie for setting a cookie. Is there a way to do so? If not is there a way to set a cooke in ariadne. I am using React as frontend. Please help. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
rafalp
Aug 23, 2021
Replies: 1 comment 1 reply
-
Setting cookies on response is murky water when it comes to GraphQL because it doesn't really operate within the request/response context. Most idiomatic way to achieve this is to return value to be set in cookie as part of mutation's result, and set the cookie in the client, via JS. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
SuPythony
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Setting cookies on response is murky water when it comes to GraphQL because it doesn't really operate within the request/response context.
Most idiomatic way to achieve this is to return value to be set in cookie as part of mutation's result, and set the cookie in the client, via JS.