Skip to content

Add fileContent query and issue comment reading to GraphQL API - #2

Merged
Athenox14 merged 1 commit into
mainfrom
claude/genome-api-gaps-e48k8w
Jul 21, 2026
Merged

Add fileContent query and issue comment reading to GraphQL API#2
Athenox14 merged 1 commit into
mainfrom
claude/genome-api-gaps-e48k8w

Conversation

@Athenox14

Copy link
Copy Markdown
Owner

Summary

Two real gaps in the GraphQL API, confirmed by reading the code (not assumed):

  • No file-content read: Repository.tree(ref, path) only ever returned tree metadata (name/path/size/oid). RepoManager::read_file_at_ref already existed in git-core but was only called internally (reading a workflow YAML for triggerWorkflowDispatch) — nothing exposed it via GraphQL. Added Repository.fileContent(ref, path), returning a FileContentObject with UTF-8 content (when the file isn't binary), an always-present contentBase64, isBinary, and size. Returns null for a missing path/ref or a file over 10MiB (a cost guard, not a silent truncation).
  • No comment read: commentOnIssue inserted into issue_comments and handed back the row it just created, but nothing ever read that table again — IssueObject only exposed labels/milestone. Added Issue.comments, ordered oldest-first, following the same query_as pattern already used for labels.

Also bumped the local toolchain rustc 1.94 → 1.97 (hiqlite 0.14 requires ≥1.95; already documented as a recurring requirement in a prior journal entry).

Test plan

  • cargo check --workspace — clean
  • cargo test --workspace — in progress locally; CI on this PR will confirm
  • DOC.md §4 updated with the new repository/issue nested-field sections
  • JOURNAL.md updated with the investigation + fix

Generated by Claude Code

Repository.tree() only ever returned metadata (name/path/size/oid); there
was no way to fetch a file's actual bytes even though RepoManager already
had read_file_at_ref internally (used only for the workflow-dispatch YAML
read). Added Repository.fileContent(ref, path), capped at 10MiB, returning
UTF-8 text plus always-present base64 for binary files.

commentOnIssue wrote to issue_comments and handed back the created row,
but nothing read the table back afterwards. Added Issue.comments.

Bumped rustc 1.94->1.97 (hiqlite 0.14 requires it).
@Athenox14
Athenox14 merged commit de62723 into main Jul 21, 2026
2 checks passed
Athenox14 added a commit that referenced this pull request Jul 23, 2026
Add fileContent query and issue comment reading to GraphQL API
@Athenox14
Athenox14 deleted the claude/genome-api-gaps-e48k8w branch July 23, 2026 11:17
Athenox14 added a commit that referenced this pull request Jul 23, 2026
Add fileContent query and issue comment reading to GraphQL API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants