ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.27k stars 748 forks source link

[Fusion] Fixed duplicated selections #7677

Closed tobias-tengler closed 2 weeks ago

tobias-tengler commented 3 weeks ago

Fixes #7687

tobias-tengler commented 3 weeks ago

Just noticed another issue that has also existed previously: Selections on interfaces are inlined into object type selections, but not explicitly forwarded to subgraphs.

Original query:

communityItems(first: 3) {
  nodes {
    __typename
    ... on CommunityDiscussion {
      databaseId
    }
    ... on ProductQuestion {
      databaseId
    }
    ... on ProductReview {
      databaseId
    }
    ... on Node {
      __isNode: __typename
      id
    }
  }
}

Subgraph query:

communityItems(first: 3) {
  nodes {
    __typename
    ... on CommunityDiscussion {
      __typename
      databaseId
      __isNode: __typename
      id
    }
    ... on ProductQuestion {
      __typename
      databaseId
      __isNode: __typename
      id
    }
    ... on ProductReview {
      __typename
      databaseId
      __isNode: __typename
      id
    }
  }
}
codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.00%. Comparing base (02b1ca8) to head (1121c64). Report is 34 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #7677 +/- ## ========================================== + Coverage 73.95% 74.00% +0.05% ========================================== Files 2917 2918 +1 Lines 151116 151252 +136 Branches 17560 17576 +16 ========================================== + Hits 111753 111936 +183 + Misses 33507 33465 -42 + Partials 5856 5851 -5 ``` | [Flag](https://app.codecov.io/gh/ChilliCream/graphql-platform/pull/7677/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChilliCream) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/ChilliCream/graphql-platform/pull/7677/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChilliCream) | `74.00% <ø> (+0.05%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChilliCream#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.