I am trying to get a basic Rails, Graphql, Apollo-Client setup working but having trouble with 422 errors \'invalid auth token\' on the rails side.
Does my use of apoll
this one works fine for me.
const csrfToken = document.querySelector('meta[name=csrf-token]').getAttribute('content');
const link = createHttpLink({
uri: '/graphql',
credentials: 'same-origin',
headers: {
'X-CSRF-Token': csrfToken
}
});
const client = new ApolloClient({
cache: new InMemoryCache(),
link,
});