I'm generating queries based on this graphql scheme:
type Query {
animals: [AnimalResult]!
}
union AnimalResult = Dog | Cat
type Dog {
example: [Something!]!
}
type Cat {
example: [Something!]!
}
type Something {
id: ID!
}
I would expect that a animals.gql would be generated:
query animals{
animals{
... on Dog {
example{
id
}
}
... on Cat {
example{
id
}
}
}
}
But I obtain this:
query animals{
animals{
... on Dog {
example{
id
}
}
... on Cat {
}
}
}
I'm generating queries based on this graphql scheme:
I would expect that a
animals.gql
would be generated:But I obtain this:
As you can see id field in
Cat
is not included.Is this a bug? I would like to fix this, I think it could be something about this loop: https://github.com/timqian/gql-generator/blob/master/index.js#L140