shergold / module-indexer-graph-ql
N/A
1.0
2022-12-22 11:24 UTC
Requires
- php: ~8.1.0
- magento/framework: 103.0.*
- magento/module-backend: 102.0.*
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 头中发送。