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