# TanStack Query

> تصفّح ذاكرة TanStack Query المؤقتة في تطبيقك وعدّلها وأعد جلبها وأبطلها من تطبيق سطح المكتب. معطّلة حتى تمرّر QueryClient الخاص بك.

تسرد لوحة TanStack Query الاستعلامات والتعديلات في `QueryClient` الخاص بتطبيقك، وتبقيها محدّثة أثناء جلب تطبيقك للبيانات. ويمكنك تعديل البيانات المخزنة لاستعلام، وإعادة جلب الاستعلامات أو إبطالها أو إزالتها من تطبيق سطح المكتب.

[استخدام TanStack Query في تطبيق سطح المكتب](/ar/docs/desktop/tanstack-query/)

## الإعداد

**يقبل** `false | QueryClientLike` اختياري

مرّر `QueryClient` نفسه على أنه `tanstackQuery`، لا كائنًا يغلّفه:

*index.ts*

```ts
import { QueryClient } from '@tanstack/query-core';
import { init } from '@xerlock/client';

const queryClient = new QueryClient();

init({ tanstackQuery: queryClient });
```

### الأشكال

لا يعتمد SDK على TanStack Query. يعمل أي كائن بهذا الشكل:

| العضو                                                                | الوصف                                                                                             |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `getQueryCache(): QueryCacheLike`                                    | The cache of queries. The SDK reads and subscribes to it to report queries.                       |
| `getMutationCache(): MutationCacheLike`                              | The cache of mutations. The SDK reads and subscribes to it to report mutations.                   |
| `setQueryData(queryKey: readonly unknown[], data: unknown): unknown` | Overwrites the cached data for a query. Used by the desktop app's edit action.                    |
| `refetchQueries(filters?: QueryFilterLike): Promise<void>`           | Refetches queries matching `filters`, or every query when omitted.                                |
| `invalidateQueries(filters?: QueryFilterLike): Promise<void>`        | Marks queries matching `filters` as stale and refetches active ones, or every query when omitted. |

### إيقافها

اترك `tanstackQuery`، أو مرّر `false`، لإخفاء لوحة TanStack Query لهذا التطبيق.

## القيود واستكشاف الأخطاء وإصلاحها

* **لوحة TanStack Query غير ظاهرة**: مرّر `QueryClient` على أنه `tanstackQuery` في `init()`.
