graphql-sse
graphql-over-http
Our great sponsors
graphql-sse | graphql-over-http | |
---|---|---|
4 | 12 | |
369 | 358 | |
- | 1.7% | |
8.1 | 7.2 | |
3 days ago | 29 days ago | |
TypeScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
graphql-sse
-
Graph-ql subscriptions without Apollo
The GraphQL over SSE in its simplest form IMHO does not require an additional client library. Setting up a subscription in the browser is as simple as doing the following:
-
GraphQL Subscriptions: Why we use SSE/Fetch over Websockets
There is already a JavaScript implementation for server + client with support for multiplexing from the same maintainer of graphql-ws: graphql-sse
-
how it subscription work on the apollo server?
Actually WebSocket is not the only protocol for executing GraphQL subscriptions. There is also a graphql-over-sse protocol, which is much more lightweight, and uses Server Sent Events. A popular implementation of it is the graphql-sse library, which is maintained by the same person as graphql-ws. The setup and API of both libraries is pretty similar.
-
GraphQL over SSE (Server-Sent Events)
graphql-sse is a reference implementation of the GraphQL over Server-Sent Events Protocol aiming to become a part of the GraphQL over HTTP standard.
graphql-over-http
-
What complaints do you have about GraphQL?
Another major pain is the fact that operation names and HTTP codes are often hidden in request bodies which makes it really hard to see what is going on in standard monitoring tools. It's possible to write some converter but it's beyond me why some people decided that requests which failed on the server respond with status 200. GraphQL spec doesn't define how it should behave, there's only a proposal (https://github.com/graphql/graphql-over-http)
-
GraphQL errors: the Good, the Bad and the Ugly
The GraphQL over HTTP specification states the following:
-
Websocket with socket.io or GraphQL subscriptions
However, if you are doing GraphQL subscriptions over Server Sent Events (HTTP) (which is currently not part of the GraphQL over HTTP specification), the data flow is only from server to client. So each operation must be a separate request, which should be no problem when using HTTP/2, as the browser connection limit is not hit so fast (There are also workarounds to this if you cannot ise HTTP/2).
-
Question about using fetch with a delete mutation
Complementary to the note, you can learn more about GraphQL over HTTP in the specification over here: https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md
-
Announcing GraphQL Yoga 2.0!
GraphQL-spec, GraphQL-over-HTTP: guarantees your GraphQL API to work with all existing GraphQL clients (Apollo, Relay, URQL, and more).
-
The Anatomy of a GraphQL Request
Note: While GraphQL can be done over almost any protocol, this article focuses on the most commonly used protocol GraphQL over HTTP. However, most knowledge can be transferred to other protocols such as GraphQL over WebSockets or other more exotic ones.
-
Is graphql payload usually like a string of query?
There is also the GraphQL over HTTP Specification repository https://github.com/graphql/graphql-over-http
-
GraphQL over SSE (Server-Sent Events)
graphql-sse is a reference implementation of the GraphQL over Server-Sent Events Protocol aiming to become a part of the GraphQL over HTTP standard.
-
GraphQL over WebSockets
With no further ado - I humbly introduce graphql-ws. A coherent, feature-full, zero-dependency, plug-n-play, lazy, simple, server and client implementation of the new, security first GraphQL over WebSocket Protocol with full support for all 3 GraphQL operations: Queries, Mutations and Subscriptions. The protocol aims to be standardised and become a part of GraphQL with the help of the foundation’s GraphQL over HTTP work group.
-
How to handle errors that are from "context creation" ?
You could additionally also choose a specific HTTP code for that scenario (although that would contradict the official GraphQL over HTTP spec https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md).
What are some alternatives?
graphql-ws - Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client.
fastify-websocket - basic websocket support for fastify
aws-lambda-graphql - Use AWS Lambda + AWS API Gateway v2 for GraphQL subscriptions over WebSocket and AWS API Gateway v1 for HTTP
graphql-yoga - 🧘 Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements WHATWG Fetch API and can run/deploy on any JS environment.
fetch-event-source - A better API for making Event Source requests, with all the features of fetch()
redwood - The App Framework for Startups
Express - Fast, unopinionated, minimalist web framework for node.
subscriptions-transport-ws - :arrows_clockwise: A WebSocket client + server for GraphQL subscriptions
fastify - Fast and low overhead web framework, for Node.js
ws - Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js
graphql-subscriptions - :newspaper: A small module that implements GraphQL subscriptions for Node.js