-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgql.ts
More file actions
129 lines (129 loc) · 2.92 KB
/
gql.ts
File metadata and controls
129 lines (129 loc) · 2.92 KB
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
export default {
ADD_EXTERNAL_DATASET: `#graphql
mutation AddExternalDataset(
$planId: Int!,
$simulationDatasetId: Int,
$datasetStart: String!,
$profileSet: ProfileSet!) {
addExternalDataset(
planId: $planId,
simulationDatasetId: $simulationDatasetId,
datasetStart: $datasetStart,
profileSet: $profileSet) {
datasetId
}
}
`,
CREATE_ACTIVITY_DIRECTIVES: `#graphql
mutation CreateActivityDirectives($activityDirectivesInsertInput: [activity_directive_insert_input!]!) {
insert_activity_directive(objects: $activityDirectivesInsertInput) {
returning {
id
type
}
}
}
`,
CREATE_PLAN: `#graphql
mutation CreatePlan($plan: plan_insert_input!) {
createPlan: insert_plan_one(object: $plan) {
created_at
collaborators {
collaborator
}
duration
id
owner
revision
start_time
simulations {
id
}
}
}
`,
CREATE_PLAN_TAGS: `#graphql
mutation CreatePlanTags($tags: [plan_tags_insert_input!]!) {
insert_plan_tags(objects: $tags, on_conflict: {
constraint: plan_tags_pkey,
update_columns: []
}) {
affected_rows
}
}
`,
CREATE_TAGS: `#graphql
mutation CreateTags($tags: [tags_insert_input!]!) {
insert_tags(objects: $tags) {
returning {
color
created_at
id
name
owner
}
}
}
`,
DELETE_EXTERNAL_DATASET: `#graphql
mutation DeleteExternalDataset($id: Int!) {
delete_dataset_by_pk(id: $id) {
id
}
}
`,
DELETE_PLAN: `#graphql
mutation DeletePlan($id: Int!) {
deletePlan: delete_plan_by_pk(id: $id) {
id
}
}
`,
DELETE_TAGS: `#graphql
mutation DeleteTags($tagIds: [Int!]! = []) {
delete_tags(
where: {
id: { _in: $tagIds }
}
) {
affected_rows
}
}
`,
EXTEND_EXTERNAL_DATASET: `#graphql
mutation ExtendExternalDataset($datasetId: Int!, $profileSet: ProfileSet!) {
extendExternalDataset(datasetId: $datasetId, profileSet: $profileSet) {
datasetId
}
}
`,
GET_TAGS: `#graphql
query GetTags {
tags(order_by: { name: desc }) {
color
created_at
id
name
owner
}
}
`,
UPDATE_ACTIVITY_DIRECTIVES: `#graphql
mutation UpdateActivityDirective($updates: [activity_directive_updates!]!) {
update_activity_directive_many(
updates: $updates
) {
affected_rows
}
}
`,
UPDATE_SIMULATION: `#graphql
mutation InitialSimulationUpdate($plan_id: Int!, $simulation: simulation_set_input!) {
update_simulation(where: {plan_id: {_eq: $plan_id}}, _set: $simulation) {
returning {
id
}
}
}
`,
};