Query on polymorphic types
Open
- Dominant language
- Go
- Stars
- 10.8k
- Forks
- 1.3k
- Avg merge
- 2d 36m
- Merged PRs (30d)
- 26
Description
Hi, I have a situation like this:
```
type Query {
GetData: AbstractDataResponse
}
type AbstractDataResponse {
field1: String!
field2: String!
}
type DataResponseTypeA implements AbstractDataResponse {
field3a: String!
}
type DataResponseTypeB implements AbstractDataResponse {
field3:b String!
}
```
I run a query by:
```
{
GetData {
field3a
}
}
```
The resolver, in such situation, returns an instance of `DataResponseTypeA`.
I get the error:
```
Validation error (FieldUndefined@[GetData/field3a]) : Field 'field3a' in type 'AbstractDataResponse' is undefined
```
How could I fix it?
Thank you so much!
Antonio
Contributor guide
Assessment
This issue has not been assessed yet.