You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a query procedure returns undefined, react query logs this message:
Query data cannot be undefined. Please make sure to return a value other than undefined from your query function.
Affected query key: [["key"],{"input":{"id": 123},"type":"query"}]
Is there a way to update the type of query() so that undefined is not a valid return type? This way, the error could be caught at compile time instead of at runtime.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When a query procedure returns
undefined
, react query logs this message:Is there a way to update the type of
query()
so thatundefined
is not a valid return type? This way, the error could be caught at compile time instead of at runtime.trpc/packages/server/src/unstable-core-do-not-import/procedureBuilder.ts
Lines 293 to 309 in 237dbb3
Beta Was this translation helpful? Give feedback.
All reactions