Skip to content

Commit b311c2c

Browse files
committed
upgrade libs and bump version
1 parent db9175c commit b311c2c

7 files changed

Lines changed: 1387 additions & 1651 deletions

File tree

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# v1.2.0
2+
3+
- **improvement** Add support for dashboard variable queries (@ggranberry #38)
4+
- **bug fix** Properly scope variables, fixes repeated panel queries (@retzkek #41)
5+
6+
# v1.1.4
7+
8+
- **improvement** Use templateSrv to interpolate timeFrom and timeTo variables. (@carvid #31)
9+
- **bug fix** Fix error in isRFC3339_ISO6801 when field is non-string (@ricochet1k #32, @retzkek #33)
10+
11+
# v1.1.3
12+
13+
- use `QueryField` component for a nicer query editing experience (@michaelneale #24)
14+
- packaging, documentation, and testing improvements (@michaelneale #27, @retzkek #29)
15+
- **DEPRECATED**: no more Grafana 6 releases
16+
17+
# v1.1.2
18+
19+
- Fix aliases in Grafana 7
20+
21+
# v1.1.1
22+
23+
- Fixes error when null field in response
24+
25+
# v1.1.0
26+
27+
- **BREAKING**: top-level `data` should no longer be included in data paths
28+
- support multiple data paths, comma-separated
29+
30+
# v1.0.0
31+
32+
Initial release, basic support for tabular and timeseries data and annotations.

README.md

Lines changed: 65 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
# GraphQL Data Source
22

3+
![CI](https://github.com/fifemon/graphql-datasource/workflows/CI/badge.svg)
4+
35
[Grafana](https://grafana.com) datasource plugin that provides access to a
4-
GraphQL API for numerical timeseries data, general/tabular data, and
5-
annotations.
6-
7-
* The GraphQL query must be structured so that the data of interest is returned
8-
under the configurable data path (default `data`) in the response. If the
9-
object at that path is an array it will be iterated over, with each object added
10-
as a row in the data frame, otherwise the result object will be the only row.
11-
* Can be separated by commas to use multiple data paths
12-
* Timeseries data requires a field named `Time` containing the timestamp in a
13-
format that can be parsed by `moment()` (e.g. ISO8601).
14-
* Nested types will be flattened into dot-delimited fields.
15-
* Grafana variables should be substituted directly in the query (instead of
16-
using GraphQL variables). The dashboard time ranges are available in the
17-
[global variables](https://grafana.com/docs/grafana/latest/variables/variable-types/global-variables/)
18-
`$__from` and `$__to` as millisecond epoch (or in whatever format is needed by the API
19-
in Grafana 7.1.2 or later).
20-
* Group by can be used to group elements into multiple data points.
21-
* Alias by is used to alter the name of the field displayed in the legend. `$field_<field.name>` is substituted with the
22-
values of the field and `$fieldName` is substituted with the name of the field.
6+
GraphQL API for numerical timeseries data, general/tabular data,
7+
annotations, and dashboard variables.
8+
9+
- The GraphQL query must be structured so that the data of interest is returned
10+
under the configurable data path (default `data`) in the response. If the
11+
object at that path is an array it will be iterated over, with each object added
12+
as a row in the data frame, otherwise the result object will be the only row.
13+
- Can be separated by commas to use multiple data paths
14+
- Timeseries data requires a field named `Time` containing the timestamp in a
15+
format that can be parsed by `moment()` (e.g. ISO8601).
16+
- Nested types will be flattened into dot-delimited fields.
17+
- Grafana variables should be substituted directly in the query (instead of
18+
using GraphQL variables). The dashboard time ranges are available in the
19+
[global variables](https://grafana.com/docs/grafana/latest/variables/variable-types/global-variables/)
20+
`$__from` and `$__to` as millisecond epoch (or in whatever format is needed by the API
21+
in Grafana 7.1.2 or later).
22+
- Group by can be used to group elements into multiple data points.
23+
- Alias by is used to alter the name of the field displayed in the legend.
24+
`$field_<field.name>` is substituted with the values of the field and
25+
`$fieldName` is substituted with the name of the field.
2326

2427
# Screenshots
2528

@@ -37,13 +40,16 @@ examples and tutorials.
3740

3841
```graphql
3942
query {
40-
submissions(user:"$user", from:"$__from", to:"$__to"){
41-
Time:submitTime
42-
idle running completed
43-
}
43+
submissions(user: "$user", from: "$__from", to: "$__to") {
44+
Time: submitTime
45+
idle
46+
running
47+
completed
48+
}
4449
}
4550
```
46-
* Data path: `submissions`
51+
52+
- Data path: `submissions`
4753

4854
Note the use of the global `$__from` and `$__to` variables to insert the
4955
dashboard time range into the query, alongside a dashboard variable `$user`.
@@ -52,21 +58,26 @@ dashboard time range into the query, alongside a dashboard variable `$user`.
5258

5359
```graphql
5460
query {
55-
data:queryAll(from:"$__from", to:"$__to", sourceId:"default") {
56-
batteryVoltage {
57-
Time:dateMillis
58-
packet {
59-
batteryVoltage
60-
identifier { representation }
61-
identityInfo { displayName }
62-
}
61+
data: queryAll(from: "$__from", to: "$__to", sourceId: "default") {
62+
batteryVoltage {
63+
Time: dateMillis
64+
packet {
65+
batteryVoltage
66+
identifier {
67+
representation
68+
}
69+
identityInfo {
70+
displayName
6371
}
72+
}
6473
}
74+
}
6575
}
6676
```
67-
* Data path: `data.batteryVoltage`
68-
* Group by: `packet.identifier.representation`
69-
* Alias by: `$field_packet.identityInfo.displayName`
77+
78+
- Data path: `data.batteryVoltage`
79+
- Group by: `packet.identifier.representation`
80+
- Alias by: `$field_packet.identityInfo.displayName`
7081

7182
In the above example, "Group by" and "Alias by" are defined. "Group by" allows
7283
you to split up an array of data into multiple data points. "Alias by" is used
@@ -82,28 +93,29 @@ querying multiple numeric fields that you want displayed in your graph.
8293

8394
```graphql
8495
query {
85-
server1:queryEvents(from: "$__from", to:"$__to", server:"server1") {
86-
birthdayEvent {
87-
Time:dateMillis
88-
person {
89-
fullName
90-
}
91-
}
96+
server1: queryEvents(from: "$__from", to: "$__to", server: "server1") {
97+
birthdayEvent {
98+
Time: dateMillis
99+
person {
100+
fullName
101+
}
92102
}
93-
server2:queryEvents(from: "$__from", to:"$__to", server:"server2") {
94-
birthdayEvent {
95-
Time:dateMillis
96-
person {
97-
fullName
98-
}
99-
}
103+
}
104+
server2: queryEvents(from: "$__from", to: "$__to", server: "server2") {
105+
birthdayEvent {
106+
Time: dateMillis
107+
person {
108+
fullName
109+
}
100110
}
111+
}
101112
}
102113
```
103-
* Data path: `server1.birthdayEvent, server2.birthdayEvent`
104-
* Title: `Birthday yay!`
105-
* Text: `$field_person.fullName`
106-
* Tags: `tag1, tag2`
114+
115+
- Data path: `server1.birthdayEvent, server2.birthdayEvent`
116+
- Title: `Birthday yay!`
117+
- Text: `$field_person.fullName`
118+
- Tags: `tag1, tag2`
107119

108120
The above annotation example is similar to regular queries. You must have a
109121
`Time` field and are able to define a data path. Similar to the last example,

dist/CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# v1.2.0
2+
3+
- **improvement** Add support for dashboard variable queries (@ggranberry #38)
4+
- **bug fix** Properly scope variables, fixes repeated panel queries (@retzkek #41)
5+
6+
# v1.1.4
7+
8+
- **improvement** Use templateSrv to interpolate timeFrom and timeTo variables. (@carvid #31)
9+
- **bug fix** Fix error in isRFC3339_ISO6801 when field is non-string (@ricochet1k #32, @retzkek #33)
10+
11+
# v1.1.3
12+
13+
- use `QueryField` component for a nicer query editing experience (@michaelneale #24)
14+
- packaging, documentation, and testing improvements (@michaelneale #27, @retzkek #29)
15+
- **DEPRECATED**: no more Grafana 6 releases
16+
17+
# v1.1.2
18+
19+
- Fix aliases in Grafana 7
20+
21+
# v1.1.1
22+
23+
- Fixes error when null field in response
24+
25+
# v1.1.0
26+
27+
- **BREAKING**: top-level `data` should no longer be included in data paths
28+
- support multiple data paths, comma-separated
29+
30+
# v1.0.0
31+
32+
Initial release, basic support for tabular and timeseries data and annotations.

dist/README.md

Lines changed: 65 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
# GraphQL Data Source
22

3+
![CI](https://github.com/fifemon/graphql-datasource/workflows/CI/badge.svg)
4+
35
[Grafana](https://grafana.com) datasource plugin that provides access to a
4-
GraphQL API for numerical timeseries data, general/tabular data, and
5-
annotations.
6-
7-
* The GraphQL query must be structured so that the data of interest is returned
8-
under the configurable data path (default `data`) in the response. If the
9-
object at that path is an array it will be iterated over, with each object added
10-
as a row in the data frame, otherwise the result object will be the only row.
11-
* Can be separated by commas to use multiple data paths
12-
* Timeseries data requires a field named `Time` containing the timestamp in a
13-
format that can be parsed by `moment()` (e.g. ISO8601).
14-
* Nested types will be flattened into dot-delimited fields.
15-
* Grafana variables should be substituted directly in the query (instead of
16-
using GraphQL variables). The dashboard time ranges are available in the
17-
[global variables](https://grafana.com/docs/grafana/latest/variables/variable-types/global-variables/)
18-
`$__from` and `$__to` as millisecond epoch (or in whatever format is needed by the API
19-
in Grafana 7.1.2 or later).
20-
* Group by can be used to group elements into multiple data points.
21-
* Alias by is used to alter the name of the field displayed in the legend. `$field_<field.name>` is substituted with the
22-
values of the field and `$fieldName` is substituted with the name of the field.
6+
GraphQL API for numerical timeseries data, general/tabular data,
7+
annotations, and dashboard variables.
8+
9+
- The GraphQL query must be structured so that the data of interest is returned
10+
under the configurable data path (default `data`) in the response. If the
11+
object at that path is an array it will be iterated over, with each object added
12+
as a row in the data frame, otherwise the result object will be the only row.
13+
- Can be separated by commas to use multiple data paths
14+
- Timeseries data requires a field named `Time` containing the timestamp in a
15+
format that can be parsed by `moment()` (e.g. ISO8601).
16+
- Nested types will be flattened into dot-delimited fields.
17+
- Grafana variables should be substituted directly in the query (instead of
18+
using GraphQL variables). The dashboard time ranges are available in the
19+
[global variables](https://grafana.com/docs/grafana/latest/variables/variable-types/global-variables/)
20+
`$__from` and `$__to` as millisecond epoch (or in whatever format is needed by the API
21+
in Grafana 7.1.2 or later).
22+
- Group by can be used to group elements into multiple data points.
23+
- Alias by is used to alter the name of the field displayed in the legend.
24+
`$field_<field.name>` is substituted with the values of the field and
25+
`$fieldName` is substituted with the name of the field.
2326

2427
# Screenshots
2528

@@ -37,13 +40,16 @@ examples and tutorials.
3740

3841
```graphql
3942
query {
40-
submissions(user:"$user", from:"$__from", to:"$__to"){
41-
Time:submitTime
42-
idle running completed
43-
}
43+
submissions(user: "$user", from: "$__from", to: "$__to") {
44+
Time: submitTime
45+
idle
46+
running
47+
completed
48+
}
4449
}
4550
```
46-
* Data path: `submissions`
51+
52+
- Data path: `submissions`
4753

4854
Note the use of the global `$__from` and `$__to` variables to insert the
4955
dashboard time range into the query, alongside a dashboard variable `$user`.
@@ -52,21 +58,26 @@ dashboard time range into the query, alongside a dashboard variable `$user`.
5258

5359
```graphql
5460
query {
55-
data:queryAll(from:"$__from", to:"$__to", sourceId:"default") {
56-
batteryVoltage {
57-
Time:dateMillis
58-
packet {
59-
batteryVoltage
60-
identifier { representation }
61-
identityInfo { displayName }
62-
}
61+
data: queryAll(from: "$__from", to: "$__to", sourceId: "default") {
62+
batteryVoltage {
63+
Time: dateMillis
64+
packet {
65+
batteryVoltage
66+
identifier {
67+
representation
68+
}
69+
identityInfo {
70+
displayName
6371
}
72+
}
6473
}
74+
}
6575
}
6676
```
67-
* Data path: `data.batteryVoltage`
68-
* Group by: `packet.identifier.representation`
69-
* Alias by: `$field_packet.identityInfo.displayName`
77+
78+
- Data path: `data.batteryVoltage`
79+
- Group by: `packet.identifier.representation`
80+
- Alias by: `$field_packet.identityInfo.displayName`
7081

7182
In the above example, "Group by" and "Alias by" are defined. "Group by" allows
7283
you to split up an array of data into multiple data points. "Alias by" is used
@@ -82,28 +93,29 @@ querying multiple numeric fields that you want displayed in your graph.
8293

8394
```graphql
8495
query {
85-
server1:queryEvents(from: "$__from", to:"$__to", server:"server1") {
86-
birthdayEvent {
87-
Time:dateMillis
88-
person {
89-
fullName
90-
}
91-
}
96+
server1: queryEvents(from: "$__from", to: "$__to", server: "server1") {
97+
birthdayEvent {
98+
Time: dateMillis
99+
person {
100+
fullName
101+
}
92102
}
93-
server2:queryEvents(from: "$__from", to:"$__to", server:"server2") {
94-
birthdayEvent {
95-
Time:dateMillis
96-
person {
97-
fullName
98-
}
99-
}
103+
}
104+
server2: queryEvents(from: "$__from", to: "$__to", server: "server2") {
105+
birthdayEvent {
106+
Time: dateMillis
107+
person {
108+
fullName
109+
}
100110
}
111+
}
101112
}
102113
```
103-
* Data path: `server1.birthdayEvent, server2.birthdayEvent`
104-
* Title: `Birthday yay!`
105-
* Text: `$field_person.fullName`
106-
* Tags: `tag1, tag2`
114+
115+
- Data path: `server1.birthdayEvent, server2.birthdayEvent`
116+
- Title: `Birthday yay!`
117+
- Text: `$field_person.fullName`
118+
- Tags: `tag1, tag2`
107119

108120
The above annotation example is similar to regular queries. You must have a
109121
`Time` field and are able to define a data path. Similar to the last example,

dist/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{ "name": "DeutscheBahn Arrivals Annotations", "path": "img/db_arrivals_annotations.png"},
2525
{ "name": "GitHub Security Advisories", "path": "img/github_security_advisories.png"}
2626
],
27-
"version": "1.1.4",
27+
"version": "1.2.0",
2828
"updated": "2021-01-14"
2929
},
3030

0 commit comments

Comments
 (0)