fix(composition): Don't remove scalar properties in buildSubgraphSchema() when providing resolvers#3285
Merged
sachindshinde merged 2 commits intomainfrom Jun 27, 2025
Conversation
🦋 Changeset detectedLatest commit: 9768a6f The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 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 |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
…re some properties are unexpectedly removed
9456c41 to
519c6eb
Compare
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 2 changed, 0 removedBuild ID: 0eec616e5629c96d17a4f62c URL: https://www.apollographql.com/docs/deploy-preview/0eec616e5629c96d17a4f62c |
dariuszkuc
requested changes
Jun 26, 2025
Member
dariuszkuc
left a comment
There was a problem hiding this comment.
Can you add changeset entry?
dariuszkuc
approved these changes
Jun 26, 2025
dariuszkuc
pushed a commit
that referenced
this pull request
Oct 9, 2025
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @apollo/composition@2.11.3 ### Patch Changes - Updated dependencies \[[`8c7a2cd655ad3060e9f5c3b106cfbdb59251701c`](8c7a2cd)]: - @apollo/federation-internals@2.11.3 - @apollo/query-graphs@2.11.3 ## @apollo/gateway@2.11.3 ### Patch Changes - Updated dependencies \[[`4faa114215200daf7ad7518be8e50071fcde783c`](4faa114), [`8c7a2cd655ad3060e9f5c3b106cfbdb59251701c`](8c7a2cd)]: - @apollo/query-planner@2.11.3 - @apollo/federation-internals@2.11.3 - @apollo/composition@2.11.3 ## @apollo/federation-internals@2.11.3 ### Patch Changes - Update connector spec to allow re-entry ([#3312](#3312)) Updates connector spec to follow the same patterns as other federation spec blueprints (i.e. register types/directives in the constructor and use default logic for adding them to the schema that checks whether they need to be added or not). NOTE: Support for handling input objects in the spec is severely limited and only handles `@connect` spec. For additional details on limitations see #3311. ## @apollo/query-graphs@2.11.3 ### Patch Changes - Updated dependencies \[[`8c7a2cd655ad3060e9f5c3b106cfbdb59251701c`](8c7a2cd)]: - @apollo/federation-internals@2.11.3 ## @apollo/query-planner@2.11.3 ### Patch Changes - Fix bug in query planning where a subgraph jump for `@requires` can sometimes try to fetch `@key` fields from a subgraph that doesn't have them. This bug would previously cause query planning to error with a message that looks like "Cannot add selection of field `T.id` to selection set of parent type `T`". ([#3307](#3307)) - Updated dependencies \[[`8c7a2cd655ad3060e9f5c3b106cfbdb59251701c`](8c7a2cd)]: - @apollo/federation-internals@2.11.3 - @apollo/query-graphs@2.11.3 ## @apollo/subgraph@2.11.3 ### Patch Changes - When a `GraphQLScalarType` resolver is provided to `buildSubgraphSchema()`, omitted configuration options in the `GraphQLScalarType` no longer cause the corresponding properties in the GraphQL document/AST to be cleared. To explicitly clear these properties, use `null` for the configuration option instead. ([#3285](#3285)) ([#3285](#3285)) - Updated dependencies \[[`8c7a2cd655ad3060e9f5c3b106cfbdb59251701c`](8c7a2cd)]: - @apollo/federation-internals@2.11.3 ## apollo-federation-integration-testsuite@2.11.3 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
When a
GraphQLScalarTypeis provided in resolvers tobuildSubgraphSchema(), its properties overwrite the existing one in the schema created fromtypeDefs. However, this also includes non-provided/undefinedproperties, which probably isn't what users expect. This PR updates resolver addition so thatundefinedproperties are skipped; if users want to unset/clear scalar properties, they should use an explicitnullfor those properties.