Description
The documented algorithm is quite complex, requiring that the FieldSelectionMap validation be applied to a set of schemas, excluding the current.
I do wonder how feasible the spec algorithm is though:
The combined schema context formed by the union of otherSchemas as the schema context except all fields marked as
@internal
It's not like we'd actually compose the other schemas together, that would be far too expensive. This means having some kind of visitor that repeatedly scans across multiple schemas while resolving selected fields in the FSM – one field could be in more than one schema, so you'd have to follow multiple paths, etc. It seems unnecessarily complicated?
What do you think about rewriting the algorithm to work with the composite schema?
Something like, for each source schema, find all require directives, and validate each against the composite schema.