This project demonstrates different ways of using GraphQL Subscriptions in graphql-yoga server.
# Install dependencies
npm install
# Start server
npm run dev
Open http://localhost:4000 in your browser and try the below queries:
Call
helloMutation
to trigger subscriptions. RunhelloMutation
in one tab and any of the subscription queries in another tab to see the subscriptions in action.
mutation helloMutation {
hello(topicId: "abc")
}
subscription hello {
hello
}
subscription notification {
notification(topicId: "abc")
}
subscription protectedNotification {
protectedNotification
}
This project is licensed under the MIT License - see the LICENSE file for details