Skip to content

Conversation

@duckki
Copy link
Contributor

@duckki duckki commented Oct 23, 2025

Upstream PR: apollographql/apollo-rs#1009.

Summary

  • updates apollo-federation and resolves compile errors, which fixes the upgrading errors
  • fixes Merge::check_for_extension_with_no_base to handle types with both non-extension and extension elements

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

Exceptions

Composition bug fix

@apollo-librarian
Copy link

apollo-librarian bot commented Oct 23, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: c6887964da5ab98ae93ab186
Build Logs: View logs

@github-actions
Copy link
Contributor

@duckki, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

continue;
};

if element.has_non_extension_elements() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was reading the accompanying apollo-rs PR, but I think this discussion actually belongs over here: in short, do we actually need to be doing this check?

I know that the JS version checks this, but I think there are a lot of the parts of that codebase that are compensating for the fact that they were operating on potentially invalid ASTs parsed by graphql-js. This, in particular, feels like a validation we can delegate to apollo-compiler and omit from our composition port (since we're intentionally relaxing it with adopt_orphaned_extensions).

This is largely based on my gut reaction that the compiler changes are a lot larger than I expected, and they may even be considered breaking due to the change in all the type structs. Are we making life unnecessarily difficult for ourselves by porting the extension-with-no-base check?

Copy link
Contributor

Choose a reason for hiding this comment

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

Based on our discussion from yesterday, we probably do need to carry that forward to properly validate Fed 1 schemas prior to upgrade. I've left a comment on the apollo-rs PR to discuss the overall design.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

has_extension_element() and has_non_extension_element() are not mutually exclusive. A schema may have them both.

scalar X
extend scalar X @something

Even if apollo-rs can record origins correctly, FED-772 will persist without this change.
And this is not fed1 specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The predicate we want would be probably type.is_orphan_extension(). has_extension_element() && !has_non_extension_element() was trying to achieve that.

The Schema struct doesn't have that information. But, SchemaBuilder does. I think we can export the orphan_type_extensions info without breaking apollo-compiler API. From that, we can implement is_orphan_extension().

@duckki
Copy link
Contributor Author

duckki commented Oct 29, 2025

#8505 is alternative solution. Closing.

@duckki duckki closed this Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants