GeoPard Tutorials
Ask or search…
⌃K

43. Query Get "Fields"

Query to get user "Fields" with filters by labels, farmUuid, fieldUuid, fieldName. The fields returned in alphabetical order by field name.
The field filter works like AND condition, e.g. possible to filter by farmUuid and by fieldUuid and by labels and by fieldName in the one query or use just one filter condition or use no condition.
Filter by fieldName works as begins_with.
To implement pagination logic, use the query parameter pageSize. There are lastEvaluatedKey and totalCount in response, where lastEvaluatedKey refers to the last processed record to match the filter condition and totalCount is the total number of records that match the filtering conditions.
1
query FilterFields {
2
getFields(
3
filter: {
4
farmUuid: "<placeholder_of_farm_uuid>"
5
fieldUuid: "<placeholder_of_field_uuid>"
6
labels: [{ name: "name1", value: "value1" }]
7
pageSize: 2
8
lastEvaluatedKey: {
9
SortKey: "<some_key>"
10
PartitionKey: "<some_key>"
11
}
12
fieldName: "Sample"
13
}
14
) {
15
fields {
16
uuid
17
area(unit: HECTARES)
18
name
19
labels {
20
name
21
value
22
}
23
totalCount
24
}
25
lastEvaluatedKey {
26
SortKey
27
PartitionKey
28
}
29
}
30
}
31
​