-
Notifications
You must be signed in to change notification settings - Fork 0
/
session.toml
84 lines (74 loc) · 1.52 KB
/
session.toml
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
# =================================================
# Fragments
# =================================================
[fragments]
FRAGMENT_SESSION = """
fragment FRAGMENT_SESSION on Session {
id
label
originLatitude
originLongitude
metadata
blobEntries { ...FRAGMENT_BLOBENTRY }
_version
createdTimestamp
lastUpdatedTimestamp
# variables
# factors
}
"""
# =================================================
# Operations
# =================================================
[operations]
QUERY_GET_SESSIONS = """
query QUERY_GET_SESSIONS (
$userLabel: EmailAddress!,
$robotLabel: String!,
) {
users (where: {label: $userLabel}) {
robots (where: {label: $robotLabel}) {
sessions {
...FRAGMENT_SESSION
}
}
}
}
"""
QUERY_GET_SESSION = """
query QUERY_GET_SESSION (
$userLabel: EmailAddress!,
$robotLabel: String!,
$sessionLabel: String!
) {
users (where: {label: $userLabel}) {
robots (where: {label: $robotLabel}) {
sessions (where: {label: $sessionLabel}) {
...FRAGMENT_SESSION
}
}
}
}
"""
MUTATION_ADD_SESSION = """
mutation MUTATION_ADD_SESSION(
$userLabel: String!
$robotLabel: String!
$sessionLabel: String!
$version: String!
) {
addSessions(
input: {
label: $sessionLabel
_version: $version
userLabel: $userLabel
robotLabel: $robotLabel
robot: { connect: { where: { node: { label: $robotLabel } } } }
}
) {
sessions {
...FRAGMENT_SESSION
}
}
}
"""