-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
163 lines (138 loc) · 2.56 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
scalar Upload
scalar DateTime
scalar JSON
schema {
query: Query
mutation: Mutation
}
"The query type, represents all of the entry points into our object graph"
type Query {
hive(id: ID!): Hive
apiary(id: ID!): Apiary
hiveFrameSide(id: ID!): FrameSide
apiaries: [Apiary]
inspection(inspectionId: ID!): Inspection
inspections(hiveId: ID!, limit: Int): [Inspection]
}
"The mutation type, represents all updates we can make to our data"
type Mutation {
addApiary(apiary: ApiaryInput!): Apiary
updateApiary(id: ID!, apiary: ApiaryInput!): Apiary
deactivateApiary(id: ID!): Boolean
addHive(hive: HiveInput!): Hive
updateHive(hive: HiveUpdateInput!): Hive
deactivateHive(id: ID!): Boolean
addBox(hiveId: ID!, position: Int!, color: String, type: BoxType!): Box!
updateBoxColor(id: ID!, color: String): Boolean!
deactivateBox(id: ID!): Boolean
swapBoxPositions(id: ID!, id2: ID!): Boolean
addFrame(boxId: ID!, type: String!, position: Int!): Frame!
updateFrames(frames: [FrameInput]!) : [Frame]
deactivateFrame(id: ID!): Boolean
addInspection(inspection: InspectionInput!): Inspection
}
input ApiaryInput {
name: String!
lat: String
lng: String
}
type Apiary {
id: ID!
name: String
hives: [Hive]
location: String
lat: String
lng: String
}
input HiveInput {
apiaryId: ID!
name: String!
boxCount: Int!
frameCount: Int!
colors: [String]
}
input HiveUpdateInput {
id: ID!
name: String
notes: String
family: FamilyInput
}
type Hive @key(fields: "id") {
id: ID!
name: String
notes: String
boxes: [Box]
family: Family
boxCount: Int!
inspectionCount: Int!
}
input FamilyInput{
id: ID
race: String
added: String
}
input BoxInput{
id: ID
position: Int!
color: String
type: BoxType!
"ignored, added for frontend ease"
hiveId: Int
family: FamilyInput
}
type Family{
id: ID!
race: String
added: String
}
type Inspection {
id: ID!
hiveId: ID!
data: JSON!
added: DateTime!
}
input InspectionInput{
hiveId: Int!
data: JSON!
}
type Box{
id: ID
position: Int
color: String
type: BoxType!
frames: [Frame]
}
input FrameInput{
id: ID!
position: Int!
type: FrameType!
"ignored, added for frontend ease"
boxId: ID!
"ignored, added for frontend ease"
hiveId: Int
}
type Frame{
id: ID
position: Int!
type: FrameType!
leftSide: FrameSide,
rightSide: FrameSide
}
enum BoxType {
DEEP
SUPER
GATE
VENTILATION
QUEEN_EXCLUDER
HORIZONTAL_FEEDER
}
enum FrameType {
VOID
FOUNDATION
EMPTY_COMB
PARTITION
FEEDER
}
type FrameSide @key(fields: "id") {
id: ID
}