-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
executable file
·199 lines (173 loc) · 3.45 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
"""
Assign a concreate product to the named input of a given factory.
"""
type AssignInputs {
factory: Factory
}
type Attribute {
name: String
value: String
kind: AttributeKind
}
enum AttributeKind {
String
Int
Float
Date
}
"""
An input for a factory
"""
type Binding implements Node {
id: ID!
name: String!
protocol: String!
product: Product
factory: Factory!
position: Position!
}
"""
An input to specify a particular product to be assigned to the input
of a factory.
"""
input BindingAssignment {
name: String!
product: ID!
}
"""
The primary actor of our flows. Responsible for taking data in that
matches a particular protocol and Bindings in a concrete product
"""
type Factory implements Node & Producer {
id: ID!
name: String!
inputs: [Binding!]!
outputs: [Binding!]!
config: [KVPair!]!
position: Position!
attributes: [Attribute!]!
products: [Product!]!
factories: [Factory!]!
}
type Flo implements Node & Producer {
id: ID!
fixed: Boolean
factories: [Factory!]!
products: [Product!]!
}
"""
A generic key/value object to store shapeless meta data and config
"""
type KVPair {
key: String!
value: String!
kind: String!
}
"""
A generic key/value object to store shapeless meta data and config
"""
input KVPairInput {
key: String!
value: String!
}
input MoveFactoryInput {
factory: ID!
x: Int!
y: Int!
}
"""
Move the location for a product to a specific x,y coordinate
"""
type MoveFactoryOutput {
factory: Factory
}
input MoveBindingInput {
binding: ID!
x: Int!
y: Int!
}
type MoveBindingOutput {
binding: Binding
x: Int!
y: Int!
}
input MoveProductInput {
product: ID!
x: Int!
y: Int!
}
type MoveProductOutput {
product: Product
}
input AddProductInput {
product: ID!
flo: ID!
x: Int!
y: Int!
}
type AddProductOutput {
product: Product
}
input AddFactoryToFloInput {
factory: ID!
flo: ID!
x: Int!
y: Int!
}
type AddFactoryToFloOutput {
factory: Factory!
flo: Flo!
}
type Mutation {
moveProduct(input: MoveProductInput!): MoveProductOutput!
moveFactory(input: MoveFactoryInput!): MoveFactoryOutput!
moveBinding(input: MoveBindingInput!): MoveBindingOutput!
addProductToFlo(input: AddProductInput!): AddProductOutput!
addFactoryToFlo(input: AddFactoryToFloInput!): AddFactoryToFloOutput!
}
"""
An interface for objects that can be looked up by a globally unique ID
"""
interface Node {
id: ID!
}
type Position {
x: Int
y: Int
}
"""
An interface for things that contain both products and factories.
"""
interface Producer {
products: [Product!]!
factories: [Factory!]!
}
"""
A concrete Binding of running a specific factory
"""
type Product implements Node {
id: ID!
source: Binding
name: String!
description: String
bindings: [Binding!]!
position: Position!
progress: Float!
attributes: [Attribute!]!
}
type Query {
node(id: ID!): Node
products: [Product!]!
factories: [Factory!]!
}
type Subscription {
node(id: ID!): Node
newProduct(flo: ID!): Product
newFactory(flo: ID!): Factory
}
"""
Update the config of a factory
"""
type UpdateFactoryConfig {
factory: Factory
}