ts: used named export for 'Maybe' type#2586
Merged
IvanGoncharov merged 1 commit intographql:masterfrom May 25, 2020
Merged
Conversation
step2this
added a commit
to step2this/social-media-app
that referenced
this pull request
Nov 12, 2025
Added comprehensive schema snapshot tests to catch breaking changes and enforced single GraphQL module instance to prevent realm errors. **Changes:** 1. **Schema Snapshot Test** (src/schema/__tests__/schema-snapshot.test.ts): - Snapshots schema structure as plain object (avoids printSchema() realm issues) - Tests all root types (Query, Mutation) and core domain types - Validates Relay cursor pagination spec compliance - Checks reasonable API complexity (type/field counts) - 8 comprehensive test cases 2. **pnpm Override** (package.json): - Added pnpm.overrides to guarantee [email protected] across all packages - Prevents "Cannot use GraphQLSchema from another module or realm" errors - Industry best practice for monorepos with GraphQL **GraphQL Module Realm Problem - Root Cause:** The error occurs when multiple instances of the 'graphql' package exist in node_modules. GraphQL uses instanceof checks internally, which fail when comparing objects from different module instances. Common in: - pnpm monorepos (strict dependency isolation) - Projects mixing Apollo Server, Pothos, and graphql-tools - Transitive dependencies pulling different graphql versions **Industry Solutions Applied:** 1. ✅ pnpm overrides - Force single graphql version across workspace 2. ✅ Avoid direct graphql-js functions - Use Apollo Server methods 3. ✅ Snapshot schema structure - Not raw SDL via printSchema() **References:** - graphql/graphql-js#2586 - https://www.apollographql.com/docs/apollo-server/testing - https://pnpm.io/package_json#pnpmoverrides **Impact:** - ✅ All 8 schema snapshot tests passing - ✅ TypeScript compilation clean - ✅ Breaking change detection now in place - ✅ Aligns with testing strategy assessment recommendations
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.
No description provided.