Skip to content

Add docs for state management conventions covering React Query cache keys and invalidation patterns #602

Description

@Chucks1093

Summary

The client uses React Query for all server state but there are no documented conventions for query key structure or cache invalidation patterns. Contributors adding new queries or mutations end up with inconsistent key formats and unpredictable invalidation behaviour.

Scope

  • Document the query key naming convention used across the client (e.g. [entity, id, scope] format)
  • Explain when to use invalidateQueries vs setQueryData for cache updates after mutations
  • Show an example of a query key factory for a new entity type
  • Describe the stale time and cache time defaults and when to override them

Acceptance Criteria

  • Query key naming convention documented with examples
  • Invalidation vs setQueryData decision explained
  • Query key factory example included
  • Stale time and cache time defaults documented with override guidance
  • Document lives in docs/ and cross-links the page contribution guide

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

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