import_images

Import images into a survey.

Input fields

images ([ImageImport!]!)

An array of ImageImports representing the uploaded images.

survey_sentera_id (ID!)

The ID of the survey into which these images will be imported.

Return fields

images ([Image!]!)

The Image records created by an import_images mutation.

survey (Survey!)

The Survey that images were attached to.

Examples

Import Images

Import multiple images (uploaded via ActiveStorage) to a given survey with image metadata.

Try this example in GraphiQL
mutation ImportImages {
  import_images(
    survey_sentera_id: "58ag1kg_CO_c9hoChrisOrg_CV_deve_ac5d85f7_190711_163140",
    images: [
      {
        key: "4B3oPSa4ybZcxRxwiC4wHZc3",
        size: 7705701,
        filename: "DJI_0058.JPG",

        camera_make: "camera",
        camera_model: "model",
        captured_at: "2019-07-12T15:30:00Z",
        orientation: 1,
        sensor_type: RGB,
        calculated_index: NONE,
        color_applied: NONE,

        altitude: 320.5,
        latitude: 45.0,
        longitude: -93.0,
        pitch: 0.0,
        roll: 0.0,
        yaw: 0.0
      }
    ]
  ) {
    survey {
      sentera_id
      start_time
    }
    images {
      sentera_id
      filename
      captured_at
    }
  }
}

{
  "data": {
    "import_images": {
      "survey": {
        "sentera_id": "58ag1kg_CO_c9hoChrisOrg_CV_deve_ac5d85f7_190711_163140",
        "start_time": "2019-07-10T12:00:00Z"
      },
      "images": [
        {
          "sentera_id": "aaubw4x_IM_c9hoChrisOrg_CV_deve_e29bc515_190716_162612",
          "filename": "DJI_0058.JPG",
          "captured_at": "2019-07-12T15:30:00Z"
        }
      ]
    }
  }
}