New Data Source: Wild GraphQL Data Source

Hello,

I’ve been working on a new GraphQL plugin over the last few months: Wild GraphQL Data Source

This plugin aims to make the experience of writing GraphQL queries easy, as it has a built-in GraphiQL editor with autocompletion. Partitioning by fields is done implicitly when labels are specified, which causes multiple data frames to be emitting, resulting in multiple data points on a graph.

This is similar to GraphQL Data Source (fifemon-graphql-datasource), but that has not been updated in some time. Please note the two plugins are not compatible, and manual migration is required if you are using fifemon-graphql-datasource and wish to migrate.

I recently submitted the plugin for review and will post updates here as I iron out any final changes I need to make before the plugin can be officially published. I have already released v1.0.0, and any additional releases can be found under releases.

If you wish to test the plugin now, you may do so by allowing unsigned plugins for retrodaredevil-wildgraphql-datasource. Edit your grafana.ini like so:

[plugins]
allow_loading_unsigned_plugins = retrodaredevil-wildgraphql-datasource

After that, install this plugin:

grafana cli --pluginUrl https://github.com/wildmountainfarms/wild-graphql-datasource/releases/download/v1.0.1/retrodaredevil-wildgraphql-datasource-1.0.1.zip plugins install retrodaredevil-wildgraphql-datasource

Please realize that this plugin is not yet approved by Grafana.

The readme best describes the features of this plugin in depth, but I’ll give some highlights here:

  • This is a backend plugin, so alerts are supported
  • Variables are passed as native GraphQL variables - this makes queries portable outside of Grafana and allows for the query to be checked for correctness even with variables included inside of it
  • Multiple parsing options, so you can query many different things at once in a single query and specify multiple data paths
  • Configure specific fields as labels for use in Standard Options > Display Name

Please let me know if you have any questions, and feel free to open an issue if you have problems.

2 Likes

Hi

Thanks for sharing and updating.

We hope that Grafana approve it ASAP so we can starting migration our Dashboard to Wild GraphQL Data Source

Congrats!

I am not seeing any tests in your github repo. Is that something to come in near future?

I have a couple of dashboards in provisioned dashboards: wild-graphql-datasource/provisioned-dashboards at main · wildmountainfarms/wild-graphql-datasource · GitHub

One of those dashboards works out of the box if you were to run npm run dev in one terminal and mage -v build:linux && npm run server in another. The star wars dashboard is fully configured and is one of the dashboards I use to make sure my changes work as expected. I also use the SolarThing dashboard to test changes, but its datasource is not fully configured because there are no public SolarThing GraphQL APIs for others to test on.

Besides the default CI/CD provided by Grafana, it does not currently have any tests. This might change at some point, but with the provisioned dashboards, I find it easy to make sure everything I expect to work stays functional after I make changes.

If others are willing, I would love for others to test this plugin with their own GraphQL API, and report any difficulties they had when trying to integrate with Wild GraphQL Data Source. There are a couple of things that people might have trouble with

  • The date provided by $from and $to are both numbers representing epoch milliseconds. I imagine some people’s GraphQL APIs don’t support epoch millis as input, so I want feedback on how to improve upon that
  • The data source only parses time values as epoch milliseconds or as RFC339 formatted date strings

I’m expecting that there is other stuff that might make integrating this difficult.

2 Likes

I can test it if possible on Grafana Cloud.

1 Like

Yeah you can absolutely give it a shot! I don’t really know anything about installing unsigned plugins to Grafana Cloud instances, so that’ll be up to you to figure out if you go down that route. It might be as easy as editing grafana.ini and running that command like I described.

1 Like

This data source is officially released now! Wild GraphQL Data Source plugin for Grafana | Grafana Labs

2 Likes

@retrodaredevil Ain’t beautiful :wink:
Converted and working as fine.


17008 Tibber

Really glad to hear that it’s working well for you! Let me know if you have any feedback to make the data source better.

1 Like