datarekisteri/client/schema.gql

80 lines
1.5 KiB
Plaintext
Raw Normal View History

2023-01-20 09:20:06 +02:00
scalar Base64
scalar Date
scalar Email
scalar KeyID
2023-04-10 11:37:43 +03:00
scalar PhoneNumber
2023-01-20 09:20:06 +02:00
scalar Time
scalar TokenID
scalar UserID
enum Unit {
Unit
Unit2
}
type PGPKey {
id: KeyID!
user: User!
pgpKeyData: Base64!
expires: Time
uploaded: Time!
comment: String!
}
type Token {
id: TokenID!
user: User!
name: String
tokenData: String!
comment: String!
issued: Time!
expires: Time
permissions: String!
}
type User {
id: UserID!
email: Email
pendingEmail: Email
name: String!
nickname: String!
2023-04-10 11:37:43 +03:00
phoneNumber: PhoneNumber!
2023-01-20 09:20:06 +02:00
birthdate: Date!
homeplace: String!
registered: Time!
accepted: Time
seceded: Time
permissions: String!
isMember: Boolean!
application: String!
}
type Query {
users: [User!]!
user(id: UserID): User
applications: [User!]!
tokens(user: UserID): [Token!]!
keys(user: UserID): [PGPKey!]!
permissions: String!
primaryKey(user: UserID): PGPKey
}
type Mutation {
2023-04-10 11:37:43 +03:00
apply(email: Email!, phoneNumber: PhoneNumber!, password: String!, name: String!, nickname: String, birthdate: Date!, homeplace: String!, application: String!): User!
2023-01-20 09:20:06 +02:00
verifyEmail(secret: String!): Unit!
resendVerificationEmail(user: UserID): Unit!
2023-04-10 11:37:43 +03:00
update(email: Email, phoneNumber: PhoneNumber, password: String, name: String, nickname: String, homeplace: String, user: UserID): User!
2023-01-20 09:20:06 +02:00
newToken(comment: String, name: String, permissions: String): Token!
newKey(comment: String, keyData: Base64!, expires: Time): PGPKey!
accept(user: UserID!): Unit!
reject(user: UserID!): Unit!
}