Skip to content

Commit f737891

Browse files
authored
feat(api): Add workflow schema (#270)
* wip add workflow schema * update workflow type * Add query/mut typings * revert and fix types
1 parent 45c8844 commit f737891

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

api/gql/project.graphql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ type Project implements Node {
66
basicAuthPassword: String!
77
createdAt: DateTime!
88
updatedAt: DateTime!
9+
version: Int!
910
name: String!
1011
description: String!
1112
workspaceId: ID!
@@ -35,6 +36,11 @@ input DeleteProjectInput {
3536
projectId: ID!
3637
}
3738

39+
input ExecuteWorkflowRunInput {
40+
projectId: ID!
41+
workflows: [Workflow!]!
42+
}
43+
3844
# Payload
3945

4046
type ProjectPayload {
@@ -45,6 +51,11 @@ type DeleteProjectPayload {
4551
projectId: ID!
4652
}
4753

54+
type WorkflowRunPayload {
55+
projectId: ID!
56+
started: Boolean!
57+
}
58+
4859
# Connection
4960

5061
type ProjectConnection {
@@ -67,4 +78,5 @@ extend type Mutation {
6778
createProject(input: CreateProjectInput!): ProjectPayload
6879
updateProject(input: UpdateProjectInput!): ProjectPayload
6980
deleteProject(input: DeleteProjectInput!): DeleteProjectPayload
81+
executeWorkflowRun(input: ExecuteWorkflowRunInput!): WorkflowRunPayload
7082
}

api/gql/workflow.graphql

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
type Workflow implements Node {
2+
id: ID!
3+
name: String!
4+
createdAt: DateTime!
5+
updatedAt: DateTime!
6+
nodes: [NodeType]
7+
edges: [Edge]
8+
isMain: Boolean
9+
version: Int!
10+
projectId: ID!
11+
workspaceId: ID!
12+
}
13+
14+
type NodeType {
15+
id: ID!
16+
data: Data!
17+
}
18+
19+
type Data {
20+
name: String
21+
inputs: [Input]!
22+
outputs: [Output]!
23+
status: Status
24+
content: String
25+
transformerId: ID
26+
params: [Param]
27+
}
28+
29+
type Param {
30+
id: ID!
31+
name: String!
32+
value: ParamValue!
33+
}
34+
35+
enum ParamValue {
36+
STRING
37+
NUMBER
38+
BOOLEAN
39+
OBJECT
40+
ARRAY
41+
}
42+
43+
type Edge {
44+
id: ID!
45+
source: [ID!]!
46+
target: [ID!]!
47+
}

ui/src/types/workflow.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ export type Workflow = {
66
name?: string;
77
nodes?: Node[];
88
edges?: Edge[];
9+
createdAt?: string;
10+
updatedAt?: string;
11+
// projectId?: string;
12+
// workspaceId?: string;
913
// status??
1014
// params?: any;
1115
};

0 commit comments

Comments
 (0)