From 7f17420ae0c82ad8819935fbc7eaa40535834004 Mon Sep 17 00:00:00 2001 From: Faruk AYDIN Date: Wed, 13 Oct 2021 16:19:13 +0200 Subject: [PATCH] chore: Expose authentication steps to the client --- packages/backend/src/graphql/types/app.ts | 4 ++- .../src/graphql/types/authentication-step.ts | 34 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 packages/backend/src/graphql/types/authentication-step.ts diff --git a/packages/backend/src/graphql/types/app.ts b/packages/backend/src/graphql/types/app.ts index f9e56a0f..74460e5d 100644 --- a/packages/backend/src/graphql/types/app.ts +++ b/packages/backend/src/graphql/types/app.ts @@ -1,5 +1,6 @@ import { GraphQLObjectType, GraphQLString, GraphQLList } from 'graphql'; import fieldType from './field'; +import authenticationStepType from './authentication-step'; const appType = new GraphQLObjectType({ name: 'App', @@ -10,7 +11,8 @@ const appType = new GraphQLObjectType({ iconUrl: { type: GraphQLString }, docUrl: { type: GraphQLString }, primaryColor: { type: GraphQLString }, - fields: { type: GraphQLList(fieldType) } + fields: { type: GraphQLList(fieldType) }, + authenticationSteps: { type: GraphQLList(authenticationStepType) } } }); diff --git a/packages/backend/src/graphql/types/authentication-step.ts b/packages/backend/src/graphql/types/authentication-step.ts new file mode 100644 index 00000000..46d24276 --- /dev/null +++ b/packages/backend/src/graphql/types/authentication-step.ts @@ -0,0 +1,34 @@ +import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt } from 'graphql'; + +const authenticationStepType = new GraphQLObjectType({ + name: 'authenticationStep', + fields: { + step: { type: GraphQLInt }, + type: { type: GraphQLString }, + name: { type: GraphQLString }, + fields: { + type: GraphQLList( + new GraphQLObjectType({ + name: 'authenticationStepFields', + fields: { + name: { type: GraphQLString }, + value: { type: GraphQLString }, + fields: { + type: GraphQLList( + new GraphQLObjectType({ + name: 'twitterAuthenticationStepFields', + fields: { + name: { type: GraphQLString }, + value: { type: GraphQLString } + } + }) + ) + }, + } + }), + ) + } + } +}) + +export default authenticationStepType;