-
Notifications
You must be signed in to change notification settings - Fork 27
/
schema.ts
204 lines (186 loc) · 3.89 KB
/
schema.ts
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
const schema: string = `
type Track {
id: String
album(full: Int): Album
artists(full: Int, throttle: Int): [Artist]
available_markets: [String]
audio_features: AudioFeatures
disc_number: Int
duration_ms: Int
explicit: Boolean
href: String
is_playable: Boolean
name: String
popularity: Int
preview_url: String
track_number: Int
type: String
uri: String
}
type Artist {
id: String
genres: [String]
href: String
name: String
popularity: Int
type: String
uri: String
images: [Image]
top_tracks(country: String): [Track]
albums(album_type: String, throttle: Int, continueOnError: Int, limit: Int): [Album]
related_artists(throttle: Int, continueOnError: Int, limit: Int): [Artist]
}
type SimplifiedArtist {
id: String
href: String
name: String
type: String
uri: String
}
type Album {
id: String
album_type: String
artists: [Artist]
available_markets: [String]
genres: [String]
href: String
label: String
name: String
popularity: Int
release_date: String
release_date_precision: String
type: String
uri: String
images: [Image]
tracks(throttle: Int, continueOnError: Int, limit: Int): [Track]
}
type SimplifiedAlbum {
id: String
album_type: String
artists: [Artist]
available_markets: [String]
href: String
label: String
name: String
type: String
uri: String
}
type PrivateUser {
id: String
birthday: String
country: String
display_name: String
email: String
href: String
product: String
uri: String
tracks(throttle: Int, continueOnError: Int, limit: Int): [SavedTrack]
playlists(throttle: Int, continueOnError: Int, limit: Int): [Playlist]
albums: [SavedAlbum]
top_artists(throttle: Int, continueOnError: Int, limit: Int): [Artist]
top_tracks(throttle: Int, continueOnError: Int, limit: Int): [Track]
images: [Image]
artists(throttle: Int, continueOnError: Int, limit: Int): [Artist]
devices: [Device]
player: Player
}
type SavedTrack {
added_at: String
track: Track
}
type SavedAlbum {
added_at: String
album: Album
}
type PlaylistTrack {
added_at: String
track: Track
added_by: PublicUser
is_local: Boolean
}
type PublicUser {
id: String
display_name: String
href: String
uri: String
playlists: [Playlist]
images: [Image]
}
type Playlist {
id: String
description: String
href: String
name: String
owner: PublicUser
uri: String
tracks(throttle: Int, continueOnError: Int, limit: Int): [PlaylistTrack]
public: Boolean
images: [Image]
}
type AudioFeatures {
id: String
acousticness: String
analysis_url: String
danceability: String
duration_ms: String
energy: String
instrumentalness: String
key: String
liveness: String
loudness: String
mode: String
speechiness: String
tempo: String
time_signature: String
track_href: String
valence: String
}
type Image {
height: Int
url: String
width: Int
}
type Device {
id: String
is_active: Boolean
is_restricted: Boolean
name: String
type: String
volume_percent: Int
}
type PlayerContext {
href: String
type: String
uri: String
}
type Player {
timestamp: String
device: Device
progress_ms: String
is_playing: Boolean
shuffle_state: Boolean
repeat_state: String
item: Track
context: PlayerContext
}
# the schema allows the following query:
type Query {
me: PrivateUser
user(id: String!): PublicUser
track(id: String, name: String): Track
tracks(ids: String!): [Track]
audio_features(trackIds: String!): [AudioFeatures]
audio_feature(trackId: String!): AudioFeatures
artist(id: String, name: String): Artist
artists(ids: String!): [Artist]
album(id: String!): Album
albums(ids: String!): [Album]
playlist(id: String!, userId: String!): Playlist
}
# we need to tell the server which types represent the root query
# and root mutation types. We call them RootQuery and RootMutation by convention.
schema {
query: Query
}
`;
export default schema;