chore: Expose authentication steps to the client

This commit is contained in:
Faruk AYDIN
2021-10-13 16:19:13 +02:00
committed by Ali BARIN
parent a2a9bd9020
commit 7f17420ae0
2 changed files with 37 additions and 1 deletions

View File

@@ -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) }
}
});

View File

@@ -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;