# Interface: DecorateQueryProcedure<TDef>

> 

Defined in: [tanstack-react-query/src/internals/createOptionsProxy.ts:178](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/tanstack-react-query/src/internals/createOptionsProxy.ts#L178)

The helpers for a query procedure.

## See

https://trpc.io/docs/client/tanstack-react-query/usage#queryOptions

## Extends

- `TypeHelper`\<`TDef`\>.[`DecorateRouterKeyable`](https://trpc.io/docs/typedoc/tanstack-react-query/interfaces/DecorateRouterKeyable.md)\<`TDef`\[`"featureFlags"`\]\>

## Type Parameters

| Type Parameter |
| ------ |
| `TDef` *extends* `ResolverDef` |

## Properties

### pathFilter()

> **pathFilter**: (`filters`?) => `WithRequired`\<`QueryFilters`\<[`TRPCQueryKey`](https://trpc.io/docs/typedoc/tanstack-react-query/type-aliases/TRPCQueryKey.md)\<`TDef`\[`"featureFlags"`\]\[`"keyPrefix"`\]\>\>, `"queryKey"`\>

Defined in: [tanstack-react-query/src/internals/createOptionsProxy.ts:70](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/tanstack-react-query/src/internals/createOptionsProxy.ts#L70)

Calculate a TanStack Query Filter for any path, could be used to manipulate every procedure beneath this path

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `filters`? | `QueryFilters`\<[`TRPCQueryKey`](https://trpc.io/docs/typedoc/tanstack-react-query/type-aliases/TRPCQueryKey.md)\<`TDef`\[`"featureFlags"`\]\[`"keyPrefix"`\]\>\> |

#### Returns

`WithRequired`\<`QueryFilters`\<[`TRPCQueryKey`](https://trpc.io/docs/typedoc/tanstack-react-query/type-aliases/TRPCQueryKey.md)\<`TDef`\[`"featureFlags"`\]\[`"keyPrefix"`\]\>\>, `"queryKey"`\>

#### See

 - https://tanstack.com/query/latest/docs/framework/react/guides/filters
 - https://trpc.io/docs/client/tanstack-react-query/usage#queryFilter

#### Inherited from

[`DecorateRouterKeyable`](https://trpc.io/docs/typedoc/tanstack-react-query/interfaces/DecorateRouterKeyable.md).[`pathFilter`](https://trpc.io/docs/typedoc/tanstack-react-query/interfaces/DecorateRouterKeyable.md#pathfilter)

***

### pathKey()

> **pathKey**: () => [`TRPCQueryKey`](https://trpc.io/docs/typedoc/tanstack-react-query/type-aliases/TRPCQueryKey.md)\<`TDef`\[`"featureFlags"`\]\[`"keyPrefix"`\]\>

Defined in: [tanstack-react-query/src/internals/createOptionsProxy.ts:62](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/tanstack-react-query/src/internals/createOptionsProxy.ts#L62)

Calculate the TanStack Query Key for any path, could be used to invalidate every procedure beneath this path

#### Returns

[`TRPCQueryKey`](https://trpc.io/docs/typedoc/tanstack-react-query/type-aliases/TRPCQueryKey.md)\<`TDef`\[`"featureFlags"`\]\[`"keyPrefix"`\]\>

#### See

 - https://tanstack.com/query/latest/docs/framework/react/guides/query-keys
 - https://trpc.io/docs/client/tanstack-react-query/usage#queryKey

#### Inherited from

[`DecorateRouterKeyable`](https://trpc.io/docs/typedoc/tanstack-react-query/interfaces/DecorateRouterKeyable.md).[`pathKey`](https://trpc.io/docs/typedoc/tanstack-react-query/interfaces/DecorateRouterKeyable.md#pathkey)

***

### queryFilter()

> **queryFilter**: (`input`?, `filters`?) => `WithRequired`\<`QueryFilters`\<`DataTag`\<[`TRPCQueryKey`](https://trpc.io/docs/typedoc/tanstack-react-query/type-aliases/TRPCQueryKey.md)\<`TDef`\[`"featureFlags"`\]\[`"keyPrefix"`\]\>, `TDef`\[`"output"`\], `TRPCClientErrorLike`\<\{ `errorShape`: `TDef`\[`"errorShape"`\]; `transformer`: `TDef`\[`"transformer"`\]; \}\>\>\>, `"queryKey"`\>

Defined in: [tanstack-react-query/src/internals/createOptionsProxy.ts:209](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/tanstack-react-query/src/internals/createOptionsProxy.ts#L209)

Calculate a TanStack Query Filter for a Query Procedure

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input`? | `Partial`\<`TDef`\[`"input"`\]\> |
| `filters`? | `QueryFilters`\<`DataTag`\<[`TRPCQueryKey`](https://trpc.io/docs/typedoc/tanstack-react-query/type-aliases/TRPCQueryKey.md)\<`TDef`\[`"featureFlags"`\]\[`"keyPrefix"`\]\>, `TDef`\[`"output"`\], `TRPCClientErrorLike`\<\{ `errorShape`: `TDef`\[`"errorShape"`\]; `transformer`: `TDef`\[`"transformer"`\]; \}\>\>\> |

#### Returns

`WithRequired`\<`QueryFilters`\<`DataTag`\<[`TRPCQueryKey`](https://trpc.io/docs/typedoc/tanstack-react-query/type-aliases/TRPCQueryKey.md)\<`TDef`\[`"featureFlags"`\]\[`"keyPrefix"`\]\>, `TDef`\[`"output"`\], `TRPCClientErrorLike`\<\{ `errorShape`: `TDef`\[`"errorShape"`\]; `transformer`: `TDef`\[`"transformer"`\]; \}\>\>\>, `"queryKey"`\>

#### See

 - https://tanstack.com/query/latest/docs/framework/react/guides/filters
 - https://trpc.io/docs/client/tanstack-react-query/usage#queryFilter

***

### queryKey()

> **queryKey**: (`input`?) => `DataTag`\<[`TRPCQueryKey`](https://trpc.io/docs/typedoc/tanstack-react-query/type-aliases/TRPCQueryKey.md)\<`TDef`\[`"featureFlags"`\]\[`"keyPrefix"`\]\>, `TDef`\[`"output"`\], `TRPCClientErrorLike`\<\{ `errorShape`: `TDef`\[`"errorShape"`\]; `transformer`: `TDef`\[`"transformer"`\]; \}\>\>

Defined in: [tanstack-react-query/src/internals/createOptionsProxy.ts:194](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/tanstack-react-query/src/internals/createOptionsProxy.ts#L194)

Calculate the TanStack Query Key for a Query Procedure

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input`? | `Partial`\<`TDef`\[`"input"`\]\> |

#### Returns

`DataTag`\<[`TRPCQueryKey`](https://trpc.io/docs/typedoc/tanstack-react-query/type-aliases/TRPCQueryKey.md)\<`TDef`\[`"featureFlags"`\]\[`"keyPrefix"`\]\>, `TDef`\[`"output"`\], `TRPCClientErrorLike`\<\{ `errorShape`: `TDef`\[`"errorShape"`\]; `transformer`: `TDef`\[`"transformer"`\]; \}\>\>

#### See

 - https://tanstack.com/query/latest/docs/framework/react/guides/query-keys
 - https://trpc.io/docs/client/tanstack-react-query/usage#queryKey

***

### queryOptions

> **queryOptions**: [`TRPCQueryOptions`](https://trpc.io/docs/typedoc/tanstack-react-query/interfaces/TRPCQueryOptions.md)\<`TDef`\>

Defined in: [tanstack-react-query/src/internals/createOptionsProxy.ts:186](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/tanstack-react-query/src/internals/createOptionsProxy.ts#L186)

Create a set of type-safe query options that can be passed to `useQuery`, `prefetchQuery` etc.

#### See

 - https://tanstack.com/query/latest/docs/framework/react/reference/queryOptions#queryoptions
 - https://trpc.io/docs/client/tanstack-react-query/usage#queryOptions
