-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQL over SSE documentation #185
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all hard linebreaks from the markdown paragraphs so they won't get parsed into <br />
by docusaurus.
@@ -472,3 +472,60 @@ graphql = GraphQL( | |||
), | |||
) | |||
``` | |||
|
|||
## Using Server-Sent Events Protocol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using double blank line between headers for visual separation in markdown too:
## Using Server-Sent Events Protocol | |
## Using Server-Sent Events Protocol |
docs/subscriptions.md
Outdated
|
||
## Using Server-Sent Events Protocol | ||
|
||
In addition to subscriptions over WebSockets, Ariadne also allows an alternative subscriptions approach, `graphql-sse`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be reworded and hard linebreak removed:
Instead of WebSockets, [Server-Sent Events (SSE)](https://github.com/enisdenjo/graphql-sse/blob/master/PROTOCOL.md) can be used as a transmission protocol for subscriptions. This approach uses single, long-lived HTTP connection to push data to clients.
docs/subscriptions.md
Outdated
Server-Sent Events (SSE) allow servers to push data to web clients over HTTP through a single, long-lived connection. | ||
|
||
To enable subscriptions over Server-Sent Events, initialize the `ariadne.asgi.GraphQL` app with | ||
a `ariadne.contrib.sse.GraphQLHTTPSSEHandler` instance: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a `ariadne.contrib.sse.GraphQLHTTPSSEHandler` instance: | |
an `ariadne.contrib.sse.GraphQLHTTPSSEHandler` instance: |
docs/subscriptions.md
Outdated
Subscriptions can be consumed using the [graphql-sse](https://github.com/enisdenjo/graphql-sse/) JavaScript client | ||
library or any other compatible implementation. | ||
|
||
> The `GraphQLHTTPSSEHandler` only supports asynchronous servers, due to the nature of subscriptions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> The `GraphQLHTTPSSEHandler` only supports asynchronous servers, due to the nature of subscriptions. | |
> The `GraphQLHTTPSSEHandler` requires the ASGI server to work. |
Thanks for the feedback @rafalp! Everything has been included in the recent commit. |
Documentation for mirumee/ariadne#1195