feat: 9.1. Описание SDL-схемы
This commit is contained in:
@@ -0,0 +1,49 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user