0.1.1 • Published 6 years ago
apollo-link-socket v0.1.1
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 installthe dependencies - Run
yarn buildto JavaScript the TypeScript - Run
yarn testto make sure all the things installed and build correctly
0.1.1
6 years ago