mutation stagedUploadsCreate returns resourceUrl null

Hi,

I’m trying to upload a JSONL file to use in a bulk update operation using Shopify’s GraphQL API.
According to this documentation https://shopify.dev/api/usage/bulk-operations/imports . I need to use the stageUploadCreate mutation to reserve an URL to upload the file.

This is my mutation request :

mutation MyMutation {
  stagedUploadsCreate(
    input: {resource: BULK_MUTATION_VARIABLES, filename: "metafieldToUpdate.jsonl", mimeType: "text/jsonl", httpMethod:POST}
  ) {
    stagedTargets {
      resourceUrl
      url
      parameters {
        name
        value
      }
    }
        userErrors {
      field
      message
    }
  }
}

I get the response with all the fields except for the “resourceUrl” which shows “null”. And I need the attribute since is part of the URL to post the file to Shopify’s S3 bucket.

Here is another article I’ve been using as a guide in case it helps you understand what I’m trying to do. https://www.shopify.com/partners/blog/upload-files-graphql-react

2 Likes