fix: prevent context field scalar leaking into supergraph - #328
Merged
n1ru4l merged 1 commit intoSep 9, 2026
Merged
Conversation
robbin-norberg-vcc
marked this pull request as draft
September 7, 2026 13:14
kamilkisiela
approved these changes
Sep 9, 2026
kamilkisiela
marked this pull request as ready for review
September 9, 2026 08:21
Co-authored-by: Uri Goldshtein <uri.goldshtein@gmail.com>
kamilkisiela
force-pushed
the
fix/context-field-value-leak
branch
from
September 9, 2026 08:21
680c69a to
6f9f0f7
Compare
n1ru4l
pushed a commit
that referenced
this pull request
Sep 9, 2026
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 ## @theguild/federation-composition@0.26.1 ### Patch Changes - [#329](#329) [`396442a`](396442a) Thanks [@n1ru4l](https://github.com/n1ru4l)! - Preserve types referenced by directive arguments when removing unreachable types from schema contracts. - [#328](#328) [`332a10a`](332a10a) Thanks [@robbin-norberg-vcc](https://github.com/robbin-norberg-vcc)! - Prevent `federation__ContextFieldValue` declared in a subgraph's `_service.sdl` from leaking into the supergraph. Co-authored-by: github-actions[bot] <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.
Summary
federation__ContextFieldValuefrom subgraph state with the other Federation built-in scalars_service.sdlthat declares the context field scalarWithout the cleanup, the composed supergraph assigns the built-in scalar to a subgraph. Apollo Router /
@apollo/federation-internalsthen rejects extraction with:The regression reproduces on Federation v2.8 and v2.9 before the fix.
Follow-up to #326. This is a focused version of the scalar-leak fix identified in Uri Goldshtein's unmerged
test/service-sdl-context-directivesbranch (457c0e8). Uri is credited as co-author.Validation
pnpm typecheckpnpm test --run --reporter=dot(7,201 passed, 25 skipped, 8 todo)