upsert_flight_tasks

Upsert (create and/or update) one or more flight tasks for an organization.

Input fields

flight_tasks ([FlightTaskImport!]!)

An array of FlightTaskImport objects to upsert. The limit is 100 flight tasks.

organization_sentera_id (ID)
Deprecation notice

Organization Sentera ID is now available per entry in the flight_tasks list.

The ID of the organization that these flight tasks will be upserted into.

Return fields

failed ([UpsertError!]!)

Detailed error information for UpsertItems that failed to upsert.

succeeded ([UpsertItem!]!)

UpsertItems that have been successfully upserted.

Examples

Upsert Flight Tasks

Creates and/or updates one or more flight tasks with one mutation request.

Try this example in GraphiQL
mutation UpsertFlightTasks {
  upsert_flight_tasks(
    organization_sentera_id: "02x8kdv_OR_snacPancake_CV_stag_5f823b7_200921_215716"
    flight_tasks: [
      {
        field_sentera_id: "q1xgn9n_AS_SHORT1_CV_test_54364c66_190124_151245",
        plan_sentera_id: "myyr2ch_FS_qaumAcme_CV_deve_2b49feedd_220307_145811",
        name: "Example Flight Task"
      },
      {
        field_sentera_id: "q1xgn9n_AS_SHORT1_CV_test_54364c66_190124_151245",
      }
    ]
  ) {
    succeeded {
      ... on FlightTask {
        sentera_id
        name
      }
    }
    failed {
      index
      item {
        ... on FlightTask {
          sentera_id
        }
      }
      attributes {
        attribute
        key
        details
        message
      }
    }
 }
}

{
  "data": {
    "upsert_flight_tasks": {
      "succeeded": [
        {
          "sentera_id": "5qv8pz3_TA__CV_deve_e7acf4c0d_201015_110238",
          "name": "Example Flight Task"
        }
      ],
      "failed": [
        {
          "item": {
            "field_sentera_id": "q1xgn9n_AS_SHORT1_CV_test_54364c66_190124_151245"
          },
          "attributes": [
            {
              "attribute": "name",
              "key": "blank",
              "message": "can't be blank"
            }
          ]
        }
      ]
    }
  }
}

Associate a Flight Task with a Plan

Create a flight task and associate it with a plan.

Try this example in GraphiQL
mutation AssociateFlightTaskWithPlan {
  upsert_flight_tasks(
    organization_sentera_id: "02x8kdv_OR_snacPancake_CV_stag_5f823b7_200921_215716"
    flight_tasks: [
      {
        field_sentera_id: "q1xgn9n_AS_SHORT1_CV_test_54364c66_190124_151245"
        name: "Example Flight Plan"
        plan_sentera_id: "o2miljd_FS_s2cmBilling23_CV_deve_bae9392_200206_223021"
      }
    ]
  ) {
    succeeded {
      ... on FlightTask {
        name
        plan {
          sentera_id
        }
      }
    }
    failed {
      index
      item {
        ... on FlightTask {
          sentera_id
        }
      }
      attributes {
        attribute
        key
        details
        message
      }
    }
  }
}

{
  "data": {
    "upsert_flight_tasks": {
      "succeeded": [
        {
          "name": "Example Flight Task",
          "plan": {
            "sentera_id": "o2miljd_FS_s2cmBilling23_CV_deve_bae9392_200206_223021"
          }
        }
      ]
    }
  }
}

Associate a Flight Task with a Survey

Associate a flight task with the survey that resulted from performing the task. Can be any survey on the field to which the task is assigned.

Try this example in GraphiQL
mutation AssociateFlightTaskWithSurvey {
  upsert_flight_tasks(
    organization_sentera_id: "02x8kdv_OR_snacPancake_CV_stag_5f823b7_200921_215716"
    flight_tasks: [
      {
        sentera_id: "5qv8pz3_TA__CV_deve_e7acf4c0d_201015_110238",
        survey_sentera_id: "eds3on5_CO_gnkwJakeOrg_CV_deve_be7772e1_181121_140430"
      }
    ]
  ) {
    succeeded {
      ... on FlightTask {
        status
        survey {
          sentera_id
        }
      }
    }
    failed {
      index
      item {
        ... on FlightTask {
          sentera_id
        }
      }
      attributes {
        attribute
        key
        details
        message
      }
    }
  }
}

{
  "data": {
    "upsert_flight_tasks": {
      "succeeded": [
        {
          "status": "OPEN",
          "survey": {
            "sentera_id": "rfo1rl3_AS_gnkwJakeOrg_CV_deve_be7772e1_181121_140430"
          }
        }
      ]
    }
  }
}