I'm currently writing a next.js app. I have got a query in apollo graphql, that I want to attach a variable to, in the header of the request. The variable is called x-hasura-a .
Trying to use it like:
const variable ='Test'
const get_query = gql'...'
const {
loading,
error,
data,
} = useQuery(
get_query,
{
variables: { asdf: 'asdf' },
},
{
options: {
context: {
headers: {
'x-hasura-a': variable,
},
},
},
},
)
Does not work. Any suggestions?