GraphQL subscriptions in the Explorer
The GraphOS Studio Explorer provides support for executing GraphQL subscription operations using a variety of protocols (including WebSocket and HTTP). You can configure the Explorer to use whichever protocol your GraphQL endpoint requires.
To execute a GraphQL subscription operation in the GraphOS Studio Explorer, first open the Explorer's Connection settings to specify your subscriptions endpoint and implementation:
Remember that the path and protocol of your subscriptions URL might differ from those of your primary endpoint.
You define a subscription operation in the Explorer's Operation panel, just as you do for a query or mutation:
When you run the subscription, a Subscriptions panel appears in the bottom right that updates as new data arrives:
- The most recently received payload is displayed at the top of the panel.
- The dot next to
STATUSindicates whether the Explorer is connected to your subscriptions endpoint (green if connected, red if disconnected).
- Click the
Listeningto stop listening for updates. The updates you've already received remain in the panel.
- Click the
Subscriptionsto close the panel entirely.
If you can't connect to your subscriptions endpoint, double-check all the following in the Explorer's Connection settings:
- The protocol of your endpoint URL (
- The path of your endpoint URL
- Your selected subscriptions implementation (see Setup)