180 lines
3.5 KiB
GraphQL
180 lines
3.5 KiB
GraphQL
"The `Boolean` scalar type represents `true` or `false`."
|
|
scalar Boolean
|
|
|
|
type Config {
|
|
minimumTeacherSelectionCount: Int!
|
|
}
|
|
|
|
"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point)."
|
|
scalar Float
|
|
|
|
"The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID."
|
|
scalar ID
|
|
|
|
"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1."
|
|
scalar 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!]
|
|
}
|
|
|
|
"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text."
|
|
scalar String
|
|
|
|
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!
|
|
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 __Directive {
|
|
args: [__InputValue!]!
|
|
description: String
|
|
locations: [String!]!
|
|
name: String!
|
|
}
|
|
|
|
type __EnumValue {
|
|
deprecationReason: String
|
|
description: String
|
|
isDeprecated: Boolean!
|
|
name: String!
|
|
}
|
|
|
|
type __Field {
|
|
args: [__InputValue!]!
|
|
deprecationReason: String
|
|
description: String
|
|
isDeprecated: Boolean!
|
|
name: String!
|
|
type: __Type!
|
|
}
|
|
|
|
type __InputValue {
|
|
defaultValue: String
|
|
description: String
|
|
name: String!
|
|
type: __Type!
|
|
}
|
|
|
|
type __Schema {
|
|
directives: [__Directive!]!
|
|
mutationType: __Type
|
|
queryType: __Type!
|
|
subscriptionType: __Type
|
|
types: [__Type!]!
|
|
}
|
|
|
|
type __Type {
|
|
description: String
|
|
enumValues(includeDeprecated: Boolean! = false): [__EnumValue!]
|
|
fields(includeDeprecated: Boolean! = false): [__Field!]
|
|
inputFields: [__InputValue!]
|
|
interfaces: [__Type!]
|
|
kind: __TypeKind!
|
|
name: String
|
|
ofType: __Type
|
|
possibleTypes: [__Type!]
|
|
}
|
|
|
|
enum __TypeKind {
|
|
ENUM
|
|
INPUT_OBJECT
|
|
INTERFACE
|
|
LIST
|
|
NON_NULL
|
|
OBJECT
|
|
SCALAR
|
|
UNION
|
|
}
|
|
|
|
type LoginPayload {
|
|
bearer: String!
|
|
token: String!
|
|
user: User!
|
|
}
|
|
|
|
type Mutation {
|
|
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 VoteCreateInput {
|
|
teacherIds: [Int!]!
|
|
}
|