Adapt connectors expansion and validation to handle abstract types (interfaces and unions)
[!Note] This PR builds on #8616 and #8626
Supporting the ... syntax in the JSONSelection mapping language (PR #7957) allowed for conditional selections, which allows for conditionally determining the __typename of an object in GraphQL, which enables the use of abstract types (or type polymorphism): interfaces and union types that might be one of several concrete types, with the exact __typename and associated fields determined at runtime.
This PR updates the rest of the connectors system (beyond the JSONSelection language) to tolerate abstract types: relaxing validation to allow for abstract types, but also validating the fields of each concrete type; rewriting expansion to understand interfaces, unions, and JSONSelection strings that compute their __typename and other fields; and updating the shape crate to support this new functionality. The new expansion and validation traversal logic is now Shape-based, which is the achievement that allows for static analysis of conditional __typename selections.
✅ Docs preview ready
The preview is ready to be viewed. View the preview
File Changes
0 new, 1 changed, 0 removed
* graphos/routing/(latest)/performance/caching/response-caching/observability.mdx
Build ID: a5a5cbc4318c25fe0dda6b9a Build Logs: View logs
URL: https://www.apollographql.com/docs/deploy-preview/a5a5cbc4318c25fe0dda6b9a
Going back to draft status because this PR needs a rework to make better use of ConnectSpec version gating to ensure backwards/forwards compatibility.
@benjamn, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.
Update: this PR has gotten a lot simpler (just two commits now!), but I still need to add proper ConnectSpec version gating, so we'll be in Draft until then.