Hi Buildkite team,
I’d like to request additional filters for the builds connection in the GraphQL API.
Use case:
Right now, when querying builds for a pipeline, the API returns all builds in the timeframe (including scheduled builds). In many cases, we only want to count builds triggered by users or webhooks, and exclude scheduled builds. Today the only option is to fetch all builds and filter client-side based on:
-
source.name(e.g."Webhook","Schedule") -
createdBy(null vs user/unregistered user)
This makes queries heavier than necessary, especially when looking at long time ranges.
Add optional arguments to the builds connection, such as:
builds(
branch: "%default"
state: PASSED
createdAtFrom: $from
createdAtTo: $to
source: [Schedule, Webhook, Api, Manual] # new
createdBy: NOT_NULL | NULL # new
) { ... }
This would make it possible to fetch only non-scheduled builds directly, without client-side filtering.
Benefit:
-
More efficient queries (smaller responses)
-
Cleaner client implementations (no need for extra filtering logic)
-
Consistency with how other filters (branch, state, createdAt) already work
Thanks for considering this improvement, it would make a big difference for teams that want to report on “real” developer-triggered builds vs scheduled runs.