Complete the code to declare an interface named Character.
interface [1] { id: ID! name: String! }The keyword interface is followed by the interface name, here Character.
Complete the code to make the type Human implement the Character interface.
type Human implements [1] { id: ID! name: String! homePlanet: String }The type Human implements the interface Character using the implements keyword.
Fix the error in the query to fetch the name from a Character interface type.
query { character(id: "1000") { [1] } }The interface Character guarantees the field name, so it can be queried safely.
Fill both blanks to query the name and homePlanet of a Human type implementing Character.
query { human(id: "1000") { [1] [2] } }The Human type implements Character and adds homePlanet. Both fields can be queried.
Fill all three blanks to define an interface and two types implementing it with a shared field.
interface [1] { id: ID! name: String! } type [2] implements [1] { id: ID! name: String! age: Int } type Droid implements [1] { id: ID! name: String! primaryFunction: String }
The interface Character is implemented by types Human and Droid. Both share id and name.