feat(testing): add /testing submodule with buildSubscribeOperation#144
Merged
feat(testing): add /testing submodule with buildSubscribeOperation#144
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/testingsubmodule exportingbuildSubscribeOperation, mirroring thebuildExecuteOperationhelper in@makerx/graphql-apollo-server/testingbut for subscriptions.graphql.subscribedirectly against the schema, bypassing thegraphql-wswebsocket transport so tests can drive JWT payloads / context inputs without standing up a WS server. Returns the subscription'sAsyncIterableIterator<ExecutionResult<TData>>forfor awaitconsumption.tstoolkitexports and the rollup input list, adds@graphql-typed-document-node/coreas a peer dep (already imported by the helper forTypedDocumentNodetyping), and adds a## GraphQL test helpersREADME section that follows the apollo-server presentation pattern (rationale → capability list → Vitest fixture example → subscription test example).3.1.0for the new export.Test plan
npm run build(lint + tsc + rollup + tstk + attw) passesattwconfirms@makerx/graphql-core/testingresolves cleanly under node10, node16 (CJS+ESM), and bundler conditions alongside the existing/shieldand/subscriptionssubmodulesimport { buildSubscribeOperation } from '@makerx/graphql-core/testing'resolves and types flow through correctly🤖 Generated with Claude Code