最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Shopify Graphql - Pending status for image when try to update attributes - Stack Overflow

programmeradmin0浏览0评论

I am trying to change the filename and the alt attribute of a file using GraphQL, but Shopify responds that the image is pending.

This is my Ruby code to update a product with id gid://shopify/MediaImage/62897652531549

I want to change filename and alt attribute

client = ShopifyAPI::Clients::Graphql::Admin.new(session: ShopifyAPI::Context.active_session)

query = <<~QUERY
  mutation fileUpdate($input: [FileUpdateInput!]!) {
    fileUpdate(files: $input) {
      files {
        ... on MediaImage {
          id
          image {
            url
          }
        }
      }
      userErrors {
        message
      }
    }
  }
QUERY

variables = {
  "input": {
    "id": "gid://shopify/MediaImage/62897652531549",
    "filename": "name.jpg",
    alt: "name"

  }
}

response = client.query(query: query, variables: variables)
pp response

Response:

{"files"=>nil, "userErrors"=>[{"message"=>"File id 62897652531549 has a pending operation."}]}}

I can’t understand how to change the image status and why it has operations in pending mode.

I dont’ find any information online about this problem and how to see the operations in pending mode on my file

发布评论

评论列表(0)

  1. 暂无评论