Skip to content

feat(graphql): add query engine for markets, positions, trades, and users - #110

Open
GideonBature wants to merge 1 commit into
GruftNet:mainfrom
GideonBature:graphql-query-engine
Open

feat(graphql): add query engine for markets, positions, trades, and users#110
GideonBature wants to merge 1 commit into
GruftNet:mainfrom
GideonBature:graphql-query-engine

Conversation

@GideonBature

Copy link
Copy Markdown
Contributor

Summary

  • Add GraphQL query engine under backend/src/graphql/ for markets, positions, trades, and wallet users (nested queries, fragments, cursor/offset pagination)
  • Prevent N+1 with request-scoped DataLoaders; enforce query complexity/depth and per-user Redis rate limits on /graphql
  • Deliver live updates via GraphQL subscriptions on Redis market:*:events (target < 500ms), with schema versioning and @deprecated aliases for backward compatibility
  • Document the full schema in src/graphql/SCHEMA.md; REST migration and federation remain out of scope

Closes #83

Test plan

  • npx jest tests/graphql — filters, nested resolves, DataLoader batching, complexity, rate limit, local subscription latency
  • npx jest tests/integration/graphql-subscription.integration.test.ts with Redis up
  • POST /graphql markets query with combined filters
  • Subscribe to tradeCreated / marketActivity and confirm delivery under 500ms
  • Over-complexity and over-rate-limit requests return the expected errors / 429

…sers

Introduce a GraphQL API with DataLoader-backed resolvers, per-user rate
limits, query complexity enforcement, and Redis-backed subscriptions for
live market data. Schema is versioned with deprecated snake_case aliases
for backward-compatible clients.

Refs GruftNet#83
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.

Build GraphQL Query Engine

1 participant