feat: Introduce reconnection steps for twitter app
This commit is contained in:
@@ -111,5 +111,75 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"reconnectionSteps": [
|
||||
{
|
||||
"step": 1,
|
||||
"type": "mutation",
|
||||
"name": "updateConnection",
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"value": "{connection.id}"
|
||||
},
|
||||
{
|
||||
"name": "data",
|
||||
"value": null,
|
||||
"fields": [
|
||||
{
|
||||
"name": "consumerKey",
|
||||
"value": "{fields.consumerKey}"
|
||||
},
|
||||
{
|
||||
"name": "consumerSecret",
|
||||
"value": "{fields.consumerSecret}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"type": "mutation",
|
||||
"name": "createAuthLink",
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"value": "{connection.id}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"type": "openWithPopup",
|
||||
"name": "openTwitterAuthPopup",
|
||||
"fields": [
|
||||
{
|
||||
"name": "url",
|
||||
"value": "{createAuthLink.url}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"type": "mutation",
|
||||
"name": "updateConnection",
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"value": "{connection.id}"
|
||||
},
|
||||
{
|
||||
"name": "data",
|
||||
"value": null,
|
||||
"fields": [
|
||||
{
|
||||
"name": "oauthVerifier",
|
||||
"value": "{openTwitterAuthPopup.oauth_verifier}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt } from 'graphql';
|
||||
import fieldType from './field';
|
||||
import authenticationStepType from './authentication-step';
|
||||
import reconnectionStepType from './reconnection-step';
|
||||
|
||||
const appType = new GraphQLObjectType({
|
||||
name: 'App',
|
||||
@@ -16,6 +17,7 @@ const appType = new GraphQLObjectType({
|
||||
primaryColor: { type: GraphQLString },
|
||||
fields: { type: GraphQLList(fieldType) },
|
||||
authenticationSteps: { type: GraphQLList(authenticationStepType) },
|
||||
reconnectionSteps: { type: GraphQLList(reconnectionStepType) },
|
||||
connections: { type: GraphQLList(connectionType) },
|
||||
}
|
||||
}
|
||||
|
@@ -9,14 +9,14 @@ const authenticationStepType = new GraphQLObjectType({
|
||||
fields: {
|
||||
type: GraphQLList(
|
||||
new GraphQLObjectType({
|
||||
name: 'authenticationStepFields',
|
||||
name: 'AuthenticationStepFields',
|
||||
fields: {
|
||||
name: { type: GraphQLString },
|
||||
value: { type: GraphQLString },
|
||||
fields: {
|
||||
type: GraphQLList(
|
||||
new GraphQLObjectType({
|
||||
name: 'twitterAuthenticationStepFields',
|
||||
name: 'TwitterAuthenticationStepFields',
|
||||
fields: {
|
||||
name: { type: GraphQLString },
|
||||
value: { type: GraphQLString }
|
||||
|
34
packages/backend/src/graphql/types/reconnection-step.ts
Normal file
34
packages/backend/src/graphql/types/reconnection-step.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt } from 'graphql';
|
||||
|
||||
const reconnectionStepType = new GraphQLObjectType({
|
||||
name: 'ReconnectionStep',
|
||||
fields: {
|
||||
step: { type: GraphQLInt },
|
||||
type: { type: GraphQLString },
|
||||
name: { type: GraphQLString },
|
||||
fields: {
|
||||
type: GraphQLList(
|
||||
new GraphQLObjectType({
|
||||
name: 'ReconnectionStepFields',
|
||||
fields: {
|
||||
name: { type: GraphQLString },
|
||||
value: { type: GraphQLString },
|
||||
fields: {
|
||||
type: GraphQLList(
|
||||
new GraphQLObjectType({
|
||||
name: 'TwitterReconnectionStepFields',
|
||||
fields: {
|
||||
name: { type: GraphQLString },
|
||||
value: { type: GraphQLString }
|
||||
}
|
||||
})
|
||||
)
|
||||
},
|
||||
}
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export default reconnectionStepType;
|
Reference in New Issue
Block a user