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).
Found this edge case when working on https://github.com/apollographql/apollo-ios/issues/3424.
Schema
Operation
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
).