Skip to content

fix(federation): removed RebaseError::InterfaceObjectTypename error#8109

Merged
duckki merged 2 commits intodevfrom
duckki/fed-678
Aug 20, 2025
Merged

fix(federation): removed RebaseError::InterfaceObjectTypename error#8109
duckki merged 2 commits intodevfrom
duckki/fed-678

Conversation

@duckki
Copy link
Contributor

@duckki duckki commented Aug 19, 2025

Summary

  • The rebase_on method was prohibiting __typename field from being rebased on an interface object type by raising InterfaceObjectTypename error.
  • But, it seemed unnecessarily prohibitive, rejecting plannable queries.
  • Although it's odd to fetch __typename from interface object types, there are already several other cases where such __typename selections are added to interface object types.
  • Such __typename selections are benign and we currently don't plan to remove all of those cases at this time.
  • Thus, this PR removes the error variant and the check for the error altogether.
  • Also, added a regression test that caused the error previously.

Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible[^1]
  • Documentation[^2] completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added[^3] and documented
  • Tests added and passing[^4]
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

…unnecessary

- added a regression test that caused the error previously
@duckki duckki requested review from a team as code owners August 19, 2025 23:18
@github-actions

This comment has been minimized.

@apollo-librarian
Copy link

apollo-librarian bot commented Aug 19, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 1 changed, 0 removed
* graphos/routing/(latest)/observability/telemetry/instrumentation/standard-instruments.mdx

Build ID: 1c21cb2641fbdaed17b06fde
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/1c21cb2641fbdaed17b06fde

@duckki duckki requested a review from a team as a code owner August 19, 2025 23:36
Copy link
Contributor

@sachindshinde sachindshinde left a comment

Choose a reason for hiding this comment

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

This is fine given our current limitations of interface object handling; for folks who may not know why we need to do this, see this comment from a previous PR.

Note that this change cannot be mirrored to the JS codebase as-is, as the JS codebase still implements the fragment-reuse optimization which uses errorIfCannotRebase: false, and that codepath needs __typename to be "skipped" to prevent the issue described in this federation repo PR. This fragment-reuse codepath was removed from the Rust codebase, so it's fine here.

@duckki duckki merged commit c5b3402 into dev Aug 20, 2025
15 checks passed
@duckki duckki deleted the duckki/fed-678 branch August 20, 2025 20:58
@abernix abernix mentioned this pull request Sep 22, 2025
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