-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema_service.graphql
118 lines (109 loc) · 2.5 KB
/
schema_service.graphql
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
type Query {
"Returns the list of movies in the database."
movies: [Movie!]!
"Returns the list of users in the database."
users: [User!]!
"Returns the list of directors in the database."
directors: [Director!]!
"Returns the Director with the given ID."
director(
"The ID of the director"
id: ID!
): Director!
}
"Represents a Movie in the movie database."
type Movie {
"The ID of the movie."
id: ID!
"The title of the movie."
title: String!
"The year the movie was released."
year: Int!
"The description of the movie."
description: String!
"The average rating of the movie."
rating: Float
"The director of the movie."
director: Director
}
"Represents a Director in the movie database."
type Director {
"The ID of the director."
id: ID!
"The name of the director."
name: String!
"The biography of the director."
bio: String!
"The movies directed by the director."
movies: [Movie!]
}
"Represents a User in the movie database."
type User {
"The ID of the user."
id: ID!
"The name of the user."
name: String
"The email of the user."
email: String
}
type Mutation {
"Adds a new review to the database."
addReview(
"The input values for the review"
reviewInput: ReviewInput!
): Review!
"Adds a new movie to the database."
addMovie(
"The input values for the movie"
movieInput: MovieInput!
): Movie!
"Adds a new director to the database."
addDirector(
"The input values for the director"
directorInput: DirectorInput!
): Director!
}
"Represents a Review in the movie database."
type Review {
"The ID of the review."
id: ID!
"The user who wrote the review."
user: User
"The movie that was reviewed."
movie: Movie
"The score given by the user."
score: Int!
"The description of the review."
description: String!
}
"Input type for adding a Movie Review."
input ReviewInput {
"ID of the movie"
movieId: ID!
"Score given by the user. Should be between 1 and 5."
score: Int!
"Description of the review."
description: String!
}
"Input type for adding a Movie."
input MovieInput {
"Title of the movie"
title: String!
"Year the movie was released"
year: Int!
"Description of the movie"
description: String!
"ID of the director"
directorId: ID!
}
"Input type for adding a Director."
input DirectorInput {
"Name of the director"
name: String!
"Biography of the director"
bio: String!
}
type Subscription {
"Subscribes to the movies, to get updates when a new movie is published."
movies: Movie!
}