GraphQL native resource type ? #1535
rbtcollins
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Tl;dr: what about a resource type that describes a lot of resources all at once, permitting a single GraphQL API call to set them all.
For instance, we have > 2K repositories, and then branch protection rules. Even with a tuned ratelimit, refreshing takes a long time, and applies that are changing things broadly have a nasty habit of timing out.
This seems to be because every protection rule in every repo is being configured separately - something that makes sense in a REST world, but makes no sense in a GraphQL world: the points system for GitHub's GraphQL API penalises queries that start at the root, find a repo, find one protection rule, and are then repeated in a loop for the next rule, then for the next repo etc - because all the traversals are dead weight, and could be avoided if the query was broader.
e.g. refresh could read the first 100 repos, and all the protection rules; then the next 100 after the first 100, etc.
But - sorry to handwave, only loose understanding of the innards right now - terraform probably isn't passing enough context to let the provider do that seamlessly, so what about a resource type in terraform that represents many {type} instances in many repos, all at once?
Beta Was this translation helpful? Give feedback.
All reactions