How to edit a story

For this you will need the Graphql id of the story (see How to get a Story).

This example demonstrates how to change the file (in the Main asset) to another one, the variables are used in the same way as in How to post a story with a file.

graphql
mutation storyEditExample($input: StoryEditInput!) {
storyEdit(input: $input) {
story {
slug
version {
title
mainAsset {
__typename
... on FileAsset {
downloadUrl
embed
mimetype
filesize
}
}
}
}
}
}
variables
{
"input": {
"id": "STORY_ID",
"addedAssets": [
{
"type": "FILE",
"file": ".eJw...xMWA",
"uuid": "GENERATED_UUID"
}
],
"mainAsset": "GENERATED_UUID",
"title": "My story with a new file as main asset"
}
}

Was this page helpful?