sync_mosaics

Retrieve a list of mosaics that have changed.

Arguments

content_hashes ([String!]!)

An array of content hashes for mosaics the client has previously retrieved.
The server will return mosaics whose content hashes do not match the
client's content hashes.

survey_sentera_id (ID!)

The ID of the survey containing the mosaics to be synced.

Return fields

deleted ([SyncItem!]!)

Items that have been deleted.

failed ([SyncError!])

A list describing errors that occurred during the syncing process.

remaining_count (Int!)

The number of items remaining to be synced.

upserted ([SyncItem!]!)

Items that have been inserted or updated.

Examples

Sync mosaics for a survey

This query is used by a client to sync mosaics for a specific survey with mosaics stored on the server. This query will return up to the first 2,000 mosaics in a survey that are different from the mosaics held by the client. To retrieve the remaining mosaics, a client should call this query repeatedly, passing in the full set of content hashes for mosaics it holds, until no more mosaics are returned, or the remaining count returned is 0.

Try this example in GraphiQL
query SyncSurveyMosaics {
  sync_mosaics(
    survey_sentera_id: "itqkn28_CO_SHORT1_CV_test_dc0d87d_170907_235328"
    content_hashes: [
      "xdNDk/aet07YA1pi"
      "/h9Kp8h1wLAR77g6"
      "pZCIzimW+sJQ1tPP"
      "zShxQoCpBmIvKQzg"
      "qYcc+5d0r6xXrJ+B"
      "1RUHdRg7eewn5Ytc"
      "jut/CTgwHV4nPhHU"
      "3mT/9ITHMbrufod3"
      "Frw7c/jWXG0DGhDp"
      "szY6ppzZ4mJKUK//"
      "szOWioO7aPh41tns"
      "aHhl10uJY5pP8x5Y"
      "s8O1QwaYex8nMGIt"
      "2iZuIOjIq9GToC1k"
      "nZ21khXOu5k96QNW"
    ]
  ) {
    remaining_count
    upserted {
      sentera_id
      content_hash
      created_at
      created_by {
        sentera_id
      }
      updated_at
      updated_by {
        sentera_id
      }
      ... on Mosaic {
        area {
          value
          unit
        }
        captured_at
        image_status
        images {
          total_count
        }
        is_from_sentera_sensor
        message
        mosaic_type
        name
        quality
        released
        survey {
          sentera_id
        }
      }
    }
    deleted {
      sentera_id
      content_hash
    }
  }
}

{
  "data": {
    "sync_mosaics": {
      "remaining_count": 0,
      "upserted": [
        {
          "sentera_id": "84mj0xz_MO_ljkuAcme_CV_deve_12421c42d_211221_133840",
          "content_hash": "BNQNMOsbmmxrH9k3",
          "created_at": "2021-12-21T19:38:40Z",
          "created_by": {
            "sentera_id": "w7agap3_US_ljkuAcme_CV_deve_12421c42d_211221_133838"
          },
          "updated_at": "2021-12-21T23:38:12Z",
          "updated_by": null,
          "area": {
            "value": 100,
            "unit": "ACRE"
          },
          "captured_at": "2021-12-16T21:23:53Z",
          "image_status": "AVAILABLE",
          "images": {
            "total_count": 10
          },
          "is_from_sentera_sensor": true,
          "message": "Example message",
          "mosaic_type": "WEED_DETECTION",
          "name": "Example",
          "quality": "FULL",
          "released": true,
          "survey": {
            "sentera_id": "f1xht9x_CO_ljkuAcme_CV_deve_12421c42d_211221_133840"
          }
        }
      ],
      "deleted": [
        {
          "sentera_id": "wivyzrk_MO_ljkuAcme_CV_deve_12421c42d_211221_133840",
          "content_hash": "KrYpFM4/mMpkijFw"
        }
      ]
    }
  }
}