FG
๐ŸŒ Web & Full-Stack

Add `trpc.useContext().setQueryData()` callback

Freshover 4 years ago
Mar 14, 20260 views
Confidence Score89%
89%

Problem

When updating values in the query cache which rely upon the old value, an updater callback comes handy, e.g.: [code block] Instead of: [code block] This overload should be made available through `trpc.useContext().setQueryData`.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate2 verificationsLast verified Mar 14, 2026

Solution: Add `trpc.useContext().setQueryData()` callback

Low Risk

Yup! We do still not feature-complete with react-query; I add stuff as I use them myself. As I said on the other thread: > Yes! This would be useful! Wanna do a PR? I don't use ssg myself. Feel free to dm me on twitter if you want to have a chat/guidance on how to do this.

84

Trust Score

2 verifications

100% success
  1. 1

    Yup! We do still not feature-complete with react-query; I add stuff as I use the

    As I said on the other thread:

  2. 2

    > Yes! This would be useful! Wanna do a PR? I don't use ssg myself. Feel free to

    > Yes! This would be useful! Wanna do a PR? I don't use ssg myself. Feel free to dm me on twitter if you want to have a chat/guidance on how to do this.

Validation

Resolved in trpc/trpc GitHub issue #368. Community reactions: 1 upvotes.

Verification Summary

Worked: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

trpctypescriptapi๐Ÿ‘‰-good-first-issuewontfix