Open History to see the last commit
1---
2id: BaseQueryNarrowing
3title: BaseQueryNarrowing
4---
5β
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7β
8Defined in: [packages/angular-query/src/types.ts:85](https://github.com/TanStack/query/blob/main/packages/angular-query/src/types.ts#L85)
9β
10Signal-backed guards that narrow a query result and its data and error fields by status: the
11`isSuccess`/`isError`/`isPending` methods on a query result. Unlike `react-query`'s derived booleans, each
12is a `Signal` you call to read its current boolean value reactively, and the call is also a type guard β
13`if (query.isSuccess())` β so that `query.data` narrows away `undefined` inside the branch, the same way
14`status` narrowing works on the plain object `react-query` returns.
15β
16## Type Parameters
17β
18### TData
19β
20`TData` = `unknown`
21β
22The type `data` ends up as after `select` runs.
23β
24### TError
25β
26`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
27β
28The type of errors your `queryFn` may throw.
29β
30## Properties
31β
32| Property | Type | Description |
33| ------ | ------ | ------ |
34| <a id="property-iserror"></a> `isError` | `SignalFunction`\<() => `this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"error", TData, TError>>`\> | Returns whether the result failed and narrows its data and error signals. |
35| <a id="property-ispending"></a> `isPending` | `SignalFunction`\<() => `this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"pending", TData, TError>>`\> | Narrows the result to the pending state when that state is possible. |
36| <a id="property-issuccess"></a> `isSuccess` | `SignalFunction`\<() => `this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"success", TData, TError>>`\> | Returns whether the result is successful and narrows its data and error signals. |