shergold/module-indexer-graph-ql

N/A

安装: 4

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:magento2-module

1.0 2022-12-22 11:24 UTC

This package is auto-updated.

Last update: 2024-09-22 18:42:30 UTC


README

提供GraphQL查询以访问索引信息。

GraphQL配置

GraphQL查询

query($indexes: [String!]) {
  indexerState(indexer: $indexes ) {
    total_count,
    items {
      id,
      title,
      status,
      update_on,
      schedule_status,
      updated
    }
  }
}

GraphQL参数

索引数组包含需要检查的所需索引列表,若要获取所有索引的完整列表,请将数组留空。

{
  "indexes": [
    "catalog_data_exporter_product_attributes",
    "catalogrule_product"
  ]
}

GraphQL头

Indexer-Auth-Key 是必需的,并且需要与已添加到 commerce 管理配置中的密钥匹配。

GraphQL示例响应

{
  "data": {
    "indexerState": {
      "total_count": 2,
      "items": [
        {
          "id": "catalogrule_product",
          "title": "Catalog Product Rule",
          "status": "Ready",
          "update_on": "Schedule",
          "schedule_status": "idle (0 in backlog)",
          "updated": "2022-12-22 14:12:03"
        },
        {
          "id": "catalog_data_exporter_product_attributes",
          "title": "Catalog Attributes Feed",
          "status": "Ready",
          "update_on": "Schedule",
          "schedule_status": "idle (0 in backlog)",
          "updated": "2022-12-22 14:12:03"
        }
      ]
    }
  }
}

Commerce配置

设置 商店 > 配置 > 安全 > GraphQL > 索引状态 > 密钥,此密钥应为密码等级,并在 Indexer-Auth-Key 头中发送。