Skip to content

Latest commit

 

History

History
56 lines (48 loc) · 831 Bytes

04_Asset_Mutations.md

File metadata and controls

56 lines (48 loc) · 831 Bytes

Asset Mutations

Create Asset

This will create an Asset with uploading data provided:

mutation {
  createAsset(
    parentId: 1,
    filename: "foo.png",
    type: "image",
    input: {
      data: "ewogICAgImZpZWxkY29sbGVjdGlvbiI6IFsKICAgICAgICB7CiAgICAgICAgICAgICJwYXJlbn...."
    }) {
    success
    message
  }
}

Update Asset

This will rename the Asset and update the data. Request:

mutation {
  updateAsset(id: 76, input: {filename:"newfilename",
  data:"iVBORw0KGgoAAAANSUhEUg....."}) {
    success
    message
    assetData {
         modificationDate
    }   
  }
}

Delete Asset

mutation {
  deleteAsset(id: 533) {
    success
    message
  }
}

or

mutation {
  deleteAsset(fullpath: "/Sample Content/Background Images/foo.png") {
    success
    message
  }
}