Pinterest style example showing how to setup Apollo Subscriptions.
Blog post: https://www.graphql.college/graphql-subscriptions-with-react-node-apollo-and-postgres/
⚛️ React
🚀 Apollo GraphQL
💾 Postgres
- Add pin. Uses React Apollo's
<Query />
component. - List pins. Uses React Apollo's
<Mutation />
component. - Update pin list in real time.
- Client: Uses
<Query />
'ssubscribeToMore
property. - Server: Uses
graphql-subscriptions
andgraphql-postgres-subscriptions
- Client: Uses
- Nodejs
- Postgres
# Clone repo
git clone https://github.com/GraphQLCollege/apollo-subscriptions-example.git
# Install server dependencies
cd packages/server && yarn
# Setup environment variables
cp .env.example .env
# Create and migrate database
yarn db:create && yarn db:migrate
# Start server
yarn start
# Start client
cd ../client && yarn && yarn start