Polymorphism

In that case you can use the following,

query  { 
  queryFarm {
    animals {
        id
        name
        ... on Cow {  color  }
        ... on Pig {  weight  }
      }
  }
}
1 Like