younifyd
Menu

fileCreate

Creates file assets for a store from external URLs or files that were previously uploaded using the stagedUploadsCreate mutation.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the fileCreate action (under File).
  3. Fill in the fields below, then reference the result from later steps as {{filecreate.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation FileCreate($files: [FileCreateInput!]!) {
  fileCreate(files: $files) {
    files {
      alt
      createdAt
      fileErrors {
        code
        details
        message
      }
      fileStatus
      id
      preview {
        image
        status
      }
      updatedAt
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

filesarray<object>required

List of new files to be created.

filenamestring
contentTypestring

One ofIMAGEFILEVIDEOEXTERNAL_VIDEOMODEL_3D

altstring
duplicateResolutionModestring

One ofAPPEND_UUIDRAISE_ERRORREPLACE

originalSourcestringrequired
json
{
  "files": [
    {
      "originalSource": "string",
      "filename": "string",
      "contentType": "IMAGE",
      "alt": "string",
      "duplicateResolutionMode": "APPEND_UUID"
    }
  ]
}

Response

Read the result with {{filecreate.response.data.data.fileCreate}}. If the API returns errors, the step fails and they are at {{filecreate.response.data.errors}}.

filesarray<object>
altobject
createdAtobject
fileErrorsobject
fileStatusobject
idobject
previewobject
updatedAtobject
userErrorsarray<object>
codeobject
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.

fileCreate — Shopify — Documentation