Skip to content

fix: do not add inaccessible directive on federation built-in types#295

Merged
n1ru4l merged 3 commits intomainfrom
fix-contract-inaccessible-built-in-types
Apr 10, 2026
Merged

fix: do not add inaccessible directive on federation built-in types#295
n1ru4l merged 3 commits intomainfrom
fix-contract-inaccessible-built-in-types

Conversation

@n1ru4l
Copy link
Copy Markdown
Contributor

@n1ru4l n1ru4l commented Apr 10, 2026

ix schema contract composition applying @inaccessible on the federation types ContextArgument and FieldValue on the supergraph SDL.

This mitigates the following error in apollo-router upon processing the supergraph:

could not create router: Api error(s): The supergraph schema failed to produce a valid API schema: The following errors occurred:
  - Core feature type `join__ContextArgument` cannot use @inaccessible.
  - Core feature type `join__FieldValue` cannot use @inaccessible.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the addInaccessibleToUnreachableTypes function to include ContextArgument and FieldValue from the join specification in the list of types that should not be marked as inaccessible. A new test case has been added to verify this change, although it contains a minor typo in its description where 'ContextArgument' is repeated.

Comment thread __tests__/contracts/add-inaccessible-to-unreachable-types.spec.ts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@theguild/federation-composition 0.22.2-alpha-20260410085406-203ac50d0abef00de65e864140c6b9d26c465938 npm ↗︎ unpkg ↗︎

@n1ru4l n1ru4l marked this pull request as ready for review April 10, 2026 08:46
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@n1ru4l n1ru4l requested review from jdolle and kamilkisiela April 10, 2026 08:54
@n1ru4l n1ru4l merged commit fffe987 into main Apr 10, 2026
4 checks passed
@n1ru4l n1ru4l deleted the fix-contract-inaccessible-built-in-types branch April 10, 2026 09:02
n1ru4l pushed a commit that referenced this pull request Apr 10, 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.22.2

### Patch Changes

-
[#295](#295)
[`fffe987`](fffe987)
Thanks [@n1ru4l](https://github.com/n1ru4l)! - Fix schema contract
composition applying `@inaccessible` on the federation types
`ContextArgument` and `FieldValue` on the supergraph SDL.

This mitigates the following error in apollo-router upon processing the
supergraph:

could not create router: Api error(s): The supergraph schema failed to
produce a valid API schema: The following errors occurred:
- Core feature type `join__ContextArgument` cannot use @inaccessible.
- Core feature type `join__FieldValue` cannot use @inaccessible.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants