-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.gql
109 lines (91 loc) · 2.45 KB
/
schema.gql
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
type Query {
getUserProfile(userId: Long!): UserProfile
getArtistRecommendations(
userId: Long!,
field: FieldType!=ARTIST,
limit: Int,
walks: Int,
walkLength: Int,
resetProbability: Float
): Recommendations @rest(url: "http://quick-app-recommender/recommendation",
pathParameter: ["userId", "field"],
queryParameter: ["limit", "walks", "walkLength", "resetProbability"])
}
type Subscription {
listeningEventUpdate: ListeningEvent @topic(name: "listeningevents")
}
type Mutation {
sendListeningEvent(userId: Long!, event: ListeningEventInput!): ListeningEvent @topic(name: "listeningevents")
}
enum FieldType {
ARTIST
ALBUM
TRACK
}
type Recommendations {
recommendations: [Recommendation!]!
}
type Recommendation {
id: Long!
artist: Item @topic(name: "artists", keyField: "id")
}
type UserProfile {
totalListenCount: Long! @topic(name: "counts", keyArgument: "userId")
firstListenEvent: Long! @topic(name: "firstlisten", keyArgument: "userId")
lastListenEvent: Long! @topic(name: "lastlisten", keyArgument: "userId")
artistCharts: NamedArtistCharts! @topic(name: "topartists", keyArgument: "userId")
albumCharts: NamedAlbumCharts! @topic(name: "topalbums", keyArgument: "userId")
trackCharts: NamedTrackCharts! @topic(name: "toptracks", keyArgument: "userId")
}
type ListeningEvent {
userId: Long!
artistId: Long!
albumId: Long!
trackId: Long!
timestamp: Long!
artist: Item @topic(name: "artists", keyField: "artistId")
album: Item @topic(name: "albums", keyField: "albumId")
track: Item @topic(name: "tracks", keyField: "trackId")
}
input ListeningEventInput {
userId: Long!
artistId: Long!
albumId: Long!
trackId: Long!
timestamp: Long!
}
type Item {
id: Long!
name: String!
}
type Charts {
topK: [ChartRecord!]!
}
type ChartRecord {
id: Long!
countPlays: Long!
}
type NamedArtistCharts {
topK: [NamedArtistCount!]!
}
type NamedAlbumCharts {
topK: [NamedAlbumCount!]!
}
type NamedTrackCharts {
topK: [NamedTrackCount!]!
}
type NamedArtistCount {
id: Long!
artist: Item! @topic(name: "artists", keyField: "id")
countPlays: Long!
}
type NamedAlbumCount {
id: Long!
album: Item! @topic(name: "albums", keyField: "id")
countPlays: Long!
}
type NamedTrackCount {
id: Long!
track: Item! @topic(name: "tracks", keyField: "id")
countPlays: Long!
}