Open Sonyashines opened 1 year ago
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 https://github.com/hasura/nodejs-graphql-subscriptions-boilerplate/issues/3#issuecomment-653093428
@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 https://github.com/hasura/nodejs-graphql-subscriptions-boilerplate/issues/3#issuecomment-653093428