SSE is simpler to implement and more efficient for scenarios where client-to-server communication is minimal or not required. In contrast, WebSockets provide full-duplex communication, suitable for interactive applications like chat rooms or gaming. SSE is often the better choice for simpler, one-way data streaming applications due to its ease of use and lower overhead. You can use SSE by settingDocumentation Index
Fetch the complete documentation index at: https://wundergraphinc-milinda-eng-8701-implement-cache-warmer-from.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Accept: text/event-stream on a regular GraphQL POST request. The document must be a subscription. Try out the following example:
Example
Client Integration
To implement Server-Sent Events (SSE) with a GraphQL POST request, you’ll typically need to use a more custom approach than the standardEventSource. Here’s a full example using JavaScript’s fetch API with the ReadableStream interface. You can also copy paste this example in the Developer Console to test it.
Providing a compatible interface for
EventSource is not very difficult to add, but we haven’t seen the need for it yet. If you require it, please open an issue in our repository.We have deprecated the former way of triggering SSE (adding
?wg_sse=true to the end of your HTTP request). We will continue to support it for a short grace period.