@@ -17,7 +17,7 @@ const typeDefs = /* GraphQL */ `
17
17
mutation: Mutation
18
18
}
19
19
20
- # The query type, represents all of the entry points into our object graph
20
+ " The query type, represents all of the entry points into our object graph"
21
21
type Query {
22
22
hero(episode: Episode): Character
23
23
reviews(episode: Episode!): [Review]
@@ -28,155 +28,155 @@ const typeDefs = /* GraphQL */ `
28
28
starship(id: ID!): Starship
29
29
}
30
30
31
- # The mutation type, represents all updates we can make to our data
31
+ " The mutation type, represents all updates we can make to our data"
32
32
type Mutation {
33
33
createReview(episode: Episode, review: ReviewInput!): Review
34
34
}
35
35
36
- # The episodes in the Star Wars trilogy
36
+ " The episodes in the Star Wars trilogy"
37
37
enum Episode {
38
- # Star Wars Episode IV: A New Hope, released in 1977.
38
+ " Star Wars Episode IV: A New Hope, released in 1977."
39
39
NEWHOPE
40
40
41
- # Star Wars Episode V: The Empire Strikes Back, released in 1980.
41
+ " Star Wars Episode V: The Empire Strikes Back, released in 1980."
42
42
EMPIRE
43
43
44
- # Star Wars Episode VI: Return of the Jedi, released in 1983.
44
+ " Star Wars Episode VI: Return of the Jedi, released in 1983."
45
45
JEDI
46
46
}
47
47
48
- # A character from the Star Wars universe
48
+ " A character from the Star Wars universe"
49
49
interface Character {
50
- # The ID of the character
50
+ " The ID of the character"
51
51
id: ID!
52
52
53
- # The name of the character
53
+ " The name of the character"
54
54
name: String!
55
55
56
- # The friends of the character, or an empty list if they have none
56
+ " The friends of the character, or an empty list if they have none"
57
57
friends: [Character]
58
58
59
- # The friends of the character exposed as a connection with edges
59
+ " The friends of the character exposed as a connection with edges"
60
60
friendsConnection(first: Int, after: ID): FriendsConnection!
61
61
62
- # The movies this character appears in
62
+ " The movies this character appears in"
63
63
appearsIn: [Episode]!
64
64
}
65
65
66
- # Units of height
66
+ " Units of height"
67
67
enum LengthUnit {
68
- # The standard unit around the world
68
+ " The standard unit around the world"
69
69
METER
70
70
71
- # Primarily used in the United States
71
+ " Primarily used in the United States"
72
72
FOOT
73
73
}
74
74
75
- # A humanoid creature from the Star Wars universe
75
+ " A humanoid creature from the Star Wars universe"
76
76
type Human implements Character {
77
- # The ID of the human
77
+ " The ID of the human"
78
78
id: ID!
79
79
80
- # What this human calls themselves
80
+ " What this human calls themselves"
81
81
name: String!
82
82
83
- # Height in the preferred unit, default is meters
83
+ " Height in the preferred unit, default is meters"
84
84
height(unit: LengthUnit = METER): Float
85
85
86
- # Mass in kilograms, or null if unknown
86
+ " Mass in kilograms, or null if unknown"
87
87
mass: Float
88
88
89
- # This human's friends, or an empty list if they have none
89
+ " This human's friends, or an empty list if they have none"
90
90
friends: [Character]
91
91
92
- # The friends of the human exposed as a connection with edges
92
+ " The friends of the human exposed as a connection with edges"
93
93
friendsConnection(first: Int, after: ID): FriendsConnection!
94
94
95
- # The movies this human appears in
95
+ " The movies this human appears in"
96
96
appearsIn: [Episode]!
97
97
98
- # A list of starships this person has piloted, or an empty list if none
98
+ " A list of starships this person has piloted, or an empty list if none"
99
99
starships: [Starship]
100
100
}
101
101
102
- # An autonomous mechanical character in the Star Wars universe
102
+ " An autonomous mechanical character in the Star Wars universe"
103
103
type Droid implements Character {
104
- # The ID of the droid
104
+ " The ID of the droid"
105
105
id: ID!
106
106
107
- # What others call this droid
107
+ " What others call this droid"
108
108
name: String!
109
109
110
- # This droid's friends, or an empty list if they have none
110
+ " This droid's friends, or an empty list if they have none"
111
111
friends: [Character]
112
112
113
- # The friends of the droid exposed as a connection with edges
113
+ " The friends of the droid exposed as a connection with edges"
114
114
friendsConnection(first: Int, after: ID): FriendsConnection!
115
115
116
- # The movies this droid appears in
116
+ " The movies this droid appears in"
117
117
appearsIn: [Episode]!
118
118
119
- # This droid's primary function
119
+ " This droid's primary function"
120
120
primaryFunction: String
121
121
}
122
122
123
- # A connection object for a character's friends
123
+ " A connection object for a character's friends"
124
124
type FriendsConnection {
125
- # The total number of friends
125
+ " The total number of friends"
126
126
totalCount: Int
127
127
128
- # The edges for each of the character's friends.
128
+ " The edges for each of the character's friends."
129
129
edges: [FriendsEdge]
130
130
131
- # A list of the friends, as a convenience when edges are not needed.
131
+ " A list of the friends, as a convenience when edges are not needed."
132
132
friends: [Character]
133
133
134
- # Information for paginating this connection
134
+ " Information for paginating this connection"
135
135
pageInfo: PageInfo!
136
136
}
137
137
138
- # An edge object for a character's friends
138
+ " An edge object for a character's friends"
139
139
type FriendsEdge {
140
- # A cursor used for pagination
140
+ " A cursor used for pagination"
141
141
cursor: ID!
142
142
143
- # The character represented by this friendship edge
143
+ " The character represented by this friendship edge"
144
144
node: Character
145
145
}
146
146
147
- # Information for paginating this connection
147
+ " Information for paginating this connection"
148
148
type PageInfo {
149
149
startCursor: ID
150
150
endCursor: ID
151
151
hasNextPage: Boolean!
152
152
}
153
153
154
- # Represents a review for a movie
154
+ " Represents a review for a movie"
155
155
type Review {
156
- # The number of stars this review gave, 1-5
156
+ " The number of stars this review gave, 1-5"
157
157
stars: Int!
158
158
159
- # Comment about the movie
159
+ " Comment about the movie"
160
160
commentary: String
161
161
}
162
162
163
- # The input object sent when someone is creating a new review
163
+ " The input object sent when someone is creating a new review"
164
164
input ReviewInput {
165
- # 0-5 stars
165
+ " 0-5 stars"
166
166
stars: Int!
167
167
168
- # Comment about the movie, optional
168
+ " Comment about the movie, optional"
169
169
commentary: String
170
170
}
171
171
172
172
type Starship {
173
- # The ID of the starship
173
+ " The ID of the starship"
174
174
id: ID!
175
175
176
- # The name of the starship
176
+ " The name of the starship"
177
177
name: String!
178
178
179
- # Length of the starship, along the longest axis
179
+ " Length of the starship, along the longest axis"
180
180
length(unit: LengthUnit = METER): Float
181
181
}
182
182
0 commit comments