File Create Payload
Return type for mutation.
Anchor to FieldsFields
- Anchor to filesfiles•[File!]
The newly created files.
- Anchor to userErrorsuser•[Files
Errors User Error!]! non-null The list of errors that occurred from executing the mutation.
Anchor to Mutations with this payloadMutations with this payload
- •mutation
Creates file assets for a store from external URLs or files that were previously uploaded using the
mutation.
Use the
mutation to add various types of media and documents to your store. These files are added to the Files page in the Shopify admin and can be referenced by other resources in your store.
The
mutation supports multiple file types:
- Images: Product photos, variant images, and general store imagery
- Videos: Shopify-hosted videos for product demonstrations and marketing
- External videos: YouTube and Vimeo videos for enhanced product experiences
- 3D models: Interactive 3D representations of products
- Generic files: PDFs, documents, and other file types for store resources
The mutation handles duplicate filenames using configurable resolution modes that automatically append UUIDs, replace existing files, or raise errors when conflicts occur.
NoteAfter creating files, you can make subsequent updates using the following mutations:
: Update file properties such as alt text or replace file contents while preserving the same URL.
: Remove files from your store when they are no longer needed.
To list all files in your store, use the
files
query.Learn how to manage product media and file assets in your app.