schema {
    query: Query
}

type Query {
    hero(episode: Episode): Character
    droid(id: ID!): Droid
    node(id: ID!): Node
}

enum Episode {
    NEWHOPE
    EMPIRE
    JEDI
}

interface Character {
    id: ID!
    name: String!
    friends: [Character]
    appearsIn: [Episode]!
}

interface Node {
  id: ID!
}

type Human implements Character & Node {
    id: ID!
    name: String!
    friends: [Character]
    appearsIn: [Episode]!
    homePlanet: String
}

type Droid implements Character & Node {
    id: ID!
    name: String!
    friends: [Character]
    appearsIn: [Episode]!
    primaryFunction: String
    madeOn: Planet
}

type Planet {
    name : String
    hitBy : Asteroid
}

type Starship implements Node {
    id: ID!
    name : String
}

scalar Asteroid