Errors topic

The errors query_kit throws or reports: CancelledError for a cancelled fetch, QueryDataTypeError when a cache entry is read or written with the wrong type, and the errors for a missing query or mutation function.

Exceptions / Errors

CancelledError Errors
What a cancelled fetch fails with.
MissingMutationFunctionError Errors
Thrown when a mutation runs without a function: neither MutationOptions.mutationFn nor mutationFnWithContext was set, and no default was registered for its key with QueryClient.setMutationDefaults. The mutation fails with it at once, without retrying.
MissingQueryFunctionError Errors
Thrown when a query is fetched with no query function anywhere in its options chain.
QueryDataTypeError Errors
Thrown when a query is read as one data type but holds another — or when an erased default (QueryDefaults.queryFn, structuralSharing, MutationDefaults.mutationFn) hands back a value of the wrong type.