h6ah4i / android-advancedrecyclerview

RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)
https://advancedrecyclerview.h6ah4i.com/
Apache License 2.0
5.32k stars 860 forks source link

``` #525

Open Sonyashines opened 1 year ago

Sonyashines commented 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