Change graphql response to object instead of array?

Hi,

I am trying to integrate Stardog with Grafana, using the Graphql plugin but having issues with the response format.

The graphql response from Stardog typically looks like:

{
  "data": [
    {
      "timestamp":  "2022-03-10T09:51:53+0000",
      "value": 1
    },
    {
      "timestamp": "2022-03-10T09:56:58+0000",
      "value": 4
    }
  ]
}

Ie., the response is an array with items.

But the plugin requires the reponse to be a object where each key would correpond to a timeseries in Grafana.

So the desired response structure would be something like:

{
  "data": {
    "timeseries":  [
       {
          "timestamp":  "2022-03-10T09:51:53+0000",
          "value": 1
       },
      {
         "timestamp": "2022-03-10T09:56:58+0000",
         "value": 4
      }
    ]
  }
}

Is it possible to get Stardog graphql end point to return the reponse in this format?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.