Magidoc

Bulk Import Operations

Overview

#

Bulk import operations facilitate the efficient importation of large volumes of data into the system. This comprehensive guide outlines the process of executing bulk imports via GraphQL.

Getting Started

#

Prepare JSONL Data

#

Create a JSONL (JSON Lines) file containing the data you want to import. Each line should represent a separate GraphQL input. Example:

    
  

Create Upload

#

Use the following GraphQL mutation to create an upload:

    
  

Provide the JSONL file created in step 1 as the input to this mutation. This will return a presigned URL where the JSONL file can be uploaded.

Upload JSONL File

#

Upload the JSONL file to the URL obtained from the previous step.

Initiate Bulk Operation

#

Execute the following GraphQL mutation to initiate the bulk operation alongside the JSON variables:

    
  

The query below is invalid JSON and will not work. It is only an example of how a mutation might look.

    
  

Provide the mutation to perform the import and the path to the uploaded JSONL file as input to this mutation. This will initiate the bulk import operation.

Wait for Completion

#

Monitor the status of the bulk operation. Wait until it reaches completion.

Additional Notes

#

  • Ensure that the JSONL file adheres to the required format and schema expected by the system.
  • Authenticate requests to the GraphQL endpoint to ensure security and authorization.
  • Handle errors gracefully by checking for and processing userErrors returned in the response payload.