From 0cf8565afc8f43a97c29c70b50a8d71425a65ace Mon Sep 17 00:00:00 2001 From: Agzamus Date: Mon, 12 Oct 2026 16:49:35 +0300 Subject: [PATCH] =?UTF-8?q?feat:=209.1.=20=D0=9E=D0=BF=D0=B8=D1=81=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20SDL-=D1=81=D1=85=D0=B5=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/graphql/schema.graphql | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 app/graphql/schema.graphql diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql new file mode 100644 index 0000000..0ca6dfd --- /dev/null +++ b/app/graphql/schema.graphql @@ -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 +}