0

我是 NodeGraph 的新手,正在尝试 Graphql 查询。我在 Grafana 中找不到节点图所需的正确示例结构。所以我无法弄清楚NodeGraph所需的结构,有人可以帮忙吗?下面分别是我的 Graphql 查询和响应。 我的 Graphql 查询:

  data:exportNodeGraph(input: {nodeGraphType: TEMPLATE, id:1}) {   
    name
    fields {
      ... on GraphNodeField {
        id
        title
      }
      ... on GraphEdgeField {
        id
        source
        target
      }
    }
    frame {
      meta {
        preferredVisualisationType
      } 
    }
  }
}

Response
{
  "data": {
    "exportNodeGraph": [
      {
        "name": "nodes",
        "fields": [
          {
            "id": "1",
            "title": "TITLE"
          },
          {
            "id": "2",
            "title": "Sim-1"
          }
        ],
        "frame": {
          "meta": {
            "preferredVisualisationType": "nodeGraph"
          }
        }
      },
      {
        "name": "edges",
        "fields": [
          {
            "id": "1--2",
            "source": "1",
            "target": "2"
          },
        ],
        "frame": {
          "meta": {
            "preferredVisualisationType": "nodeGraph"
          }
        }
      }
    ]
  }
}```
4

0 回答 0