-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
110 lines (85 loc) · 1.63 KB
/
schema.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
# ---------- Image ----------
type Image {
url: String!
width: Int!
height: Int!
}
# ---------- Person ----------
type Person {
id: ID!
name: String!
image: Image
}
# ---------- CastMember ----------
type CastMember {
person: Person!
characters: [String!]
}
# ---------- Certificate ----------
enum Certificate {
CERTIFICATE_UNSPECIFIED
CERTIFICATE_G
CERTIFICATE_NR
CERTIFICATE_PG_13
CERTIFICATE_PG
CERTIFICATE_R
}
# ---------- MovieRatingsSummary ----------
type MovieRatingsSummary {
aggregateRating: Float!
voteCount: Int!
}
# ---------- Movie ----------
type Movie {
id: ID!
name: String!
description: String!
cast: [CastMember!]!
certificate: Certificate!
genres: [String!]!
image: Image
rank: Int!
ratingsSummary: MovieRatingsSummary!
releaseYear: Int!
runtime: Int!
tagline: String
}
# ----- MoviesRequest -----
input FilterParams {
certs: [Certificate!]
}
enum SortParam {
SORT_PARAM_RANK_ASC
}
input PageSpec {
page: Int!
perPage: Int!
}
input MoviesRequest {
filters: FilterParams
sort: SortParam
pageSpec: PageSpec
}
# ----- MoviesResponse -----
type PaginationInfo {
# Total number of pages
totalPages: Int!
# Total number of items
totalItems: Int!
# Current page number
page: Int!
# Number of items per page
perPage: Int!
# When paginating forwards, are there more items?
hasNextPage: Boolean!
# When paginating backwards, are there more items?
hasPreviousPage: Boolean!
}
type MoviesResponse {
movies: [Movie!]!
pageInfo: PaginationInfo!
}
# ---------- Queries ----------
type Query {
movies(input: MoviesRequest!): MoviesResponse!
}