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.

query FilterFields {
  getFields(
    filter: {
      farmUuid: "<placeholder_of_farm_uuid>"
      fieldUuid: "<placeholder_of_field_uuid>"
      labels: [{ name: "name1", value: "value1" }]
      pageSize: 2
      lastEvaluatedKey: {
        SortKey: "<some_key>"
        PartitionKey: "<some_key>"
      }
      fieldName: "Sample"
    }
  ) {
    fields {
      uuid
      area(unit: HECTARES)
      name
      labels {
        name
        value
      }
      totalCount
    }
    lastEvaluatedKey {
      SortKey
      PartitionKey
    }
  }
}

Last updated

Powered by GeoPard Agriculture - Automated precisionAg platform