Requires Any of write_content, write_online_store_pages access scopes.

Updates an article.


Anchor to article
article
required

The properties of the article to be updated.

The properties of the blog to be created.

Anchor to id
id
required

The ID of the article to be updated.


Was this section helpful?

Anchor to ArticleUpdatePayload.article
article

The article that was updated.

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation articleUpdate($article: ArticleUpdateInput!, $id: ID!) {
  articleUpdate(article: $article, id: $id) {
    article {
      # Article fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "article": {
    "author": {
      "name": "<your-name>",
      "userId": "gid://shopify/<objectName>/10079785100"
    },
    "blogId": "gid://shopify/<objectName>/10079785100",
    "body": "<p>Grey cotton knit sweater.</p>",
    "handle": "<your-handle>",
    "image": {
      "altText": "<your-altText>",
      "url": "<your-url>"
    },
    "isPublished": true,
    "metafields": [
      {
        "description": "<your-description>",
        "id": "gid://shopify/<objectName>/10079785100",
        "key": "<your-key>",
        "namespace": "<your-namespace>",
        "type": "<your-type>",
        "value": "<your-value>"
      }
    ],
    "publishDate": "2019-09-07T15:50:00Z",
    "redirectNewHandle": true,
    "summary": "<p>Grey cotton knit sweater.</p>",
    "tags": [
      "<your-tags>"
    ],
    "templateSuffix": "<your-templateSuffix>",
    "title": "<your-title>"
  },
  "blog": {
    "title": "<your-title>"
  },
  "id": "gid://shopify/<objectName>/10079785100"
}
input ArticleUpdateInput {
  author: AuthorInput
  blogId: ID
  body: HTML
  handle: String
  image: ArticleImageInput
  isPublished: Boolean
  metafields: [MetafieldInput!]
  publishDate: DateTime
  redirectNewHandle: Boolean
  summary: HTML
  tags: [String!]
  templateSuffix: String
  title: String
}

input AuthorInput {
  name: String
  userId: ID
}

input ArticleImageInput {
  altText: String
  url: String
}

input MetafieldInput {
  description: String
  id: ID
  key: String
  namespace: String
  type: String
  value: String
}

input ArticleBlogInput {
  title: String!
}