query icon indicating copy to clipboard operation
query copied to clipboard

fix: serialize `queryKey`

Open KATT opened this issue 5 months ago • 5 comments

Serialize query keys the same way .data is serialized

Should fix https://github.com/trpc/trpc/issues/6802

Summary by CodeRabbit

  • New Features
    • Query keys are now serialized during dehydrate/hydrate, enabling reliable round-tripping of complex keys (e.g., Date) between server and client.
  • Bug Fixes
    • More robust hydration: queries are correctly reconstructed or updated with serialized keys and initial promise-based results are reused conditionally without altering fetch status.
  • Tests
    • Expanded hydration tests covering non-primitive keys and serialization scenarios.
  • Chores
    • Added a dev dependency to support test serialization.

KATT avatar Jun 24 '25 11:06 KATT