graphql-subscription-test-authorlisted
Install: claude install-skill testland/qa-skills
# graphql-subscription-test-author
## Overview
Per the GraphQL October 2021 spec (section 6.3, blocked by Cloudflare
Turnstile - cite by stable ID "GraphQL October 2021 spec, Section 6.3:
Subscription"), a subscription operation must: select a single root field,
return an event stream, and emit one result per event. Each emitted result
is executed independently against the schema, exactly like a query.
This skill covers testing the transport and resolver layers for subscriptions.
The two most common Node.js transports are:
- **graphql-ws** - WebSocket subprotocol `"graphql-ws"` (per
[the-guild.dev/graphql/ws](https://the-guild.dev/graphql/ws))
- **graphql-sse** - HTTP Server-Sent Events (per
[the-guild.dev/graphql/sse](https://the-guild.dev/graphql/sse))
Both expose an identical async-iterator surface via `client.iterate()`,
making the same test patterns portable across transports.
## When to use
- Writing tests for subscription resolvers (pubsub trigger, filter, error).
- Asserting connection lifecycle: handshake, auth rejection, protocol close.
- Verifying auth-on-connect: `connectionParams` (WS) or `authenticate`
callback (SSE) reject unauthenticated clients before any event is sent.
- Integration-testing that event-stream shape matches the schema contract.
Distinct scope vs. sibling skills:
- `apollo-server-tests` covers queries/mutations via `executeOperation`;
its Limitations section explicitly notes "Doesn't test subscriptions
over WS."
- `graphql-yo