Throw GraphQL Schema error when federated schemas are not extend each other properly #830
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Aims to resolve #826
This is currently an experimental draft PR as I get an understanding of what the desired behaviours are for merging federated schema types. The overall idea is that if a schema comes together and non value types do not correctly extend each other within that, then it should throw a GraphQL schema validation error.
I'm pretty certain the current code doesn't do exhaustive checks on ensuring entity types are identical when they haven't been extended - but hopefully at least it gives some ideas on how that might work. I know in another part of the code base for value types there is also a TODO: for ensuring equality between value types.
One other aspect I am not totally sure on is if the order of extension matters, for example if the schema extends a type before it has been defined, but it is defined later in the schema.