Skip to content

Implement GraphQL or similar query batching to reduce API calls #238

@RUKAYAT-CODER

Description

@RUKAYAT-CODER

Background

App makes 5-10 separate REST API calls where one batched call would suffice. Implement query batching (GraphQL or custom endpoint) to fetch related data in single request, reducing API roundtrips by 60-80%.

Description

Implement request batching to fetch multiple related resources in single API call instead of N separate calls.

Current Behavior

Getting user profile, courses, preferences, settings = 4 separate API calls

Expected Behavior

One batched call returns all related data

Impact

📉 API calls reduced 60-80%
🚀 Lower latency (fewer roundtrips)
⚡ Better performance on slow networks

Acceptance Criteria

  • Audit common data fetch patterns (N+1)
  • Design batching API or GraphQL schema
  • Implement request batching utility
  • Refactor common multi-call patterns
  • API calls reduced 60-80% for typical flows
  • Test with slow network simulation
  • Document batching patterns
  • Monitor API call reduction

Implementation Hints

Consider GraphQL or custom /batch endpoint. Collect requests, send together, parse response.

Performance Metrics

Before:

  • apiCalls: 12 calls per typical flow

After (Target):

  • apiCalls: 3 calls per typical flow (-75%)

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions