Quick answer: A GraphQL subscription is not a normal request and response. It opens a long-lived WebSocket, and the server pushes a result each time an event happens, so you watch a live stream instead of reading one reply. Hoppscotch supports subscriptions with a live log and speaks both the graphql-ws and graphql-transport-ws subprotocols, so the main job is matching the one your server implements.
The three operations do not behave the same
Treat subscriptions as a different transport from the start, and most of the confusion goes away. This is one of the protocol-specific differences tracked in the Hoppscotch comparison hub.
| Operation | Transport | Lifecycle | What you get |
|---|---|---|---|
| Query | HTTP POST | One request, one response | A single data payload |
| Mutation | HTTP POST | One request, one response | One write result |
| Subscription | WebSocket | Stays open until you stop | A pushed result per event |
A query and a mutation close as soon as the answer arrives. A subscription has to stay connected, which is why a dropped socket or an expired token silently ends the stream even though your query text is correct.
Connecting and reading the schema
Enter the GraphQL endpoint and connect. Hoppscotch discovers the schema by sending the standard introspection query over HTTP POST, applying the headers and authorization you have configured, so the Schema Explorer and Documentation Explorer populate from the live server rather than from a guess. Use that explorer to confirm the subscription field and its payload shape before you write anything. If introspection fails, fix the endpoint or auth first, because a subscription over the same credentials will fail the same way.
Running a subscription
Write the subscription in the editor, including any arguments and the fields you want on each pushed event, then run it and watch the live log. The connection stays open and appends a new entry every time the server emits, rather than replacing one response. You stop it by disconnecting, which closes the socket. A quiet log is not by itself an error: it only means no event has fired yet, so trigger the event on the server, such as creating or updating a record, and watch for the matching push.
Picking the protocol, and the limits
The two WebSocket subprotocols are not interchangeable. Choose graphql-ws or graphql-transport-ws to match the server, because a mismatch shows up as a failed connect or a socket that closes immediately. Use wss:// when the rest of the API is HTTPS, and treat the token like any other authenticated request. Two boundaries are worth knowing. GraphQL lives in the Personal Workspace and is not supported for collaboration inside a shared team workspace, and the batch collection runner covers queries and mutations, while subscriptions remain an interactive live stream rather than a one-shot asserted run.
Common failure modes
If the socket never opens, check the subprotocol and the ws:// versus wss:// scheme before editing the query. If it connects and then drops after a while, suspect an expired token or an idle timeout, and reconnect with a fresh credential. If it connects but nothing arrives, verify you are actually triggering the subscribed event and that the field's arguments match the server's filter. For request-response work you want to assert and rerun rather than watch a stream, a desktop tool such as Powerduck runs ordered scenarios with per-step assertions through its local process and keeps variables in four scopes.
Frequently asked questions
Do subscriptions use HTTP like a query? No. Queries and mutations go over HTTP POST, while a subscription holds a WebSocket open and receives pushed results for as long as it is connected.
Which protocol should I choose? The one your server implements. Hoppscotch supports both graphql-ws and graphql-transport-ws; they do not interoperate, so a wrong choice fails the connection or closes it at once.
Why is my subscription connected but showing no data? A live connection only waits for events. If none has fired, the log stays empty, so trigger the event on the server and confirm the subscription arguments.
Can I run a subscription in a team workspace? Not today. GraphQL is supported in the Personal Workspace, and shared workspaces do not support GraphQL collaboration.
The bottom line
Testing a subscription is mostly a connection problem, not a syntax problem. The query can be perfect and still stream nothing if the subprotocol, scheme, or token does not line up with the server. Confirm the schema first, match the protocol and auth, then prove the stream by triggering a real event instead of waiting and assuming the tool is broken.
Top comments (0)