Skip to content

GraphQL query optimization: persisted queries and caching #404

Description

@pmilano1

Summary

Optimize GraphQL performance for production.

Proposed Improvements

Persisted Queries

  • Use Apollo persisted queries to reduce request size
  • Pre-register queries at build time

Query Complexity Limits

  • Add complexity scoring to prevent expensive queries
  • Limit depth and breadth of nested queries

Caching Strategy

  • Cache frequently accessed data:
    • Dashboard stats
    • Surname lists
    • Person counts
  • Configure appropriate cache TTLs
  • Use Apollo cache policies effectively

DataLoader

  • Ensure DataLoader is used for N+1 prevention
  • Batch related queries

Affected Components

  • Apollo client configuration
  • Backend GraphQL server

Priority

Medium - important as usage scales

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions