Repository navigation
Expand file tree
/
Copy pathschema.graphql
More file actions
343 lines (290 loc) · 6.43 KB
/
Copy pathschema.graphql
File metadata and controls
343 lines (290 loc) · 6.43 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
schema {
query: queries
mutation: mutations
}
"""Exposes a URL that specifies the behaviour of this scalar."""
directive @specifiedBy(
"""The URL that specifies the behaviour of this scalar."""
url: String!
) on SCALAR
"""A actor type."""
type Actor {
id: Int
actorFirstName: String
actorLastName: String
actorAvatarUrl: String
actorDob: String
casts: [Cast]
country: Country
createdAt: Float
updatedAt: Float
}
"""An actor input type."""
input ActorInputType {
actorFirstName: String!
actorLastName: String!
actorAvatarUrl: String
actorDob: String
countryId: Int!
}
"""An award associated with movies"""
type Award {
id: Int
awardName: String
awardYear: Int
createdAt: Float
updatedAt: Float
}
"""Used to create a new Award"""
input AwardInput {
awardName: String!
awardYear: Int!
}
"""Represents a single Cast for a Movie"""
type Cast {
id: Int
castFirstName: String
castLastName: String
castAvatarUrl: String
createdAt: Float
updatedAt: Float
actor: Actor
movie: Movie
}
"""Aids with the creation of a new Cast."""
input CastInput {
castFirstName: String!
castLastName: String!
castAvatarUrl: String
actorId: Int!
movieId: Int!
}
"""A country type."""
type Country {
id: Int
countryName: String
createdAt: Float
updatedAt: Float
}
"""A country input type."""
input CountryInputType {
countryName: String!
}
"""A director type."""
type Director {
id: Int
directorFirstName: String
directorLastName: String
directorDob: String
createdAt: Float
updatedAt: Float
}
"""An director input type."""
input DirectorInputType {
directorFirstName: String!
directorLastName: String!
directorDob: String
}
"""Movie type"""
type Movie {
id: Int
movieTitle: String
movieReleaseDate: Float
movieGenre: MovieGenreEnum
movieType: MovieTypeEnum
movieImageUrl: String
movieDurationMins: Int
movieHasBluray: Boolean
reviews: [Review]
awards: [Award]
directors: [Director]
soundtracks: [Soundtrack]
quotes: [Quote]
casts: [Cast]
createdAt: Float
updatedAt: Float
}
"""Possible values for movie genre."""
enum MovieGenreEnum {
HORROR
ADVENTURE
DRAMA
THRILLER
COMEDY
ROMANCE
DOCUMENTARY
ACTION
OTHER
}
"""Used to insert new movies."""
input MovieInput {
movieTitle: String!
movieReleaseDate: String!
movieGenre: MovieGenreEnum!
movieType: MovieTypeEnum!
movieImageUrl: String
movieDurationMins: Int
movieHasBluray: Boolean
}
"""Used to update existing movies."""
input MoviePatch {
movieTitle: String
movieReleaseDate: String
movieGenre: MovieGenreEnum
movieType: MovieTypeEnum
movieImageUrl: String
movieDurationMins: Int
movieHasBluray: Boolean
}
"""Possible values for movie type."""
enum MovieTypeEnum {
TV_SERIES
MOVIE
OTHER
}
"""The root mutation."""
type mutations {
"""Create a single Review."""
createReview(patch: ReviewInput): Review
"""Create a single Quote for a Movie"""
createQuote(patch: QuoteInput): Quote
"""Create a single Soundtrack for a Movie"""
createSoundtrack(patch: SoundtrackInput): Soundtrack
"""Create a single Movie."""
createMovie(patch: MovieInput): Movie
"""Update an existing Movie."""
updateMovie(id: Int!, patch: MoviePatch): Movie
"""Create a single Actor."""
createActor(patch: ActorInputType): Actor
"""Create a single Director."""
createDirector(patch: DirectorInputType): Director
"""Create a single Country."""
createCountry(patch: CountryInputType): Country
"""Create a single Cast for a Movie."""
createCast(patch: CastInput): Cast
"""Create a single User."""
createUser(patch: UserInput): User
"""Update an existing User"""
updateUser(userId: ID!, patch: UserPatch): User
"""Add a Movie to User's movieWishList."""
addToWishList(userId: Int!, movieId: Int!): String
"""Add a Movie to User's movieWatchedList."""
addToWatchedList(userId: Int!, movieId: Int!): String
"""Associate an existing Award with an existing Movie"""
linkMovieAward(movieId: Int!, awardId: Int!): String
"""Associate an existing Director with an existing Movie"""
linkMovieDirector(movieId: Int!, directorId: Int!): String
"""Create a single Award."""
createAward(patch: AwardInput): Award
}
"""The root query."""
type queries {
"""Returns a list of Movies."""
movies: [Movie]
"""Returns a list of Quotes."""
quotes: [Quote]
"""Returns a list of Soundtracks."""
soundtracks: [Soundtrack]
"""Returns a list of Actors."""
actors: [Actor]
"""Returns a list of Casts."""
casts: [Cast]
"""Returns a list of Reviews."""
reviews: [Review]
"""Returns a list of Directors."""
directors: [Director]
"""Returns a list of Countries."""
countries: [Country]
"""Returns a list of Users."""
users: [User]
"""Returns a list of Awards."""
awards: [Award]
}
"""Represents a Quote for a Movie."""
type Quote {
id: Int
quoteCastName: String
quoteText: String
movie: Movie
createdAt: Float
updatedAt: Float
}
"""Aids with creating a new Quote."""
input QuoteInput {
movieId: Int!
quoteCastName: String!
quoteText: String!
}
"""Represents a Movie review."""
type Review {
id: Int
movie: Movie
user: User
reviewText: String
reviewRating: ReviewRatingEnum
createdAt: Float
updatedAt: Float
}
"""A type to aid with the creation of a Review."""
input ReviewInput {
movieId: Int!
userId: Int!
reviewText: String!
reviewRating: ReviewRatingEnum!
}
"""List of allowed values for a Review rating"""
enum ReviewRatingEnum {
ONE_OUT_OF_TEN
TWO_OUT_OF_TEN
THREE_OUT_OF_TEN
FOUR_OUT_OF_TEN
FIVE_OUT_OF_TEN
SIX_OUT_OF_TEN
SEVEN_OUT_OF_TEN
EIGHT_OUT_OF_TEN
NINE_OUT_OF_TEN
TEN_OUT_OF_TEN
}
"""Represents a Soundtrack for a Movie."""
type Soundtrack {
id: Int
movie: Movie
soundtrackName: String
soundtrackComposedBy: String
createdAt: Float
updatedAt: Float
}
"""Aids with creating a new Soundtrack."""
input SoundtrackInput {
movieId: ID!
soundtrackName: String!
soundtrackComposedBy: String!
}
"""A user"""
type User {
id: Int
email: String
password: String
firstName: String
lastName: String
createdAt: Float
updatedAt: Float
movieWatchedList: [Movie]
movieWishList: [Movie]
}
"""Used to create new users"""
input UserInput {
email: String!
password: String!
firstName: String
lastName: String
}
"""A type to aid updating a User type."""
input UserPatch {
email: String
password: String
firstName: String
lastName: String
createdAt: Float
updatedAt: Float
}