const createApolloClient = authToken => {
return new ApolloClient({
link: new WebSocketLink({
uri: "wss://url/v1/graphql",
options: {
reconnect: true,
connectionParams: {
headers: {
Authorization: `Bearer ${authToken}`
}
}
}
}),
cache: new InMemoryCache()
});
};
@k96white This is working for me with subscriptions and ws subscription but carrefull with http link instead of ws link, syntax is not the same:
const createApolloClient = (authToken) => {
return new ApolloClient({
link: new HttpLink({
uri: "https://hasura.cairncross.ovh/v1/graphql",
headers: {
Authorization: `Bearer ${authToken}`
},
}),
cache: new InMemoryCache(),
});
};
Originally posted by @clementvp in hasura/nodejs-graphql-subscriptions-boilerplate#3 (comment)
@k96white This is working for me with subscriptions and ws subscription but carrefull with http link instead of ws link, syntax is not the same:
Originally posted by @clementvp in hasura/nodejs-graphql-subscriptions-boilerplate#3 (comment)