This repository has been archived by the owner on Dec 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
147 lines (115 loc) · 3.01 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
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
schema {
query: Query
mutation: Mutation
}
# Query stuff from Bemuse internet ranking system here!
type Query {
# Query a chart by its MD5.
chart(md5: String!): Chart
# The current player.
me(playerToken: String!): Self
# Queries a player by name
player(name: String!): PublicPlayerData
}
# Do stuff
type Mutation {
# Register a player (or return an existing one)
registerPlayer(name: String!): PublicPlayerData
# Link player to an auth account
linkPlayer(jwt: String!): PublicPlayerData
# Saves the score
registerScore(
playerToken: String!,
md5: String!,
playMode: String!,
input: RegisterScoreInput!
): RegisterScoreResult
# Exchanges the Auth0 ID token for player token
authenticatePlayer(jwt: String!): PlayerAuthenticationResult
# Renews the player token
renewPlayerToken(playerToken: String!): PlayerAuthenticationResult
}
# Result of player authentication
type PlayerAuthenticationResult {
playerToken: String!
}
# Result of saving the score
input RegisterScoreInput {
score: Int!
combo: Int!
count: [Int]!
total: Int!
log: String!
}
type RegisterScoreResult {
resultingRow: LeaderboardRow
level: Level
}
# The current player.
type Self {
# Queries my own record of charts.
records(md5s: [String]): [ChartRankingEntry]
}
type ChartRankingEntry {
md5: String!
playMode: String!
entry: RankingEntry
}
# A publicly-accessible player data
type PublicPlayerData {
# The player’s name
name: String!
# Is the player name linked to an auth account
linked: Boolean!
# The player’s ID
id: String!
}
# A notechart (.bms, .bmson) file, identified by its file hash (MD5).
# In Bemuse, different play mode is a different Level and thus has a
# different scoreboard.
type Chart {
# Query a level by play mode (KB or BM).
level(playMode: String!): Level
}
# A Level is identified by a chart’s hash and its play mode.
# Each Level has its own scoreboard.
type Level {
# A leaderboard associated with this level.
leaderboard(max: Int): [LeaderboardRow]
# A leaderboard associated with this level.
myRecord(playerToken: String!): LeaderboardRow
}
# A leaderboard row
type LeaderboardRow {
# The ranking.
rank: Int!
# The ranking entry.
entry: RankingEntry!
}
# A ranked entry in the leaderboard.
type RankingEntry {
# An internal ID used by the internet ranking system.
id: String!
# The chart’s MD5 hash.
md5: String!
# The play mode.
playMode: String!
# The score (ranges from 0–555555).
score: Int!
# Total number of notes (long note head and tail counted as separate note).
total: Int!
# The maximum combo attained.
combo: Int!
# An array of [Meticulous, Precise, Good, Offbeat, Missed] count.
count: [Int]
# A string representing the replay.
log: String
# Total number of plays for this level.
playCount: Int!
# The play number (out of playCount) for this particular score.
playNumber: Int!
# The time when this is recorded
recordedAt: String!
# The player.
player: PublicPlayerData!
}