Skip to content
Back to skills

Orpc Tanstack Query Basic

ASecurity

Basic guide to integrating oRPC with TanStack Query (legacy).

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 12, 2026
developmentreactvueangulargit

Works with

  • cli

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add ali-master/skills --skill orpc-tanstack-query-basic --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orpc Tanstack Query Basic?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Orpc Tanstack Query Basic
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ali-master-orpc-tanstack-query-basic/badge)](https://www.skillsdirectory.com/skills/ali-master-orpc-tanstack-query-basic)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: oRPC TanStack Query Basic
description: Basic guide to integrating oRPC with TanStack Query (legacy).
license: MIT
metadata:
  author: Ali Torki
  homepage: https://github.com/ali-master
  version: "1.0.0"
---

# TanStack Query Integration (Basic)

Lightweight integration with [TanStack Query](https://tanstack.com/query/latest).

| Library | Tanstack Query | oRPC Integration          |
| ------- | -------------- | ------------------------- |
| React   | ✅             | ✅                        |
| Vue     | ✅             | ✅                        |
| Angular | ✅             | ✅ (New only)             |
| Solid   | ✅             | ✅                        |
| Svelte  | ✅             | ✅                        |

## Query Options

```ts
const query = useQuery(orpc.planet.find.queryOptions({
  input: { id: 123 },
  context: { cache: true },
}))
```

## Infinite Query Options

```ts
const query = useInfiniteQuery(orpc.planet.list.infiniteOptions({
  input: (pageParam: number | undefined) => ({ limit: 10, offset: pageParam }),
  context: { cache: true },
  initialPageParam: undefined,
  getNextPageParam: lastPage => lastPage.nextPageParam,
}))
```

## Mutation Options

```ts
const mutation = useMutation(orpc.planet.create.mutationOptions({
  context: { cache: true },
}))

mutation.mutate({ name: 'Earth' })
```

## Query/Mutation Key

```ts
const queryClient = useQueryClient()

queryClient.invalidateQueries({ queryKey: orpc.planet.key() })
queryClient.invalidateQueries({ queryKey: orpc.planet.key({ type: 'query' }) })
queryClient.invalidateQueries({ queryKey: orpc.planet.find.key({ input: { id: 123 } }) })
```

## Calling Procedure Clients

```ts
const result = orpc.planet.find.call({ id: 123 })
```

## Error Handling

```ts
import { isDefinedError } from '@orpc/client'

const mutation = useMutation(orpc.planet.create.mutationOptions({
  onError: (error) => {
    if (isDefinedError(error)) {
      // Handle the error
    }
  }
}))
```

## `skipToken` for Disabling Queries

```ts
const query = useQuery(
  orpc.planet.list.queryOptions({
    input: search ? { search } : skipToken,
  })
)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.