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

Codegen: Merging entity into same type with inclusion condition does not build #3426

Open
calvincestari opened this issue Aug 15, 2024 · 0 comments
Labels
bug Generally incorrect behavior codegen Issues related to or arising from code generation

Comments

@calvincestari
Copy link
Member

Found this edge case when working on #3424.

Schema

type Query {
  allThings: [Thing!]
}

type Thing {
  name: String
  postsInfoByIds: [PostInfo!]
}

interface PostInfo {
  awardings: [AwardingTotal!]
}

type Awarding {
  id: String!
}

type AwardingTotal {
  id: String!
  awardingByCurrentUser: [Awarding!]
  total: Int!
}

type Post implements PostInfo {
  id: String!
  awardings: [AwardingTotal!]
}

Operation

query AllThings_inverted($includeCurrentUserAwards: Boolean = false) {
  allThings {
    name
    postsInfoByIds {
      ... on Post {
        awardings @include(if: $includeCurrentUserAwards) {
          total
        }
      }
      awardings {
        awardingByCurrentUser {
          id
        }
      }
    }
  }
}

Expected: The target node should have a type Awarding without a condition and the merged in field (awardingByCurrentUser) and then a conditional case (IfIncludeCurrentUserAwards) within it that contains the conditional field (total).

@calvincestari calvincestari added bug Generally incorrect behavior codegen Issues related to or arising from code generation labels Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior codegen Issues related to or arising from code generation
Projects
None yet
Development

No branches or pull requests

1 participant