I am using Apollo Client in my React app.
When a user is logged-in in our cms we set a HttpOnly cookie. I can see in my React app (browser) when I inspect with devtools this cookie has been set: MYNAMEffb4afd023baac83115bf7882.
I need to send a custom Request header to each GraphQl query request. But only when above cookie has been set.
The custom header:
X-My-Name: Name
What are the steps I have to follow?
HttpOnlycookie has been set? So in the custom link I can add an if statementif (hasMyHttpOnlyCookie) {// link code}. As far as I know you can't read anHttpOnlycookie in your frontend? Otherwise it will send that request header all the time in every GraphQL request. Also for 'normal' users?