apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
813 stars 271 forks source link

fix(demand_control): use correct parent type in fragment definitions #6162

Closed goto-bus-stop closed 1 month ago

goto-bus-stop commented 1 month ago

Prerequisite for https://github.com/apollographql/router/pull/6013.

Fixes errors like:

Attempted to look up a field on type MyInterface, but the field does not exist

Fragment definitions have a type condition, and all selections inside the fragment are executed against that type condition. Previously, the demand control cost calculator executed them against the parent type where the fragment is used, which is often different.


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

[^1]: It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. [^2]: Configuration is an important part of many changes. Where applicable please try to document configuration examples. [^3]: Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

svc-apollo-docs commented 1 month ago

✅ Docs Preview Ready

No new or changed pages found.

github-actions[bot] commented 1 month ago

@goto-bus-stop, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

router-perf[bot] commented 1 month ago

CI performance tests

goto-bus-stop commented 1 month ago

oops, i had enabled auto-merge. I'll follow up with a changeset