Skip to content

Cerberus/note

Repository files navigation

note 📔

Apollo Client 2.0 with WebSocket Example, Initial project by create-react-app

Example on

🎉 Setup Apollo 2.0 with Websocket

✏️ Automatic Type definition with apollo-codegen

note-app

Endpoints Setup graphql-up

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__"

Installation

yarn

Run server

yarn start

Playground

Open Simple API link on the browser to access Playground playground

Update query document (src/schema/gen.json)

yarn intro

Generate all component's type-annotations

yarn gen

Releases

No releases published

Packages

No packages published