Repository navigation
bd gql: ask Beads for only the fields your agent needs #6849
peterkc
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I use Beads from an agent extension that calls
bdas a subprocess. Most of its calls need a few fields from a few issues, butbd show --jsonandbd list --jsonreturn whole rows. So I wrotebd gql: one read-only GraphQL query that returns only the fields you select, with related issues in the same call.On a test store of 2,000 issues:
bd show --json.bd ready --brief --json.It reads through the same code paths as
bd show,bd readyandbd query, works in embedded and proxied-server mode, and has no mutations. The design, measurements and limits are in the feature issue.bd gql, a read-only GraphQL query command #6760bd gql, a read-only GraphQL query command #6780 (open, not merged yet)Try it
The PR branch follows current
main, which can be ahead of your installed release.--readonlyopens your store read-only and skips startup maintenance such as auto-migration, so trying it leaves your store as it was. (Proxied-server mode refuses--readonly, so try it in a scratch workspace made withbd init.) The docs page on the branch,docs/reference/graphql.md, lists every field and limit, and introspection ({ __schema { types { name } } }) works too.What comes next
The first PR covers read-only queries with fixed limits. Follow-up PRs I have planned:
dependentsandcommentslists, and a limit on how many comments one request loads. Today both lists are read in full.Later, if users want them: an MCP
gqltool that wrapsbd gql, and cursor paging. Writes and aggregates are out of scope.What would help
If you read Beads from an agent, a script or a UI:
bdcalls would you replace with a query like this, and which fields do they actually need?bd querycannot express, or a way to follow relations further.Replies here, or on the issue, help decide what goes into the follow-ups.
All reactions