Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Entity Interface types #106

Merged
merged 6 commits into from
Jan 9, 2025

Conversation

TannerRogalsky
Copy link
Contributor

Apollo Federation v2.3 introduced new @interfaceObject directive that allows users to extend entity functionality through inheritance. This allows entities to be interfaces (with some contraints). This PR addresses two issues:

  1. Although an interface can be an entity with an @key directive, it should not be include in the _Entity union in the SDL.
  2. While the type could be resolved, none of the fields could be realized. This meant that queries against an entity interface yielded null values. Invoking resolve_type for the interface type should result in materialized fields for correctly configured interfaces.

Thank you!

Copy link
Collaborator

@kzlsakal kzlsakal left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @TannerRogalsky! Apart from the formatting check in the CI, I left a small comment for a function. Nice work!

lib/absinthe/federation/schema/entity_union.ex Outdated Show resolved Hide resolved
TannerRogalsky and others added 2 commits January 9, 2025 12:04
Co-authored-by: Doruk Gurleyen <dorukgurleyen@gmail.com>
@kzlsakal kzlsakal merged commit 1eb0cc8 into DivvyPayHQ:main Jan 9, 2025
3 checks passed
@TannerRogalsky TannerRogalsky deleted the resolve-entity-interface-type branch January 9, 2025 18:04
@kzlsakal kzlsakal added the bug Something isn't working label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants