-
-
Notifications
You must be signed in to change notification settings - Fork 831
fix(utils/mapSchema): do not map builtin scalars #5294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 4fc325f The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Benchmark Results
|
💻 Website PreviewThe latest changes are available as preview in: https://pr-5294.graphql-tools.pages.dev |
d34fb65
to
b8bf584
Compare
dca55e3
to
4fc325f
Compare
Caution Review failedThe pull request is closed. 📝 WalkthroughSummary by CodeRabbit
WalkthroughPatch updates utils mapSchema behavior to avoid mapping GraphQL built-in scalars. Imports adjusted to use specifiedScalarTypes. mapTypes now exempts built-in scalars from testFn-driven mapping. A new test covers scalar-type mapping. A changeset adds a patch note for @graphql-tools/utils. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Caller
participant MS as mapSchema
participant MT as mapTypes
participant TF as testFn
participant ST as specifiedScalarTypes
C->>MS: invoke mapSchema(schema, mapper)
MS->>MT: iterate types with mapper
MT->>TF: evaluate type against testFn
note right of TF: New behavior: built-in scalars are exempt
MT->>ST: is type in specifiedScalarTypes?
alt Built-in scalar
MT-->>MS: return original type (unchanged)
else Non-builtin and testFn passes
MT-->>MS: apply mapper transformation
else Non-builtin and testFn fails
MT-->>MS: skip/leave unchanged per existing logic
end
MS-->>C: return mapped schema
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
No description provided.