Skip to content

Commit 373c6e5

Browse files
author
Sashko Stubailo
committed
Add reviews as a very simple mutation, stick to enum for episode
1 parent 2a1cdfd commit 373c6e5

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

site/docs/_swapiSchema.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ schema {
2424
2525
type Query {
2626
hero(episode: Episode): Character
27+
reviews(episode: Episode!): [Review]
2728
search(text: String): [SearchResult]
2829
droid(id: ID!): Droid
2930
human(id: ID!): Human
3031
starship(id: ID!): Starship
3132
}
3233
3334
type Mutation {
34-
createHuman(human: HumanInput!): ID!
35-
incrementCredits(humanId: ID!): Human
35+
createReview(episode: Episode, review: ReviewInput!): Review
3636
}
3737
3838
# The episodes in the Star Wars trilogy
@@ -101,13 +101,21 @@ type Droid implements Character {
101101
primaryFunction: String
102102
}
103103
104-
# The object to be passed in when creating a new human
105-
input HumanInput {
106-
# The name of the new human
107-
name: String!
104+
type Review {
105+
# The number of stars this review gave, 1-5
106+
stars: Int
108107
109-
# The movies this human appears in
110-
appearsIn: [Episode]!
108+
# Comments about the movie
109+
commentary: String
110+
}
111+
112+
# The input object sent when someone is creating a new review
113+
input ReviewInput {
114+
# 0-5 stars
115+
stars: Int
116+
117+
# Comments about the movie
118+
commentary: String
111119
}
112120
113121
# Units of length

0 commit comments

Comments
 (0)