Open History to see the last commit
1---
2id: BaseQueryNarrowing
3title: BaseQueryNarrowing
4---
5β
6Defined in: [packages/angular-query-experimental/src/types.ts:80](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L80)
7β
8The `isSuccess`/`isError`/`isPending` methods on a query result. Unlike `react-query`'s derived booleans,
9these are type-guard methods you call β `if (query.isSuccess())` β so that `query.data` narrows away
10`undefined` inside the branch, the same way `status` narrowing works on the plain object `react-query`
11returns.
12β
13## Type Parameters
14β
15### TData
16β
17`TData` = `unknown`
18β
19The type `data` ends up as after `select` runs.
20β
21### TError
22β
23`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
24β
25The type of errors your `queryFn` may throw.
26β
27## Properties
28β
29| Property | Type | Description |
30| ------ | ------ | ------ |
31| <a id="property-iserror"></a> `isError` | (`this`: [`CreateBaseQueryResult`](../type-aliases/CreateBaseQueryResult.md)\<`TData`, `TError`\>) => `this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"error", TData, TError>>` | Returns `true` if the query is in the `error` state, narrowing the result to that state. |
32| <a id="property-ispending"></a> `isPending` | (`this`: [`CreateBaseQueryResult`](../type-aliases/CreateBaseQueryResult.md)\<`TData`, `TError`\>) => `this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"pending", TData, TError>>` | Returns `true` if the query is in the `pending` state, narrowing the result to that state. |
33| <a id="property-issuccess"></a> `isSuccess` | (`this`: [`CreateBaseQueryResult`](../type-aliases/CreateBaseQueryResult.md)\<`TData`, `TError`\>) => `this is CreateBaseQueryResult<TData, TError, CreateStatusBasedQueryResult<"success", TData, TError>>` | Returns `true` if the query is in the `success` state, narrowing the result to that state. |