-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.graphqls
197 lines (171 loc) · 3.79 KB
/
schema.graphqls
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
schema {
query: Query
mutation: Mutation
}
type Query {
# Albums queries
album(id: String): Album
albumBySlug(slug: String): Album
albums(offset: Int, limit: Int): [Album]
albumsPage(perPage: Long, page: Long, lang: String, sortOptions: [SortOption]): AlbumsPage
albumsRecommended(albumId: String, limit: Int): [Album]
albumsByNameEntry(nameEntry: String, limit: Long): [Album]
totalAlbums: Long
# Artists queries
artist(id: String): Artist
artistBySlug(slug: String): Artist
artists(offset: Int, limit: Int): [Artist]
artistsByNameEntry(nameEntry: String, limit: Long): [Artist]
artistsRecommended(artistId: String, limit: Int): [Artist]
totalArtists: Long
# User queries
currentUser: User
languages: [Language]
# Search queries
findByNameEntry(nameEntry: String, perPage: Int, page: Int): PaginatedSearchResult
findAlbumsByNameEntry(nameEntry: String, perPage: Int, page: Int): PaginatedSearchResult
findArtistsByNameEntry(nameEntry: String, perPage: Int, page: Int): PaginatedSearchResult
# Reporting queries
getTopArtistByArea(count: Int): [Pair]
getTopLanguagesForAlbum(count: Int): [Pair]
getNumberOfAlbumsPerYear(count: Int): [Pair]
}
type Mutation {
# Albums mutations
createAlbum(album: AlbumInput!): Album
updateAlbum(album: AlbumInput!): Album
deleteAlbum(id: String!): Boolean
deleteTrackInAlbum(albumId: String, trackId: String): Album
saveAlbumTracks(albumId: String, tracks: [TrackInput]): Album
updateAlbumTrack(albumId: String, track: TrackInput): Album
addTrackToAlbum(albumId: String, track: TrackInput): Track
changeAlbumRating(albumId: String!, rating: Float!): Float
# Artists mutations
createArtist(artist: ArtistInput!): Artist
updateArtist(artist: ArtistInput!): Artist
deleteArtist(id: String!): Boolean
changeArtistRating(artistId: String!, rating: Float!): Float
recomputeStatistics: Boolean
}
type Album {
id: String!
artists: [Artist]
tracks: [Track]
name: String
style: String
barcode: String
coverImageUrl: String
imagesUrls: [String]
status: String
packaging: String
language: String
script: String
mbid: String
format: String
country: String
slug: String
rating: Float
releasedDateDay: Date
}
type Artist {
id: String!
albums: [Album]
name: String
gender: String
rating: Float
profileImageUrl: String
imagesUrls: [String]
disambiguationComment: String
mbid: String
area: String
slug: String
ipi: String
isni: String
beginDateDay: Date
endDateDay: Date
}
type Track {
id: String!
name: String
length: Long
position: Long
}
type User {
username: String
firstName: String
lastName: String
password: String
}
type Language {
id: String
name: String
}
type PaginatedSearchResult {
pagination: Pagination
results: [SearchResult]
}
type Pagination {
perPage: Long
items: Long
page: Long
pages: Long
}
type SearchResult {
id: String
name: String
type: String
imageUrl: String
slug: String
}
type Pair {
key: String
value: String
}
type AlbumsPage {
pagination: Pagination
results: [Album]
}
input AlbumInput {
_id: String
name: String
style: String
barcode: String
status: String
packaging: String
language: String
script: String
mbid: String
format: String
country: String
coverImageUrl: String
artists: [ArtistInput]
tracks: [TrackInput]
released_date: Date
}
input ArtistInput {
_id: String
name: String
gender: String
rating: Float
profileImageUrl: String
imagesUrls: [String]
disambiguationComment: String
albums: [AlbumInput]
ipi: String
isni: String
mbid: String
area: String
begin_date: Date
end_date: Date
}
input TrackInput {
_id: String
name: String
length: Long
position: Long
}
input SortOption {
order: String
fields: [String]
}
scalar Date