upsert_plant_activities

Upsert (create and/or update) one or more plant activities for a field.

Input fields

organization_sentera_id (ID!)

The ID of the Organization that these FieldActivities will be upserted into.

plant_activities ([PlantActivityImport!]!)

An array of PlantActivityImport objects to upsert. The limit is 100 plant activities.

Return fields

failed ([UpsertError!]!)

Detailed error information for UpsertItems that failed to upsert.

succeeded ([UpsertItem!]!)

UpsertItems that have been successfully upserted.

Examples

Upsert Plant Activities

Creates or update one or more 'plant' field activities for a field within an organization.

Try this example in GraphiQL
mutation UpsertPlantActivities {
  upsert_plant_activities(
    organization_sentera_id: "02x8kdv_OR_snacPancake_CV_stag_5f823b7_200921_215716"
    plant_activities: [
      {
        crop_season_sentera_id: "ncezxgv_CS_s2cmBilling23_CV_stag_ece00bf_200914_230416"
        applied_at: "2020-05-05T10:00:00Z"
        product_name: "Super WOW Barley"
        average_rate: 20.0
        unit: LBS_PER_ACRE
        area: { value: 5, unit: ACRE }
      },
      {
        sentera_id: "0qr4yo8_FA_s2cmBilling23_CV_stag_ece00bf_200914_230416"
        row_spacing: 18
        row_spacing_unit: INCHES
      },
      {
        crop_season_sentera_id: "9hk5avl_CS_s2cmBilling23_CV_stag_ece00bf_200914_230416"
        applied_at: "2020-05-05T10:00:00Z"
        product_name: "No Unit Barley"
        area: { value: 5, unit: ACRE }
      }
    ]
  ) {
    succeeded {
      sentera_id
      ... on PlantActivity {
        applied_at
        product_name
        application_area {
          value
          unit
        }
        application_rate {
          value
          unit
        }
      }
    }
    failed {
      index
      item {
        sentera_id
        ... on FieldActivity {
          applied_at
        }
      }
      attributes {
        attribute
        key
        details
        message
      }
    }
 }

}

{
  "data": {
    "upsert_plant_activities": {
      "succeeded": [
        {
          "sentera_id": "oncezxgv_CS_s2cmBilling23_CV_stag_ece00bf_200914_230416",
          "applied_at": "2020-05-05T10:00:00Z",
          "product_name": "Super WOW Barley",
          "application_area": {
            "value": 5,
            "unit": "ACRE"
          },
          "application_rate": {
            "value": 20,
            "unit": "LBS_PER_ACRE"
          }
        },
        {
          "sentera_id": "osu5t9n_FA_SHORT1_CV_test_18ae300d0_200210_143838",
          "applied_at": "2020-05-01T14:00:00Z",
          "product_name": "Super Barley",
          "application_area": {
            "value": 5,
            "unit": "ACRE"
          },
          "application_rate": {
            "value": 20,
            "unit": "LBS_PER_ACRE"
          },
          "row_spacing": 18,
          "row_spacing_unit": "INCHES"
        }
      ],
      "failed": [
        {
          "item": {
            "applied_at": "2020-05-05T10:00:00Z"
          },
          "attributes": [
            {
              "attribute": "unit",
              "key": "blank",
              "message": "can't be blank"
            }
          ]
        }
      ]
    }
  }
}