This project is a fork of the https://github.com/apollographql/graphql-tutorial.git project modified to support GraphQL Subscription based on the awesome Apollo article Tutorial: GraphQL Subscriptions on the Server.
This project got created to test GraphQL Subscription support for my SchemaGlue project. SchemaGlue allows to nicely organize GraphQL schemas and resolvers across folders, and glue them back.
git clone https://github.com/nicolasdao/apollo-subscription-demo.git
cd apollo-subscription-demo
cd server && npm install
cd ../client && npm install
Browse to your apollo-subscription-demo folder and then run:
cd server
npm start
Open a new terminal and browse to your apollo-subscription-demo folder and then run:
cd client
npm start
Open the GraphiQL client hosted on http://localhost:4000/graphiql and subscribe to a message as follow:
subscription {
messageAdded(channelId: 1) {
id
text
}
}
Open your test client hosted on http://localhost:3000/channel/1 and add a new item:
As soon as you've added that item, you should see your GraphiQL receiving an update: