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

[Fusion] Add failing tests for selections below shared, non-refetchable field #7950

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

tobias-tengler
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.41%. Comparing base (02a5cc1) to head (92e72a8).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7950      +/-   ##
==========================================
+ Coverage   74.39%   74.41%   +0.02%     
==========================================
  Files        2880     2880              
  Lines      150378   150432      +54     
  Branches    17487    17494       +7     
==========================================
+ Hits       111871   111947      +76     
+ Misses      32691    32670      -21     
+ Partials     5816     5815       -1     
Flag Coverage Δ
unittests 74.41% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tobias-tengler tobias-tengler force-pushed the tte/fusion-bug-with-shared-field branch 6 times, most recently from 957e630 to a50be56 Compare January 27, 2025 07:07
@tobias-tengler tobias-tengler changed the title [Fusion] Add error reproduction [Fusion] Add failing tests for selections below shared, non-refetchable field Jan 27, 2025
@tobias-tengler tobias-tengler marked this pull request as ready for review January 27, 2025 12:28
@tobias-tengler tobias-tengler force-pushed the tte/fusion-bug-with-shared-field branch from 5103ad8 to 818bbc4 Compare January 27, 2025 12:29
@tobias-tengler tobias-tengler added the 👓 ready-for-review The PR is ready for review. label Jan 27, 2025
Comment on lines -800 to +802
var typeMetadata = _config.GetType<ObjectTypeMetadata>(path.Selection.DeclaringType.Name);
var typeMetadata = _config.GetType<ObjectTypeMetadata>(current.Selection.DeclaringType.Name);

if (!typeMetadata.Fields[path.Selection.Field.Name].Bindings.ContainsSubgraph(subgraphName))
if (!typeMetadata.Fields[current.Selection.Field.Name].Bindings.ContainsSubgraph(subgraphName))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ensures that we fail the query plan generation early instead of either failing later or producing an invalid query plan that fails at runtime.

Comment on lines -38 to +39
sb.Append('/');
sb.Append(Selection.ResponseName);
sb.Insert(0, '/');
sb.Insert(1, current.Selection.ResponseName);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is purely for debugging purposes. Previously the ToString would return something like name/brand/productById instead of productById/brand/name which would be more helpful to understand the path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant