Skip to content

Add comprehensive query key factory and cache invalidation helpers to @astroid/react #101

Description

@Cjay-Cyber-2

Description — what to implement and the why/impact.

Developers using @astroid/react with TanStack Query need structured query keys and cache invalidation helpers to manage agent states, policies, and wallet balances efficiently without manual key string concatenation.

Context & Requirements — background, constraints, design references, edge cases; grounded in the actual repo (real files, stack, conventions).

Implement a centralized query key factory pattern inside packages/react/src/ that generates consistent query keys for agents, wallets, policies, and budgets, along with typed invalidation helper functions.

Acceptance Criteria — a checklist ("- [ ] ...") of specific, testable conditions that define "done".

  • Create a query key factory supporting all major resource domains (agents, wallets, policies, budgets).
  • Provide helper functions to invalidate queries by resource type or specific ID.
  • Ensure all React hooks in @astroid/react utilize the new query key factory.
  • Add unit tests verifying query key structures and invalidation triggers.

Implementation Guidance — likely files/modules to touch (use real paths from the repo context) and a suggested approach, without over-prescribing.

Examine packages/react/src/ for existing hook implementations and TanStack Query setup. Adhere strictly to workspace TypeScript rules and avoid any.

Testing & Validation — how the contributor should prove it works (tests to add/run, manual checks, screenshots for UI).

Run pnpm test --filter @astroid/react and pnpm typecheck to validate hook types and test suites.

Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting; follow the repo's existing style and conventions.


Wave complexity: Medium

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions