Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Add GraphQL datasource #602

Merged
merged 1 commit into from
Aug 18, 2020
Merged

Add GraphQL datasource #602

merged 1 commit into from
Aug 18, 2020

Conversation

retzkek
Copy link
Contributor

@retzkek retzkek commented Apr 21, 2020

Datasource plugin that provides access to a GraphQL API for numerical timeseries
data, general/tabular data, and annotations (thanks @retrodaredevil!).

Examples using GitHub API (using user's GitHub OAuth token):

Example using Deutsche Bahn public timetable API to show train arrivals:

Configuration

URL: https://bahnql.herokuapp.com/graphql

Table with train number and platform

Query:

{
  station:stationWithEvaId(evaId: 8000105) {
    timetable {
      nextArrivals {
        Time:time
        trainNumber
        platform
      }
    }
  }
}

Data path: station.timetable.nextArrivals

Annotations

Query and datapath same as above
Title: $field_trainNumber
Text: Platform $field_platform

Screenshot

image

@retzkek
Copy link
Contributor Author

retzkek commented Apr 24, 2020

We're going to put in a breaking change to eliminate the need to include the top-level "data" in the data path. I'll update this PR once that's released.

@briangann briangann added submission/new Submission is a new plugin type/datasource Categorizes the submission as a data source labels May 1, 2020
@retzkek
Copy link
Contributor Author

retzkek commented May 22, 2020

So it seems that a build of the plugin with 6.x libraries won't run under 7.0, and vice-versa, so now I have builds for both, but there's no way to indicate that in the plugin repo? Not that I'm too keen on maintaining parallel builds indefinitely, but probably at least until 7.1 is out.

@marcusolsson
Copy link
Contributor

Hi @retzkek! Really cool plugin!

I tested the data source and it worked as I expected it to 👍

Before I can publish this, however, I need you to fix the errors reported by the plugin validator. You can enter the URL to this PR, or to a specific commit.

@marcusolsson marcusolsson added the milestone/needs-changes Submission needs changes before it can be approved label Aug 12, 2020
@retzkek
Copy link
Contributor Author

retzkek commented Aug 14, 2020

@marcusolsson ❤️ the validator! Now passing with flying colors 😄

@marcusolsson
Copy link
Contributor

Published! Thank you for contributing! ❤️

@marcusolsson marcusolsson merged commit 576b49f into grafana:master Aug 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
milestone/needs-changes Submission needs changes before it can be approved submission/new Submission is a new plugin type/datasource Categorizes the submission as a data source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants