Graphql token
I'm trying to use graphql (using urql) as my data provider and all was ok until I had to authenticate my requests. I need to use send a token (stored either in cookies or localstorage) in the headers but can't seem to make it work.
My issue is that, even though the data provider setup is done in a "use client" file, this thing is rendered on the server first, and even though the queries happen on the client side it seems like the initial setup for the urql provider is done in the server.
In the
And I do see this console.log happening on the browser but the request never sends the header to the server.
Here's my config for the gqlClient that is being used by Refine:
My issue is that, even though the data provider setup is done in a "use client" file, this thing is rendered on the server first, and even though the queries happen on the client side it seems like the initial setup for the urql provider is done in the server.
In the
authExchange part of my gqlClient setup I even added something like this:And I do see this console.log happening on the browser but the request never sends the header to the server.
Here's my config for the gqlClient that is being used by Refine:
