Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

Solved

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

nolledgeable
Visitor
2 1 0

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)"}}

 

Accepted Solution (1)

nolledgeable
Visitor
2 1 0

This is an accepted solution.

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

View solution in original post

Replies 2 (2)

nolledgeable
Visitor
2 1 0

This is an accepted solution.

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

Avi_Ben_Zaken
Shopify Partner
18 0 6

Have you succeeded to upload a Jason file with that?