50 lines
987 B
GraphQL
50 lines
987 B
GraphQL
directive @isAuthenticated on FIELD_DEFINITION
|
|
directive @isAdmin on FIELD_DEFINITION
|
|
|
|
scalar DateTime
|
|
|
|
type User {
|
|
id: Int!
|
|
email: String!
|
|
isActive: Boolean!
|
|
isAdmin: Boolean!
|
|
createdAt: DateTime!
|
|
}
|
|
|
|
type Client {
|
|
id: Int!
|
|
clientId: String!
|
|
name: String!
|
|
isConfidential: Boolean!
|
|
redirectUris: [String!]!
|
|
createdAt: DateTime!
|
|
}
|
|
|
|
type AuditEvent {
|
|
id: Int!
|
|
eventType: String!
|
|
actorId: Int
|
|
ip: String
|
|
userAgent: String
|
|
metadata: String
|
|
createdAt: DateTime!
|
|
}
|
|
|
|
type AuthPayload {
|
|
accessToken: String!
|
|
tokenType: String!
|
|
}
|
|
|
|
type Query {
|
|
me: User! @isAuthenticated
|
|
users(search: String, limit: Int, offset: Int): [User!]! @isAdmin
|
|
clients: [Client!]! @isAdmin
|
|
auditEvents(eventType: String, limit: Int, offset: Int): [AuditEvent!]! @isAdmin
|
|
}
|
|
|
|
type Mutation {
|
|
registerUser(email: String!, password: String!): AuthPayload!
|
|
createClient(name: String!, isConfidential: Boolean): Client! @isAdmin
|
|
disableUser(userId: Int!): User! @isAdmin
|
|
}
|