Skip to content

Extension: Caching support #1397

@jasonkuhrt

Description

@jasonkuhrt

Summary

Add a caching extension to provide optional caching capabilities for Graffle.

Context

While Graffle excels as a general-purpose GraphQL client, users building UI applications may benefit from caching capabilities. Currently, we position clients like Apollo and Urql as better fits for UI applications primarily due to their caching features. However, caching could be implemented as a Graffle extension, maintaining our philosophy of keeping the core lean while offering powerful opt-in features.

Potential Approaches

  1. Simple response cache - Cache responses by query + variables
  2. Normalized cache - Document-based normalized caching similar to Apollo/Urql
  3. Adapter pattern - Allow integration with existing cache solutions

Benefits

  • Maintain Graffle's simplicity while offering caching as opt-in
  • Users could use Graffle for UI applications without switching clients
  • Follows our extensibility philosophy (like OpenTelemetry, Upload extensions)
  • Could start simple and evolve based on user needs

Considerations

  • Cache invalidation strategies
  • Memory management
  • TypeScript support for cached data
  • Performance implications
  • Bundle size impact (extension should be tree-shakeable)

Related

This came up during comparison documentation work - currently we direct UI app developers toward Apollo/Urql primarily for caching, but an extension could address this gap while maintaining Graffle's design principles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions