Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simoneb/graphql-sse-mercurius
Example showing how to use graphql-sse with Mercurius.
https://github.com/simoneb/graphql-sse-mercurius
example fastify graphql graphql-sse mercurius sse
Last synced: 26 days ago
JSON representation
Example showing how to use graphql-sse with Mercurius.
- Host: GitHub
- URL: https://github.com/simoneb/graphql-sse-mercurius
- Owner: simoneb
- Created: 2022-09-07T16:11:23.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-09-07T16:14:56.000Z (over 2 years ago)
- Last Synced: 2024-11-08T08:12:13.386Z (3 months ago)
- Topics: example, fastify, graphql, graphql-sse, mercurius, sse
- Language: JavaScript
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# graphql-see-mercurius
Example showing how to use graphql-sse with Mercurius.
It builds on top of https://www.the-guild.dev/blog/graphql-over-sse#with-fastify and adds mercurius to the picture, with minor adaptations.
## Requirements
- Node LTS
## Setup
- `npm i`
- `node server.js`In a different terminal window run:
- `node client.js`
This will check that queries and subscriptions work over plain HTTP (mercurius) and SSE (graphql-sse)
## How it works
- Exposes the same schema both via mercurius and graphql-see
- Mercurius listens on path `/graphql` whereas graphql-see on `/graphql-stream`
- Any GraphQL operations can go to either one or the other