Skip to content

[High] Read-Only GraphQL Gateway for Intents, Solvers, and Stats #431

Description

@james2177

Description:
Expose a read-only GraphQL API alongside REST for integrators and analytics dashboards, with dataloader batching, query cost limits, and persisted queries.

Problem Statement & Context:
Dashboards currently stitch multiple REST calls (intents + solvers + audit + tokens), causing over-fetching and N+1 request patterns against the relay.

Scope & Acceptance Criteria:

  • @nestjs/graphql (Apollo or Mercurius) at /graphql; types for Intent, Solver, Token, AuditEntry, Stats.
  • Relay-style connections reusing the keyset cursor codec.
  • Query depth/complexity limits; introspection disabled in production; persisted-query allowlist option.
  • DataLoader for solver/token lookups.
  • Out of scope: mutations and subscriptions.

Implementation Guidelines:

  1. Key Files/Modules: new src/graphql/ module, reuse services from src/intents, src/solvers, src/tokens, src/stats.
  2. Design/Architecture: Code-first schema; resolvers delegate to existing services (no duplicated business logic).
  3. Edge Cases/Constraints: Complexity limit prevents > 1,000 node fetches per query.
  4. Testing: Resolver tests, complexity-limit tests, e2e snapshot of schema SDL.

Definition of "Done": Common DoD; schema SDL committed and diffed in CI.

Resources:


Common Definition of "Done" (applies in addition to the criteria above):

  • Code written, tested, and documented (TSDoc on public APIs, README/runbook/ADR updates where behaviour changes).
  • All acceptance criteria met; npm run lint, npm run typecheck, npm test, npm run test:e2e pass in CI.
  • PR follows .github/PULL_REQUEST_TEMPLATE, uses a Conventional Commit title (enforced by commitlint), includes test output / metrics screenshots, and references the issue.
  • New env vars are added to .env.example variants and src/config/env.validation.ts (the check:env-drift script must pass).
  • Reviewed and approved by at least one CODEOWNER.

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions