You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/plugins/tanstack-query.mdx
+228-3Lines changed: 228 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,8 @@ import FineGrainedOptimistic from './_fine-grained-optimistic.md';
16
16
If you're looking for generating hooks for [SWR](https://swr.vercel.app/), please checkout the [`@zenstackhq/swr`](./swr) plugin.
17
17
:::
18
18
19
-
The `@zenstackhq/tanstack-query` plugin generates [Tanstack Query](https://tanstack.com/query/latest) hooks that call into the CRUD services provided by the [server adapters](../../category/server-adapters). The plugin currently supports React and Svelte. Vue support is coming soon.
19
+
The `@zenstackhq/tanstack-query` plugin generates [TanStack Query](https://tanstack.com/query/latest) hooks that call into the CRUD services provided by the [server adapters](../../category/server-adapters). The plugin currently supports React, Vue, Svelte, and Angular (v5 only).
20
+
20
21
21
22
The hooks syntactically mirror the APIs of a standard Prisma client, including the function names and shapes of parameters (hooks directly use types generated by Prisma).
| output | String | Output directory (relative to the path of ZModel) | Yes ||
36
-
| target | String | Target framework to generate for. Choose from "react", "vue", and "svelte". | Yes ||
37
-
| version | String | Version of TanStack Query to generate for. Choose from "v4" and "v5". | No | v5 |
37
+
| target | String | Target framework to generate for. Choose from "react", "vue", "svelte", "angular". | Yes ||
38
+
| version | String | Version of TanStack Query to generate for. Choose from "v4" and "v5". Angular supports only "v5" | No | v5 |
38
39
| portable | Boolean | Include TypeScript types needed to compile the generated code in the output directory. Useful when you output into another project that doesn't reference Prisma and ZenStack. You'll still need to install the "@zenstackhq/tanstack-query" package in that project. | No | false |
@@ -679,6 +837,73 @@ Here's a quick example of using infinite query to load a list of posts with infi
679
837
</div>
680
838
```
681
839
840
+
</TabItem>
841
+
842
+
<TabItem value="angular" label="Angular">
843
+
844
+
Here's a quick example of using infinite query to load a list of posts with infinite pagination. See [Tanstack Query documentation](https://tanstack.com/query/v5/docs/framework/angular/examples/infinite-query-with-max-pages) for more details.
0 commit comments