-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
schema.graphql
186 lines (164 loc) · 3.73 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
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
type CurrentUser {
id: Int!
"""
The user's display name (may differ from their login name).
"""
name: String!
"""
The name the user logs in with (may differ from their display name).
"""
loginName: String!
email: String!
emailVerified: Boolean!
acceptedPrivacyVersion: Int!
acceptedTermsVersion: Int!
acceptedUsePolicyVersion: Int!
locale: String
permissions: SbPermissions!
}
"""
Implement the DateTime<Utc> scalar
The input/output is a string in RFC3339 format.
"""
scalar DateTime
type Mutation {
createNewsPost(post: NewsPostCreation!): NewsPost!
updateCurrentUser(currentPassword: String!, changes: UpdateCurrentUserChanges!): CurrentUser!
updateUserPermissions(userId: Int!, permissions: SbPermissionsInput!): SbUser!
}
type NewsPost {
id: UUID!
coverImagePath: String
title: String!
summary: String!
content: String!
publishedAt: DateTime
updatedAt: DateTime!
author: SbUser
}
type NewsPostConnection {
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
"""
A list of edges.
"""
edges: [NewsPostEdge!]!
"""
A list of nodes.
"""
nodes: [NewsPost!]!
}
input NewsPostCreation {
authorId: Int
title: String!
summary: String!
content: String!
publishedAt: DateTime
}
"""
An edge in a connection.
"""
type NewsPostEdge {
"""
The item at the end of the edge
"""
node: NewsPost!
"""
A cursor for use in pagination
"""
cursor: String!
}
"""
Information about pagination in a connection
"""
type PageInfo {
"""
When paginating backwards, are there more items?
"""
hasPreviousPage: Boolean!
"""
When paginating forwards, are there more items?
"""
hasNextPage: Boolean!
"""
When paginating backwards, the cursor to continue.
"""
startCursor: String
"""
When paginating forwards, the cursor to continue.
"""
endCursor: String
}
type Query {
newsPosts(includeUnpublished: Boolean, after: String, before: String, first: Int, last: Int): NewsPostConnection!
user(id: Int!): SbUser
userByDisplayName(name: String!): SbUser
currentUser: CurrentUser
}
type SbPermissions {
"""
The user ID these permissions are for. This is mainly so the client has a key for caching
purposes, and is not generally used elsewhere.
"""
id: Int!
editPermissions: Boolean!
debug: Boolean!
banUsers: Boolean!
manageLeagues: Boolean!
manageMaps: Boolean!
manageMapPools: Boolean!
manageMatchmakingSeasons: Boolean!
manageMatchmakingTimes: Boolean!
manageRallyPointServers: Boolean!
massDeleteMaps: Boolean!
moderateChatChannels: Boolean!
manageNews: Boolean!
manageBugReports: Boolean!
}
input SbPermissionsInput {
"""
The user ID these permissions are for. This is mainly so the client has a key for caching
purposes, and is not generally used elsewhere.
"""
id: Int!
editPermissions: Boolean!
debug: Boolean!
banUsers: Boolean!
manageLeagues: Boolean!
manageMaps: Boolean!
manageMapPools: Boolean!
manageMatchmakingSeasons: Boolean!
manageMatchmakingTimes: Boolean!
manageRallyPointServers: Boolean!
massDeleteMaps: Boolean!
moderateChatChannels: Boolean!
manageNews: Boolean!
manageBugReports: Boolean!
}
type SbUser {
id: Int!
"""
The user's display name (may differ from their login name).
"""
name: String!
permissions: SbPermissions!
}
"""
A UUID is a unique 128-bit number, stored as 16 octets. UUIDs are parsed as
Strings within GraphQL. UUIDs are used to assign unique identifiers to
entities without requiring a central allocating authority.
# References
* [Wikipedia: Universally Unique Identifier](http://en.wikipedia.org/wiki/Universally_unique_identifier)
* [RFC4122: A Universally Unique IDentifier (UUID) URN Namespace](http://tools.ietf.org/html/rfc4122)
"""
scalar UUID
input UpdateCurrentUserChanges {
email: String
newPassword: String
}
schema {
query: Query
mutation: Mutation
}