-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
207 lines (183 loc) · 3.65 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# Examples :
# {
# airports {
# id
# name
# sensors {
# id
# measurement {
# id
# name
# unit
# }
# getMeanMeasureInterval(
# start: "2021-03-15 23:20:47.367000000"
# end: "2022-03-04 17:02:18.325000000"
# discretize: 24
# discretizeMode: PER_DAY
# ) {
# id
# value
# startDate
# endDate
# }
# }
# }
# }
"""
Scalar defined by gqlgen
"""
scalar Time
@fake(type: date, options: { dateFormat: "YYYY-MM-DDTHH:mm:ss.SSSSSSSSSZ" })
schema {
query: Query
}
interface Node {
id: ID!
}
type Query {
"""
List every airport available.
"""
airports: [Airport!]!
"""
Get an airport by his IATA airport code
"""
getAirportById(
"""
IATA airport code
"""
id: ID!
): Airport
}
"""
Represents an airport
"""
type Airport implements Node {
"""
IATA airport code
"""
id: ID! @examples(values: ["NTGA", "NTE", "YARY", "EURA", "ALY", "ASE"])
"""
Airport literal name
"""
name: String! @examples(values: ["Nantes", "Paris", "Lyon", "Brest", "Dijon"])
"""
List of available sensors for this airport
"""
sensors: [Sensor!]! @listLength(min: 2, max: 5)
"""
Get mean measures for a specific day, for each sensor available.
For example, if this airport has 8 sensors, you will get 8 mean values for the day specified
"""
getMeanMeasures(
"""
Mean values will be calculated for the day specified
"""
day: Time
): [MeasureMeanData!]! @listLength(min: 2, max: 2)
"""
Get a subset of sensors
"""
getSubsetOfSensors(
"""
Ids of sensors to get
"""
sensorIds: [ID!]!
): [Sensor!]! @listLength(min: 1, max: 2)
}
type Measurement implements Node {
"""
Measurement id
"""
id: ID! @examples(values: ["temperature", "wind"])
"""
Measurement name
"""
name: String! @examples(values: ["Température", "Vitesse du vent"])
"""
Measurement unit
"""
unit: String! @examples(values: ["°C", "m/s"])
}
type Sensor implements Node {
"""
Sensor id
"""
id: ID! @examples(values: ["T001", "W001"])
"""
Type of measurement that provides this sensor
"""
measurement: Measurement!
"""
Get a serie of mean measures for this sensor
"""
getMeanMeasureInterval(
"""
Data captured before this date will be not included.
Note: start < end
"""
start: Time!
"""
Data captured after this date will be not included.
Note: start < end
"""
end: Time!
"""
Specify the number of measures to obtain
"""
discretize: Int
"""
Specify discretize argument behaviour
"""
discretizeMode: MeanMeasureMode
): [MeasureMeanData!]! @listLength(min: 5, max: 15)
}
enum MeanMeasureMode {
"""
The value specified by discretize will divide in X MeasureMeanData for one day
"""
PER_DAY
"""
The value specified by discretize will divide in X MeasureMeanData for the whole interval
"""
FOR_INTERVAL
}
type MeasureMeanData implements Node {
"""
Measure id
"""
id: ID! @fake(type: uuid)
"""
Sensor used to capture this measure
"""
sensor: Sensor!
"""
Measure airport location
"""
airport: Airport!
"""
Measure value
"""
value: Float!
@fake(
type: number
options: { minNumber: -10, maxNumber: 30, precisionNumber: 0.01 }
)
"""
Start date of mean calculation
"""
startDate: Time!
@fake(
type: pastDate
options: { dateFormat: "YYYY-MM-DDTHH:mm:ss.SSSSSSSSSZ" }
)
"""
End date of mean calculation
"""
endDate: Time!
@fake(
type: futureDate
options: { dateFormat: "YYYY-MM-DDTHH:mm:ss.SSSSSSSSSZ" }
)
}