Subscriptions Configuration
This section explains how you can configure Subscriptions both for local development and using Cosmo Studio.
When using Subscriptions with Cosmo Router locally or through Cosmo Studio, you’d need to configure the correct protocol to talk to your Subgraphs. Cosmo Router Supports WebSockets as well as the SSE (Server-Sent Events) for transport. When using WebSockets, the Router automatically negotiates with the Subgraph what protocol to use. The protocols “graphql-ws” and “graphql-transport-ws” are both supported.
If your Subgraph uses SSE, use the following configuration.
If your Subgraph uses SSE over HTTP POST, the config should look like this.
If your Subscriptions Endpoint differs from the default routing URL, you can use the following configuration.
Available options are “sse”, “sse_post”, and “ws”.
You can also use `wgc subgraph update …` to update the Subscriptions protocol or URL for a specific Subgraph.
Was this page helpful?
⌘I