Dominic Grimm
860ae7ed5e
All checks were successful
continuous-integration/drone/push Build is passing
93 lines
1.5 KiB
GraphQL
93 lines
1.5 KiB
GraphQL
type Config {
|
|
minimumTeacherSelectionCount: Int!
|
|
}
|
|
|
|
type Query {
|
|
admins: [User!]!
|
|
allStudentsVoted: Boolean!
|
|
config: Config!
|
|
me: User!
|
|
ok: Boolean!
|
|
student(id: Int!): Student!
|
|
students: [Student!]!
|
|
studentsCanVote: Boolean!
|
|
teacher(id: Int!): Teacher!
|
|
teacherVote(id: Int!): TeacherVote!
|
|
teacherVotes: [TeacherVote!]!
|
|
teachers: [Teacher!]!
|
|
user(id: Int!): User!
|
|
userByUsername(username: String!): User!
|
|
users: [User!]!
|
|
vote(id: Int!): Vote!
|
|
votes: [Vote!]!
|
|
}
|
|
|
|
type Student {
|
|
id: Int!
|
|
user: User!
|
|
vote: Vote
|
|
}
|
|
|
|
type Teacher {
|
|
id: Int!
|
|
maxStudents: Int!
|
|
teacherVotes: [TeacherVote!]!
|
|
user: User!
|
|
}
|
|
|
|
type TeacherVote {
|
|
id: Int!
|
|
priority: Int!
|
|
teacher: Teacher!
|
|
vote: Vote!
|
|
}
|
|
|
|
type User {
|
|
admin: Boolean!
|
|
email: String!
|
|
externalId: Int!
|
|
firstName: String!
|
|
id: Int!
|
|
lastName: String!
|
|
name(formal: Boolean! = true): String!
|
|
role: UserRole!
|
|
student: Student
|
|
teacher: Teacher
|
|
username: String!
|
|
}
|
|
|
|
enum UserRole {
|
|
Student
|
|
Teacher
|
|
}
|
|
|
|
type Vote {
|
|
id: Int!
|
|
student: Student!
|
|
teacherVotes: [TeacherVote!]!
|
|
}
|
|
|
|
type LoginPayload {
|
|
bearer: String!
|
|
token: String!
|
|
user: User!
|
|
}
|
|
|
|
type Mutation {
|
|
assignStudents: Boolean!
|
|
createUser(checkLdap: Boolean! = true, input: UserCreateInput!): User!
|
|
createVote(input: VoteCreateInput!): Vote!
|
|
deleteUser(id: Int!): Int!
|
|
login(password: String!, username: String!): LoginPayload!
|
|
}
|
|
|
|
input UserCreateInput {
|
|
username: String!
|
|
role: UserRole!
|
|
admin: Boolean! = false
|
|
}
|
|
|
|
input VoteCreateInput {
|
|
teacherIds: [Int!]!
|
|
}
|