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

fix: Force add 'orphan' types used by apollo federation to schema #441

Closed
wants to merge 1 commit into from

Conversation

danilo-barboza
Copy link
Contributor

@danilo-barboza danilo-barboza commented Sep 26, 2020

Resolves #442

Checklist

  • Pull requests follows the contribution guide
  • New or modified functionality is covered by tests

Description

As described in #442, the main issue is that, for some Apollo Federation contexts, it is possible to have "orphan" types that are not referenced by any other types in the schema/graph.

This is a very naive attempt to fix it by making sure we add types with the @extends directive, but asking clients to specify the type of it in the SchemaParserDictionary.

It's marked as a draft because it is mostly to highlight the issue, but I'm looking to get for some pointers in order to a proper fix for it.

Possible things to consider on the real fix:

  • Tests
  • Refactor handleInterfaceOrUnionSubTypes to be more generic (maybe just rename it? or reuse the generic parts?)
  • Discover the javaType for the extend entity types automatically as it is done for the other types.

@vojtapol
Copy link
Member

Thanks for the contribution. One problem I see is that this is Apollo-specific. Other users could define and @extends directive that does something else.

@danilo-barboza
Copy link
Contributor Author

Hi @vojtapol, thanks for your comment!

This is a fair point. Any suggestion on what would be a better approach to solve the issue?

@danilo-barboza
Copy link
Contributor Author

Hi @vojtapol, thank you for your input.

After your comment, I changed the approach to fix the issue. Can you take a look at #445 ?

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.

Federated Entity type removed from executable schema
2 participants