This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema.graphql
251 lines (227 loc) · 7.04 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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
"A datetime string with format `Y-m-d H:i:s`, e.g. `2018-01-01 13:00:00`."
scalar DateTime @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime")
"A date string with format `Y-m-d`, e.g. `2011-05-23`."
scalar Date @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Date")
"Object of inputs with details for ordering columns"
input OrderByClause {
"Name of field for sorting"
field: String!
"Sorting direction"
order: SortOrder!
}
"Array if order of sorting types"
enum SortOrder {
ASC
DESC
}
type Query {
"Get list of all users with additinal filters"
users(orderBy: [OrderByClause!] @orderBy): [User!] @paginate(defaultCount: 10)
"Get single user by unique ID"
user(id: ID @eq): User @find
"Get list of all servers with additinal filters"
servers(orderBy: [OrderByClause!] @orderBy): [Server!] @paginate(defaultCount: 10)
"Get single server by unique ID"
server(id: ID @eq): Server @find
"Get list of all groups with additinal filters"
groups(orderBy: [OrderByClause!] @orderBy): [Group!] @paginate(defaultCount: 10)
"Get single group by unique ID"
group(id: ID @eq): Group @find
"Get list of all logs with additinal filters"
logs(orderBy: [OrderByClause!] @orderBy): [Log!] @paginate(defaultCount: 10)
"Get single log message by unique ID"
log(id: ID @eq): Log @find
}
type Mutation {
"Create new user"
createUser(input: UserCreateInput! @spread): User! @create
"Update user details"
updateUser(id: ID!, input: UserUpdateInput! @spread): User! @update
"Delete user"
deleteUser(id: ID!): User @delete
"Create new group"
createGroup(input: GroupCreateInput! @spread): Group! @create
"Update group details"
updateGroup(id: ID!, input: GroupUpdateInput! @spread): Group! @update
"Delete group"
deleteGroup(id: ID!): Group @delete
"Create new server"
createServer(input: ServerCreateInput! @spread): Server! @create
"Update server details"
updateServer(id: ID!, input: ServerUpdateInput! @spread): Server! @update
"Delete server"
deleteServer(id: ID!): Server @delete
"Create new log message"
createLog(input: LogCreateInput! @spread): Log! @create
"Update log message"
updateLog(id: ID!, input: LogUpdateInput! @spread): Log! @update
"Delete log message"
deleteLog(id: ID!): Log @delete
}
"Object with all required details about user"
type User {
"Unique ID of user"
id: ID!
"Full name of user"
name: String!
"Email address, should be unique, will be user for authorization"
email: String!
"Array of groups in which the user is a member of"
groups: [Group!]
"When record was created"
created_at: DateTime
"When record was updated in last time"
updated_at: DateTime
}
input GroupsInput {
sync: [ID!]
connect: [ID!]
disconnect: [ID!]
}
"List of fields which can be filled on user creating stage"
input UserCreateInput {
"Full name of user"
name: String!
"Email address, should be unique, will be user for authorization"
email: String!
"Password of used, will be saved as hash into database"
password: String!
"List of groups to which this object is related"
groups: GroupsInput
}
"List of fields about which will be used for updating information about user"
input UserUpdateInput {
"Full name of user"
name: String
"Email address, should be unique, will be user for authorization"
email: String
"Password of used, will be saved as hash into database"
password: String
"Additional inputs for group management"
groups: GroupsInput
}
"Object with all required details about group"
type Group {
"Unique ID of group"
id: ID!
"Name of group"
name: String!
"Object path in Active Directory or OpenLDAP"
object: String
"List of all users in this group"
users: [User!]
"Amount of users in group"
users_count: Int
"List of all servers trought which users in this group may authorize"
servers: [Server!]
"Amount of servers in group"
servers_count: Int
"When record was created"
created_at: DateTime
"When record was updated in last time"
updated_at: DateTime
}
"List of fields which can be filled on group creating stage"
input GroupCreateInput {
"Name of group"
name: String!
"Object path in Active Directory or OpenLDAP"
object: String
}
"List of fields about which will be used for updating information about group"
input GroupUpdateInput {
"Name of group"
name: String
"Object path in Active Directory or OpenLDAP"
object: String
}
"Object with all required details about server"
type Server {
"Unique ID of server"
id: ID!
"Hostname of server"
hostname: String!
"Token which should be added to each query, by validation reasons"
token: String
"IPv4 of server"
ipv4: String
"IPv6 of server"
ipv6: String
"List of user groups which can login trougth this server"
groups: [Group!]
"List of all users which may connect to this server"
users: [User!]
"Amount of users in group"
users_count: Int
"When record was created"
created_at: DateTime
"When record was updated in last time"
updated_at: DateTime
}
"List of fields which can be filled on server creating stage"
input ServerCreateInput {
"Hostname of server"
hostname: String!
"Handshake token"
token: String
"IPv4 of server"
ipv4: String
"IPv6 of server"
ipv6: String
"Object path in Active Directory or OpenLDAP"
object: String
"Additional inputs for group management"
groups: GroupsInput
}
"List of fields about which will be used for updating information about group"
input ServerUpdateInput {
"Hostname of server"
hostname: String
"IPv4 of server"
ipv4: String
"IPv6 of server"
ipv6: String
"Object path in Active Directory or OpenLDAP"
object: String
"Additional inputs for group management"
groups: GroupsInput
}
"Object with all required details about log message"
type Log {
"Unique ID of log message"
id: ID!
"Code number of error for simplification"
code: Int!
"Body of message"
message: String
"Object of user who tirggeren this log message"
user: User
"On which server was the event"
server: Server
"When record was created"
created_at: DateTime
"When record was updated in last time"
updated_at: DateTime
}
"List of fields which can be filled on log event creating stage"
input LogCreateInput {
"Code number of error for simplification"
code: Int!
"Message body"
message: String
"User ID, which triggered this message"
user_id: Int
"Server ID, on which this message was triggered"
server_id: Int
}
"List of fields about which will be used for updating information about log event"
input LogUpdateInput {
"Code number of error for simplification"
code: Int!
"Message body"
message: String
"User ID, which triggered this message"
user_id: Int
"Server ID, on which this message was triggered"
server_id: Int
}