-
Notifications
You must be signed in to change notification settings - Fork 0
/
factors.toml
108 lines (98 loc) · 2.19 KB
/
factors.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# =================================================
# Factor Fragments
# =================================================
[fragments]
FRAGMENT_FACTOR_SKELETON = """
fragment FRAGMENT_FACTOR_SKELETON on Factor {
id
label
tags
_variableOrderSymbols
}
"""
FRAGMENT_FACTOR_SUMMARY = """
fragment FRAGMENT_FACTOR_SUMMARY on Factor {
timestamp
nstime
}
"""
FRAGMENT_FACTOR = """
fragment FRAGMENT_FACTOR on Factor {
fnctype
solvable
data
metadata
_type
_version
}
"""
# =================================================
# Factor Operations
# =================================================
[operations]
QUERY_GET_FACTOR = """
query QUERY_GET_FACTOR(
$userLabel: EmailAddress!,
$robotLabel: String!,
$sessionLabel: String!,
$label: String!) {
users(where:{label: $userLabel}) {
robots(where:{label: $robotLabel}) {
sessions(where:{label: $sessionLabel}) {
factors(where:{label: $label}) {
...FRAGMENT_FACTOR_SKELETON
...FRAGMENT_FACTOR_SUMMARY
...FRAGMENT_FACTOR
}
}
}
}
}
"""
QUERY_GET_FACTORS = """
query QUERY_GET_FACTORS(
$userLabel: EmailAddress!
$robotLabel: String!
$sessionLabel: String!
$fields_summary: Boolean! = true
$fields_full: Boolean! = true
) {
users(where: { label: $userLabel }) {
robots(where: { label: $robotLabel }) {
sessions(where: { label: $sessionLabel }) {
factors {
...FRAGMENT_FACTOR_SKELETON
...FRAGMENT_FACTOR_SUMMARY @include(if: $fields_summary)
...FRAGMENT_FACTOR @include(if: $fields_full)
}
}
}
}
}
"""
QUERY_LISTFACTORS = """
query sdk_list_factors($userLabel: EmailAddress!, $robotLabel: String!, $sessionLabel: String!) {
users(where: { label: $userLabel }) {
robots(where: { label: $robotLabel }) {
sessions(where: { label: $sessionLabel }) {
factors {
label
}
}
}
}
}
"""
MUTATION_ADD_FACTORS = """
mutation sdk_add_factors($factorsToCreate: [FactorCreateInput!]!) {
addFactors(
input: $factorsToCreate
) {
factors {
...FRAGMENT_FACTOR_SKELETON
...FRAGMENT_FACTOR_SUMMARY
...FRAGMENT_FACTOR
}
}
}
"""