1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
interface Character {
id: ID!
name: String!
friends: [Character]
friendsConnection(first: Int, after: ID): FriendsConnection!
appearsIn: [Episode]!
}
input ColorInput {
red: Int!
green: Int!
blue: Int!
}
type Droid implements Character {
id: ID!
name: String!
friends: [Character]
friendsConnection(first: Int, after: ID): FriendsConnection!
appearsIn: [Episode]!
primaryFunction: String
}
enum Episode {
NEWHOPE
EMPIRE
JEDI
}
type FriendsConnection {
totalCount: Int
edges: [FriendsEdge]
friends: [Character]
pageInfo: PageInfo!
}
type FriendsEdge {
cursor: ID!
node: Character
}
type Human implements Character {
id: ID!
name: String!
homePlanet: String
height(unit: LengthUnit = METER): Float
mass: Float
friends: [Character]
friendsConnection(first: Int, after: ID): FriendsConnection!
appearsIn: [Episode]!
starships: [Starship]
}
enum LengthUnit {
METER
FOOT
}
type Mutation {
createReview(episode: Episode, review: ReviewInput!): Review
}
type PageInfo {
startCursor: ID
endCursor: ID
hasNextPage: Boolean!
}
type Query {
hero(episode: Episode): Character
reviews(episode: Episode!): [Review]
search(text: String): [SearchResult]
character(id: ID!): Character
droid(id: ID!): Droid
human(id: ID!): Human
starship(id: ID!): Starship
}
type Review {
episode: Episode
stars: Int!
commentary: String
}
input ReviewInput {
stars: Int!
commentary: String
favorite_color: ColorInput
}
union SearchResult = Human | Droid | Starship
type Starship {
id: ID!
name: String!
length(unit: LengthUnit = METER): Float
coordinates: [[Float!]!]
}
type Subscription {
reviewAdded(episode: Episode): Review
}
|