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