112 lines
1.8 KiB
GraphQL
112 lines
1.8 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!]!
|
|
tokens: [Token!]
|
|
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!
|
|
}
|
|
|
|
scalar Time
|
|
|
|
type Token {
|
|
exp: Time!
|
|
expired: Boolean!
|
|
iat: Time!
|
|
id: UUID!
|
|
}
|
|
|
|
scalar UUID
|
|
|
|
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 {
|
|
createUser(checkLdap: Boolean! = true, input: UserCreateInput!): User
|
|
createVote(input: VoteCreateInput!): Vote
|
|
deleteUser(id: Int!): Int
|
|
login(password: String!, username: String!): LoginPayload
|
|
logout: UUID
|
|
registerTeacher(input: TeacherInput!): Teacher
|
|
revokeToken(token: UUID!): UUID!
|
|
startAssignment: Boolean
|
|
}
|
|
|
|
input TeacherInput {
|
|
maxStudents: Int!
|
|
}
|
|
|
|
input UserCreateInput {
|
|
username: String!
|
|
role: UserRole!
|
|
admin: Boolean! = false
|
|
}
|
|
|
|
input VoteCreateInput {
|
|
teacherIds: [Int!]!
|
|
}
|