Skip to content

feat(testing): add /testing submodule with buildSubscribeOperation#144

Merged
cuzzlor merged 2 commits intomainfrom
feat/testing-submodule
May 8, 2026
Merged

feat(testing): add /testing submodule with buildSubscribeOperation#144
cuzzlor merged 2 commits intomainfrom
feat/testing-submodule

Conversation

@cuzzlor
Copy link
Copy Markdown
Collaborator

@cuzzlor cuzzlor commented May 8, 2026

Summary

  • Adds a new /testing submodule exporting buildSubscribeOperation, mirroring the buildExecuteOperation helper in @makerx/graphql-apollo-server/testing but for subscriptions.
  • The helper calls graphql.subscribe directly against the schema, bypassing the graphql-ws websocket transport so tests can drive JWT payloads / context inputs without standing up a WS server. Returns the subscription's AsyncIterableIterator<ExecutionResult<TData>> for for await consumption.
  • Wires the submodule into tstoolkit exports and the rollup input list, adds @graphql-typed-document-node/core as a peer dep (already imported by the helper for TypedDocumentNode typing), and adds a ## GraphQL test helpers README section that follows the apollo-server presentation pattern (rationale → capability list → Vitest fixture example → subscription test example).
  • Bumps to 3.1.0 for the new export.

Test plan

  • npm run build (lint + tsc + rollup + tstk + attw) passes
  • attw confirms @makerx/graphql-core/testing resolves cleanly under node10, node16 (CJS+ESM), and bundler conditions alongside the existing /shield and /subscriptions submodules
  • Verify in a downstream consumer that import { buildSubscribeOperation } from '@makerx/graphql-core/testing' resolves and types flow through correctly

🤖 Generated with Claude Code

cuzzlor added 2 commits May 8, 2026 14:46
Mirrors the buildExecuteOperation helper from
@makerx/graphql-apollo-server/testing for subscription operations.
Calls graphql.subscribe directly against the schema, bypassing the
graphql-ws transport so tests can drive context inputs (JWT payloads,
etc.) without standing up a websocket server.

Bump to 3.1.0 for the new export.
@cuzzlor cuzzlor merged commit 49a9beb into main May 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant