createFile mutation doesn't accept documented input type for $files variable

Topic summary

createFile returned an error because the mutation variable $files used FileCreateInput, which was reported as an undefined input type, even when copying the example from the official documentation.

  • Shared example: mutation fileCreate($files: [FileCreateInput!]!) with a files array containing originalSource.
  • Returned error: FileCreateInput / FileUpdateInput isn't a defined input type for $files.

The issue was clarified in a follow-up: the mutation appears to be available only in the latest Shopify Admin GraphQL API version. This suggests the problem was not the query structure itself, but using an API version that did not yet include that input type.

Current outcome:

  • Initial confusion was resolved by identifying an API version mismatch.
  • One open question remains: whether uploading a JSON file with this mutation works successfully.

No code changes or broader workaround were provided beyond using the correct API version.

Summarized with AI on March 5. AI used: gpt-5.4.

The createFile mutation doesn’t seem to accept it’s documented input type for variable $files. I’m trying the exact code from the example documented here and I’m getting the following error message: FileCreateInput isn't a defined input type (on $files).

Can someone confirm this is the case and is either a bug in the API or a wrong documentation? Thanks in advance!

The full query and variables: (FileUpdateInput in error message should be FileCreateInput, I tried both)

// Mutation query
mutation fileCreate($files: [FileCreateInput!]!) {
  fileCreate(files: $files) {
    files {
      alt
      createdAt
    }
    userErrors {
      code
      field
      message
    }
  }
}

// Variables object
{
  "files": [
    {
      "originalSource": "placeholder"
    }
  ]
}

// Response
{"status":500,"error":{"message":"FileUpdateInput isn't a defined input type (on $files)"}}

Nevermind, I now see this API was only just released in the lastest API version.

Have you succeeded to upload a Jason file with that?