Apollo Client 2.0 with WebSocket Example, Initial project by create-react-app
🎉 Setup Apollo 2.0 with Websocket
✏️ Automatic Type definition with apollo-codegen
yarn global add graphql-up
graphql-up note.graphql
After endpoint was created, you will receive this message:
✔ Your GraphQL API is ready to use. Here are your endpoints:
❯ Simple API: https://api.graph.cool/simple/v1/__alias__
❯ Relay API: https://api.graph.cool/relay/v1/__alias__
❯ Subscriptions API: wss://subscriptions.graph.cool/v1/__alias__
Open your GraphQL endpoint in a browser to use the interactive API Playground.
API Documentation: https://www.graph.cool/docs/graphql-up/
Create env file
yarn env
Set Simple API & Subscriptions API to .env file
NODE_PATH=src/
REACT_APP_API_URL="https://api.graph.cool/simple/v1/__alias__"
REACT_APP_WEB_SOCKET_URL="wss://subscriptions.graph.cool/v1/__alias__"
yarn
yarn start
Open Simple API
link on the browser to access Playground
yarn intro
yarn gen