fileCreate mutation

Version unstable

Creates file assets using external url or for files that were previously uploaded using the stagedUploadsCreate mutation. These files are added to the Files page in Shopify admin.

Required access

write_files access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
files ( [FileCreateInput!]! ) required

List of new files to be created.

FileCreateInput fields

  • alt (String)

    The alt text associated with the file.

  • contentType (FileContentType)

    The file content type.

  • originalSource (String!) Required

    An external URL or a signed upload URL of the file object.

Return fields

  • files ([File!])

    The newly created files.

  • userErrors ([FilesUserError!]!)

    List of errors that occurred from executing the mutation.

Version 2021-10 (Release candidate)

Creates file assets using external url or for files that were previously uploaded using the stagedUploadsCreate mutation. These files are added to the Files page in Shopify admin.

Required access

write_files access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.