|
1
|
mutation CreateCategory @auth(level: USER) { |
|
2
|
category_insert(data: { name: "Tools" }) |
|
3
|
} |
|
4
|
|
|
5
|
mutation UpsertCategory($id: UUID!) @auth(level: USER) { |
|
6
|
category_upsert(data: { id: $id, name: "Tools" }) |
|
7
|
} |
|
8
|
|
|
9
|
mutation DeleteCategory($id: UUID!) @auth(level: USER) { |
|
10
|
category_delete(key: { id: $id }) |
|
11
|
} |
|
12
|
|
|
13
|
mutation UpdateCategory($id: UUID!, $name: String!) @auth(level: USER) { |
|
14
|
category_update(key: { id: $id }, data: { name: $name }) |
|
15
|
} |
|
16
|
|
|
17
|
query GetCategory($id: UUID!) @auth(level: USER) { |
|
18
|
category(id: $id) { name } |
|
19
|
} |
|
20
|
|
|
21
|
query ListCategories @auth(level: USER) { |
|
22
|
categories { name } |
|
23
|
} |
|
24
|
|
|
25
|
mutation CreateDevice @auth(level: USER) { |
|
26
|
device_insert(data: { manufacturer: "ACME", modelName: "Drill-X" }) |
|
27
|
} |
|
28
|
|
|
29
|
mutation UpsertDevice($id: UUID!) @auth(level: USER) { |
|
30
|
device_upsert(data: { id: $id, manufacturer: "ACME", modelName: "Drill-X" }) |
|
31
|
} |
|
32
|
|
|
33
|
mutation DeleteDevice($id: UUID!) @auth(level: USER) { |
|
34
|
device_delete(key: { id: $id }) |
|
35
|
} |
|
36
|
|
|
37
|
mutation UpdateDevice($id: UUID!, $modelName: String!) @auth(level: USER) { |
|
38
|
device_update(key: { id: $id }, data: { modelName: $modelName }) |
|
39
|
} |
|
40
|
|
|
41
|
query GetDevice($id: UUID!) @auth(level: USER) { |
|
42
|
device(id: $id) { modelName } |
|
43
|
} |
|
44
|
|
|
45
|
query ListDevices @auth(level: USER) { |
|
46
|
devices { modelName } |
|
47
|
} |
|
48
|
|
|
49
|
mutation CreateGuide($title: String!, $difficulty: String!, $time: Int!) @auth(level: PUBLIC, insecureReason: "Guides are public knowledge.") { |
|
50
|
guide_insert(data: { title: $title, difficultyLevel: $difficulty, estimatedTimeMinutes: $time }) |
|
51
|
} |
|
52
|
|
|
53
|
mutation UpsertGuide($id: UUID!, $title: String!, $difficulty: String!, $time: Int!) @auth(level: PUBLIC, insecureReason: "Guides are public knowledge.") { |
|
54
|
guide_upsert(data: { id: $id, title: $title, difficultyLevel: $difficulty, estimatedTimeMinutes: $time }) |
|
55
|
} |
|
56
|
|
|
57
|
mutation DeleteGuide($id: UUID!) @auth(level: PUBLIC, insecureReason: "Publicly maintained guides.") { |
|
58
|
guide_delete(key: { id: $id }) |
|
59
|
} |
|
60
|
|
|
61
|
mutation UpdateGuide($id: UUID!, $time: Int!) @auth(level: PUBLIC, insecureReason: "Guides are public knowledge.") { |
|
62
|
guide_update(key: { id: $id }, data: { estimatedTimeMinutes: $time }) |
|
63
|
} |
|
64
|
|
|
65
|
query GetGuide($id: UUID!) @auth(level: PUBLIC, insecureReason: "Guides are public knowledge.") { |
|
66
|
guide(id: $id) { title } |
|
67
|
} |
|
68
|
|
|
69
|
query ListGuides @auth(level: PUBLIC, insecureReason: "Guides are public knowledge.") { |
|
70
|
guides { title } |
|
71
|
} |
|
72
|
|
|
73
|
mutation CreatePart($name: String!, $type: String!, $devId: UUID!) @auth(level: USER) { |
|
74
|
part_insert(data: { partName: $name, partType: $type, deviceId: $devId }) |
|
75
|
} |
|
76
|
|
|
77
|
mutation UpsertPart($id: UUID!, $name: String!, $type: String!, $devId: UUID!) @auth(level: USER) { |
|
78
|
part_upsert(data: { id: $id, partName: $name, partType: $type, deviceId: $devId }) |
|
79
|
} |
|
80
|
|
|
81
|
mutation DeletePart($id: UUID!) @auth(level: USER) { |
|
82
|
part_delete(key: { id: $id }) |
|
83
|
} |
|
84
|
|
|
85
|
mutation UpdatePart($id: UUID!, $notes: String!) @auth(level: USER) { |
|
86
|
part_update(key: { id: $id }, data: { compatibilityNotes: $notes }) |
|
87
|
} |
|
88
|
|
|
89
|
query GetPart($id: UUID!) @auth(level: USER) { |
|
90
|
part(id: $id) { partName } |
|
91
|
} |
|
92
|
|
|
93
|
query ListParts @auth(level: USER) { |
|
94
|
parts { partName } |
|
95
|
} |
|
96
|
|
|
97
|
mutation CreateStep($order: Int!, $text: String!, $guideId: UUID!) @auth(level: USER) { |
|
98
|
step_insert(data: { sequenceOrder: $order, instructionText: $text, guideId: $guideId }) |
|
99
|
} |
|
100
|
|
|
101
|
mutation UpsertStep($id: UUID!, $order: Int!, $text: String!, $guideId: UUID!) @auth(level: USER) { |
|
102
|
step_upsert(data: { id: $id, sequenceOrder: $order, instructionText: $text, guideId: $guideId }) |
|
103
|
} |
|
104
|
|
|
105
|
mutation DeleteStep($id: UUID!) @auth(level: USER) { |
|
106
|
step_delete(key: { id: $id }) |
|
107
|
} |
|
108
|
|
|
109
|
mutation UpdateStep($id: UUID!, $text: String!) @auth(level: USER) { |
|
110
|
step_update(key: { id: $id }, data: { instructionText: $text }) |
|
111
|
} |
|
112
|
|
|
113
|
query GetStep($id: UUID!) @auth(level: USER) { |
|
114
|
step(id: $id) { instructionText } |
|
115
|
} |
|
116
|
|
|
117
|
query ListSteps @auth(level: USER) { |
|
118
|
steps { instructionText } |
|
119
|
} |
|
120
|
|
|
121
|
mutation CreateBookmark($guideId: UUID!) @auth(level: USER) { |
|
122
|
userBookmark_insert(data: { userId_expr: "auth.uid", guideId: $guideId }) |
|
123
|
} |
|
124
|
|
|
125
|
mutation UpsertBookmark($id: UUID!, $guideId: UUID!) @auth(level: USER) { |
|
126
|
userBookmark_upsert(data: { id: $id, userId_expr: "auth.uid", guideId: $guideId }) |
|
127
|
} |
|
128
|
|
|
129
|
mutation DeleteBookmark($id: UUID!) @auth(level: USER) { |
|
130
|
userBookmark_delete(key: { id: $id }) |
|
131
|
} |
|
132
|
|
|
133
|
mutation UpdateBookmark($id: UUID!, $guideId: UUID!) @auth(level: USER) { |
|
134
|
userBookmark_update(key: { id: $id }, data: { guideId: $guideId }) |
|
135
|
} |
|
136
|
|
|
137
|
query GetMyBookmarks @auth(level: USER) { |
|
138
|
userBookmarks(where: { userId: { eq_expr: "auth.uid" } }) { guide { title } } |
|
139
|
} |
|
140
|
|
|
141
|
query GetBookmark($id: UUID!) @auth(level: USER) { |
|
142
|
userBookmark(key: { id: $id }) { userId } |
|
143
|
} |