feat: add event block and agent GraphQL queries with tests#113
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements GraphQL queries for event blocks and agents in the Ledger client, along with comprehensive test coverage for event block retrieval. This PR introduces the foundational data-fetching layer for interacting with the ledger's event block and agent entities.
Changes
New GraphQL Queries
agent.ts– Query for fetching a single agent by identifieragents.ts– Query for fetching a paginated/filtered list of agentseventBlock.ts– Query for fetching a single event blockeventBlocks.ts– Query for fetching multiple event blocks with filtering supportClient Layer
LedgerClient.ts– Extended with new methods to execute agent and event block queries against the GraphQL API (106 new lines of client logic)Generated Types
graphql.ts– Updated generated GraphQL types to include the new query and response types for agents and event blocks (489 lines of generated schema types)Tests
LedgerClient.test.ts– Added 215 lines of test coverage focused on event block retrieval, including success paths, error handling, and edge casesKey Details
Breaking Changes
None. This PR only adds new queries and client methods without modifying existing interfaces or behavior.
Testing Notes for Reviewers
LedgerClient.test.tsfor completeness of scenarios (single fetch, list fetch, error states, empty responses).agent.ts,agents.ts,eventBlock.ts, andeventBlocks.tsalign with the current ledger schema.graphql.tswas regenerated from the latest schema and that no manual edits were made to the generated file.Browser Compatibility
No browser compatibility concerns — these changes are entirely server-side/client-layer GraphQL operations with no DOM, CSS, or browser API dependencies.
🤖 Generated with Claude Code
Branch Info:
feature/event-block-graphqlmainCo-Authored-By: Claude noreply@anthropic.com