feat: Add draft triggers and actions to twitter app

This commit is contained in:
Faruk AYDIN
2022-01-06 18:00:23 +03:00
committed by Ömer Faruk Aydın
parent c07b377de1
commit b6c7ce96c9
4 changed files with 112 additions and 8 deletions

View File

@@ -0,0 +1,34 @@
import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt, GraphQLBoolean } from 'graphql';
const actionType = new GraphQLObjectType({
name: 'Action',
fields: {
name: { type: GraphQLString },
key: { type: GraphQLString },
description: { type: GraphQLString },
subSteps: {
type: GraphQLList(
new GraphQLObjectType({
name: 'ActionSubStep',
fields: {
name: { type: GraphQLString },
arguments: {
type: GraphQLList(
new GraphQLObjectType({
name: 'ActionSubStepArgument',
fields: {
name: { type: GraphQLString },
type: { type: GraphQLString },
required: { type: GraphQLBoolean }
}
})
)
},
}
}),
)
}
}
})
export default actionType;

View File

@@ -3,6 +3,7 @@ import fieldType from './field';
import authenticationStepType from './authentication-step';
import reconnectionStepType from './reconnection-step';
import triggerType from './trigger';
import actionType from './action';
const appType = new GraphQLObjectType({
name: 'App',
@@ -20,6 +21,7 @@ const appType = new GraphQLObjectType({
authenticationSteps: { type: GraphQLList(authenticationStepType) },
reconnectionSteps: { type: GraphQLList(reconnectionStepType) },
triggers: { type: GraphQLList(triggerType) },
actions: { type: GraphQLList(actionType) },
connections: { type: GraphQLList(connectionType) },
}
}

View File

@@ -1,11 +1,33 @@
import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt } from 'graphql';
import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt, GraphQLBoolean } from 'graphql';
const triggerType = new GraphQLObjectType({
name: 'Trigger',
fields: {
name: { type: GraphQLString },
key: { type: GraphQLString },
description: { type: GraphQLString }
description: { type: GraphQLString },
subSteps: {
type: GraphQLList(
new GraphQLObjectType({
name: 'TriggerSubStep',
fields: {
name: { type: GraphQLString },
arguments: {
type: GraphQLList(
new GraphQLObjectType({
name: 'TriggerSubStepArgument',
fields: {
name: { type: GraphQLString },
type: { type: GraphQLString },
required: { type: GraphQLBoolean }
}
})
)
},
}
}),
)
}
}
})