Skip to content

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

Open
@calvincestari

Description

@calvincestari

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).

Metadata

Metadata

Assignees

Labels

bugGenerally incorrect behaviorcodegenIssues related to or arising from code generation

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions