README
Apollo Link Socket
Socket your Apollo with this handy Link!
This library aims to add WebSocket support to Apollo Client in a sever-abstract manner.
Use
- Bring your own socket to the party
const socket: WebSocket = new WebSocket('wss://mywebsocket.com')
- Create a link with the socket
const socketLink = createWebSocketLink(socket)
- Toss that link in your Apollo client
const client = new ApolloClient({
link: ApolloLink.from([
...,
socketLink,
...
])
})
How it works
Building
- Clone me and
yarn install
the dependencies - Run
yarn build
to JavaScript the TypeScript - Run
yarn test
to make sure all the things installed and build correctly