fields

Retrieve a list of fields.

Arguments

bounds (Bounds)

Retrieve fields based on a bounding rectangle.

date_range (DateRange)

Retrieve fields based on a date range.

external_reference (ExternalReference)

Retrieve fields for the given combination of external ID and external partner.

filter (FieldsFilter)

A list of filters to apply to this query to limit the returned results.

geometry (GeoJSON)

Retrieve fields based on intersection with a polygon or multipolygon geometry. Maximum size allowed is 250 KB.

haversine_radius (HaversineRadius)

Retrieve fields based on a haversine radius.

include_descendant_organizations (Boolean)

Expand results to include fields in the organizational hierarchy and partnerships. Defaults to false if not specified.

order_by (FieldSortingAttributes)

Retrieve fields ordered by a specific attribute.

order_by_direction (SortDirection)

Used with order_by, determines the order/sort direction.

organization_id (ID)

List fields for this organization. Defaults to the current user's organization if not specified.

ownership (Ownership)

List fields based on field ownership. Defaults to ALL if not specified.

pagination (Pagination)

Retrieve fields a page at a time.

sentera_ids ([ID!])

A list of field IDs to retrieve. If provided no fields outside this list will be returned. This filter will not include fields that have been excluded by some other filter.

Return fields

page (Int!)

The page of results returned in this structure when using pagination.

page_size (Int!)

The number of results returned in this structure when using pagination.

present (Boolean!)

Whether or not there are any results in this structure.

results ([Field!]!)

A collection of fields matching the query constraints.

total_count (Int!)

The total number of items matching the query constraints.

Examples

All Fields

Retrieves fields the calling user is allowed to access. This includes fields in the current user's organization, and any fields that are shared with the current user.

Try this example in GraphiQL
query AllFields{
  fields(pagination: { page: 1, page_size: 100 }) {
  total_count
  page
  results {
    sentera_id
    name
    latitude
    longitude
  }
  }
}

{
  "data": {
  "fields": {
    "total_count": 47,
    "page": 1,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524",
        "latitude": 45.0,
        "longitude": -93.4
      }
    ]
  }
  }
}

All Fields with Expanded Results

Retrieves fields the calling user is allowed to access, including fields in the following:

This also includes fields that are shared with the current user.

Try this example in GraphiQL
query AllFields{
  fields(pagination: { page: 1, page_size: 100 }, include_descendant_organizations: true) {
  total_count
  page
  results {
    sentera_id
    name
    latitude
    longitude
  }
  }
}

{
  "data": {
  "fields": {
    "page": 1,
    "total_count": 47,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524",
        "latitude": 45.0,
        "longitude": -93.4
      }
    ]
  }
  }
}

Fields for a Specific Organization

Retrieve fields based an organization ID.


This organization can be one of: Try this example in GraphiQL
query FieldsForOrganization {
  fields (
  organization_id: "fkqbg8f_OR_8y24DenisOrgC_CV_stag_1de18e2_200806_133132"
  ) {
  total_count
  results {
    sentera_id
    name
    latitude
    longitude
  }
  }
}

{
  "data": {
  "fields": {
    "total_count": 89,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524",
        "latitude": 45.0,
        "longitude": -93.4
      }
    ]
  }
  }
}

Fields Constrained by Ownership

Retrieve fields based on the organization that owns the field. A calling user can request:


Try this example in GraphiQL
query FieldsConstrainedByOwnership{
  fields(ownership: OWNED) {
  total_count
  results {
    sentera_id
    name
    latitude
    longitude
  }
  }
}

{
  "data": {
  "fields": {
    "total_count": 47,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524",
        "latitude": 45.0,
        "longitude": -93.4
      }
    ]
  }
  }
}

Fields Constrained by a Haversine Radius

Retrieve fields based on a haversine radius. When using the haversine radius constraint, an additional distance_from_origin attribute is available to be returned in the results. This value is the distance in miles of a field from the origin (latitude and longitude) that you have specified. This constraint cannot be used with the bounds or geometry constraints in the same query.

Try this example in GraphiQL
query FieldsConstrainedByHaversineRadius{
  fields(
  haversine_radius: {
    latitude: 45.100
    longitude: -93.600
    radius: 20
    radius_unit: MILES
  }) {
  total_count
  results {
    sentera_id
    name
    latitude
    longitude
    distance_from_origin
  }
  }
}

{
  "data": {
  "fields": {
    "total_count": 47,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524",
        "latitude": 45.0,
        "longitude": -93.4,
        "distance_from_origin": 7.81365
      }
    ]
  }
  }
}

Fields Constrained by a Bounds

Retrieve fields based on a bounding rectangle (southwest geo coordinate, northeast geo coordinate). This constraint cannot be used with the haversine radius or geometry constraints in the same query.

Try this example in GraphiQL
query FieldsConstrainedByBounds{
  fields(
  bounds: {
    sw_geo_coordinate: {
      latitude: 44.55
      longitude: -93.6
    },
    ne_geo_coordinate: {
      latitude: 44.65
      longitude: -93.5
    }
  }) {
  total_count
  results {
    sentera_id
    name
    latitude
    longitude
  }
  }
}

{
  "data": {
  "fields": {
    "total_count": 47,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524",
        "latitude": 45.0,
        "longitude": -93.4
      }
    ]
  }
  }
}

Fields Constrained by a Geometry

Retrieve fields that are contained within or intersect a geometry defined as GeoJSON. You must specify a polygon or multi-polygon geometry. All other geometry types will be rejected. This constraint cannot be used with the haversine radius or bounds constraints in the same query.

Try this example in GraphiQL
query FieldsConstrainedByGeometry{
  fields(
  geometry: {
    type: "FeatureCollection",
    features: [
      {
        type: "Feature",
        geometry: {
          type: "MultiPolygon",
          coordinates: [
            [
              [
                [
                  -93.698108,
                  44.646164
                ],
                [
                  -93.683173,
                  44.646591
                ],
                [
                  -93.683001,
                  44.630865
                ],
                [
                  -93.690426,
                  44.630865
                ],
                [
                  -93.690512,
                  44.636087
                ],
                [
                  -93.698236,
                  44.636209
                ],
                [
                  -93.698108,
                  44.646164
                ]
              ]
            ]
          ]
        }
      }
    ]
  }) {
  total_count
  results {
    sentera_id
    name
    latitude
    longitude
  }
  }
}

{
  "data": {
  "fields": {
    "total_count": 47,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524",
        "latitude": 45.0,
        "longitude": -93.4
      }
    ]
  }
  }
}

Ordering Fields

Retrieve fields ordered by a specific attribute. Refer here for a complete list of attributes that can be used to order fields.

Try this example in GraphiQL
query OrderingFields{
  fields(
  order_by: NAME
  order_by_direction: DESCENDING
  ) {
  total_count
  results {
    sentera_id
    name
  }
  }
}

{
  "data": {
  "fields": {
    "total_count": 47,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524"
      }
    ]
  }
  }
}

Paginating Fields

Retrieve fields a page at a time.

Try this example in GraphiQL
query PaginatingFields{
  fields(
  pagination: {
    page: 2
    page_size: 30
  }) {
  total_count
  page
  page_size
  results {
    sentera_id
    name
  }
  }
}

{
  "data": {
  "fields": {
    "total_count": 47,
    "page": 2,
    "page_size": 30,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524"
      }
    ]
  }
  }
}

Fields imported from John Deere

Lists fields a user has access to that are imported from John Deere. Any entry in the ExternalPartners enum is valid.

Try this example in GraphiQL
query JDFields{
  fields(external_reference: { partner: JOHN_DEERE }) {
  total_count
  results {
    sentera_id
    name
    latitude
    longitude
    external_id
    external_partner
  }
  }
}

{
  "data": {
  "fields": {
    "total_count": 47,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524",
        "latitude": 45.0,
        "longitude": -93.4,
        "external_id": "1234/fields/ca1d284e-6112-41d8-914e-429f33d7ea34",
        "external_partner": "JOHN_DEERE"
      }
    ]
  }
  }
}

A specific field imported from John Deere

Lists all fields that match a specific external ID and source. We can import the same field multiple times so this might return more than one field for this ID and partner combination.

Try this example in GraphiQL
query JDFields{
  fields(external_reference: { id: "ca1d284e-6112-41d8-914e-429f33d7ea34", partner: JOHN_DEERE }) {
  total_count
  results {
    sentera_id
    name
    latitude
    longitude
    external_id
    external_partner
  }
  }
}

{
  "data": {
  "fields": {
    "total_count": 1,
    "results": [
      {
        "sentera_id": "zx0tsts_AS_SHORT1_CV_test_1ba88e5_170907_220547",
        "name": "Field 5524",
        "latitude": 45.0,
        "longitude": -93.4,
        "external_id": "123456/fields/ca1d284e-6112-41d8-914e-429f33d7ea34",
        "external_partner": "JOHN_DEERE"
      }
    ]
  }
  }
}