From 348a81aab2030bb19d8d2cd958df8db30f021943 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Wed, 16 Sep 2020 16:58:02 +0100 Subject: [PATCH] feat(api): splits auth and apps gql schemas into separate files --- modules/auth/graph/schemas/apps.graphql | 44 +++++++++++++++++++++++++ modules/auth/graph/schemas/auth.graphql | 40 ++-------------------- 2 files changed, 47 insertions(+), 37 deletions(-) create mode 100644 modules/auth/graph/schemas/apps.graphql diff --git a/modules/auth/graph/schemas/apps.graphql b/modules/auth/graph/schemas/apps.graphql new file mode 100644 index 000000000..0fdb6b8d9 --- /dev/null +++ b/modules/auth/graph/schemas/apps.graphql @@ -0,0 +1,44 @@ +extend type Query { + """ + Gets a specific app from the server. + """ + app( id: String! ): ServerApp + + """ + Returns all the publicly available apps on this server. + """ + apps: [ServerApp] +} + +type ServerApp { + id: String! + secret: String! + name: String! + description: String + termsAndConditionsLink: String + logo: String + authorId: User + createdAt: String! + redirectUrl: String! + scopes: [Scope]! +} + +extend type User { + authorizedApps: [ServerApp] + createdApps: [ServerApp] +} + +extend type Mutation { + appCreate(app: AppCreateUpdateInput): String! + appUpdate(app: AppCreateUpdateInput): Boolean! + appDelete(appId: String!): Boolean! +} + +input AppCreateUpdateInput { + name: String! + description: String! + termsAndConditionsLink: String + logo: String + redirectUrl: String! + scopes: [String]! +} diff --git a/modules/auth/graph/schemas/auth.graphql b/modules/auth/graph/schemas/auth.graphql index ea4665549..094742609 100644 --- a/modules/auth/graph/schemas/auth.graphql +++ b/modules/auth/graph/schemas/auth.graphql @@ -1,26 +1,7 @@ -extend type Query { - app( id: String! ): ServerApp -} - -type ServerApp { - id: String! - secret: String! - name: String! - description: String - termsAndConditionsLink: String - logo: String - authorId: User - createdAt: String! - redirectUrl: String! - scopes: [Scope]! -} - -extend type User { - authorizedApps: [ServerApp] - createdApps: [ServerApp] -} - extend type ServerInfo { + """ + The authentication strategies available on this server. + """ authStrategies: [AuthStrategy] } @@ -31,18 +12,3 @@ type AuthStrategy { url: String!, color: String } - -extend type Mutation { - appCreate(app: AppCreateUpdateInput): String! - appUpdate(app: AppCreateUpdateInput): Boolean - appDelete(appId: String): Boolean -} - -input AppCreateUpdateInput { - name: String! - description: String! - termsAndConditionsLink: String - logo: String - redirectUrl: String! - scopes: [String]! -}