Closed
Description
Version
3.8.2
Summary
I have set the extend interface Node @typePolicy(keyFields: "id")
.
And when I build, the following error occurs.
Key Field(s) '[id]' are not queried on X2 at Operation(XQuery).union
Steps to reproduce the behavior
union X = X1 | X2
type Query {
x: X!
}
type X1 {
id: ID!
name: String
}
type X2 {
id: ID!
name: String
}
extend interface Node @typePolicy(keyFields: "id")
query XQuery {
x {
... on X1 {
id
name
}
}
}
- build
`Key Field(s) '[id]' are not queried on X2 at Operation(XQuery).union`
I found a workaround. By modifying the Query as follows, the error disappears.
query XQuery {
x {
... on X1 {
id
name
}
... on X2 {
id
}
}
}
Logs
Key Field(s) '[id]' are not queried on X2 at Operation(XQuery).union
Metadata
Metadata
Assignees
Labels
No labels