sync_fields

Retrieve a list of fields that have changed.

Arguments

content_hashes ([String!]!)

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

include_descendant_organizations (Boolean)

List fields on organizations that are descended from the organization provided. Defaults to false.

organization_sentera_id (ID!)

The ID of the organization containing the fields 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 Fields for an Organization

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

Try this example in GraphiQL
query SyncOrganizationFields {
  sync_fields(
  organization_sentera_id: "ezpt0wj_OR_8brhbkSentera_CV_deve_877281e47_210503_085333",
  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
    ... on Field {
      latitude
      longitude
      name
    }
  }
  deleted {
    sentera_id
    content_hash
  }
  }
}

{
  "data": {
  "sync_fields": {
    "remaining_count": 102,
    "upserted": [
      {
        "sentera_id": "w9n9629_AS_8t8cAcme_CV_stag_877281e47_210503_085336",
        "content_hash": "XWbX2szIhrApOpVW",
        "latitude": 45.328761,
        "longitude": -93.521094,
        "name": "Example Field"
      }
    ],
    "deleted": [
      {
        "sentera_id": "dfaxv57_AS_SHORT1_CV_stag_dc0d87d_170907_235328",
        "content_hash": "DwnxuWkm8Lo6bC5R"
      }
    ]
  }
  }
}