Skip to content

Commit

Permalink
docs(readme): format
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Apr 7, 2022
1 parent 33de8f6 commit 82a7372
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,20 +420,22 @@ import { createClient } from 'graphql-ws';
// Apollo Client Web v3.5.10 has a GraphQLWsLink class which implements
// graphql-ws directly. For older versions, see the next code block
// to define your own GraphQLWsLink.
import { GraphQLWsLink } from "@apollo/client/link/subscriptions";

const link = new GraphQLWsLink(createClient({
url: 'ws://where.is:4000/graphql',
connectionParams: () => {
const session = getSession();
if (!session) {
return {};
}
return {
Authorization: `Bearer ${session.token}`,
};
},
}));
import { GraphQLWsLink } from '@apollo/client/link/subscriptions';

const link = new GraphQLWsLink(
createClient({
url: 'ws://where.is:4000/graphql',
connectionParams: () => {
const session = getSession();
if (!session) {
return {};
}
return {
Authorization: `Bearer ${session.token}`,
};
},
}),
);
```

```typescript
Expand Down Expand Up @@ -471,7 +473,7 @@ class GraphQLWsLink extends ApolloLink {
```

</details>

<details id="kotlin">
<summary><a href="#kotlin">🔗</a> Client usage with <a href="https://github.com/apollographql/apollo-kotlin">Apollo Kotlin</a></summary>

Expand Down

0 comments on commit 82a7372

Please sign in to comment.