Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supported graphql cursor style apis #84

Open
alisters opened this issue Oct 21, 2022 · 1 comment
Open

Supported graphql cursor style apis #84

alisters opened this issue Oct 21, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@alisters
Copy link

alisters commented Oct 21, 2022

The gitlab api graphql appears to implement the conventions of the graph ql cursor specification https://relay.dev/graphql/connections.htm and discussed here https://graphql.org/learn/pagination/ . It's schema can be browsed here https://gitlab.gbcloud.com.au/-/graphql-explorer and an example is

{ group(fullPath: "apps") { name projects (includeSubgroups:true, search:"digispike") { nodes { nameWithNamespace pipelines(updatedAfter: "2020-10-01") { nodes { id jobs { nodes { id name status duration startedAt stage { name } } } status } } } } } }

I was using this example to attempt to build a pipeline status dashboard in grafana, which is hopefully better than gitlabs own operations dashboard. Gitlabs own dashboard doesn't show you what stage a pipeline got to, nor any history - how long has it been failing for.

If we assume that gitlab, written in ruby, is using https://graphql-ruby.org/, this also supports pagination, then it's likely that supporting pagination in this datasource will

  • support the entire gitlab api
  • possibly support all pagination style graphql apis

Describe the solution you'd like
Data, grouping and time selection paths that allow better slicing of this style of graph into time series. I'm not an expert on graph algorithms but it seems like the resulting data graph needs to be able to be split, potentially multiple times, at points in the tree where the tree presents a value or an array. Options include JSONPath, JSON Match etc for doing this

Potentially, sub paths that select pageInfo objects to consume additional pages

Describe alternatives you've considered
None, my brain is full. Open to ideas

Additional context
Since this appears to be done client side it's performance is a consideration
This would either be a breaking change, or need to live alongside the current format for paths (a drop down to select the style)
If a data path then results in the time or grouping paths being relative to that prior path, we may need to indicate that
https://grafana.com/docs/grafana/latest/developers/plugins/data-frames/#long-format - data frame formats may play a part in this e.g we may need to limit the array size that we select into each data frame ?

@alisters alisters added the enhancement New feature or request label Oct 21, 2022
@alisters alisters changed the title Supported nested arrays and graphql cursor style apis Supported graphql cursor style apis Oct 21, 2022
@alisters
Copy link
Author

https://github.com/sanity-io/go-jsonmatch - since it supports extended unions, may allow a better extraction of fields, but is in go https://www.npmjs.com/package/node-jq - wraps jq, which looks like what may have been considered in the abandoned graphana graphql datasource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant