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-experimental/src/types.ts:80](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/types.ts#L80)
9β
10The `isSuccess`/`isError`/`isPending` methods on a query result. Unlike `react-query`'s derived booleans,
11these are type-guard methods you call β `if (query.isSuccess())` β so that `query.data` narrows away
12`undefined` inside the branch, the same way `status` narrowing works on the plain object `react-query`
13returns.
14β
15## Type Parameters
16β
17### TData
18β
19`TData` = `unknown`
20β
21The type `data` ends up as after `select` runs.
22β
23### TError
24β
25`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
26β
27The type of errors your `queryFn` may throw.
28β
29## Properties
30β
31| Property | Type | Description |
32| ------ | ------ | ------ |
33| <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. |
34| <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. |
35| <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. |