Features
- TanStack Query V5 support! In the plugin configuration, set the "version" field to "v5" to generate targeting V5. #780
- Support for using a custom model (marked with
@@auth
attribute) to resolveauth()
function in access policies. Previously it was required to have a model named "User". #774
Improvements and Fixes
-
VSCode extension: make ZModel's syntax highlighting more consistent with Prisma extension #791
-
Improved automatic query invalidation for TanStack Query and SWR hooks. #698
-
Upon mutation, queries with nested read will also be invalidated if the nested reading part is potentially affected by the mutation.
E.g., creating a
Post
will invalidate queries likeuseFindUniqueUser({ where: { id }, include: { posts: true } })
. -
Upon deletion, "cascade" relation settings will be respected, and queries involving models that're indirectly deleted due to cascade will also be invalidated.
E.g., creating a
User
will invalidate queries likeuseFindManyPost()
if theUser
<->Post
relation specifies cascade deletion.
-
-
A
getQueryKey
helper function is generated together with TanStack/SWR hooks for computing the query key given a query operation and args. #697
New Contributors
- A big ❤️THANK YOU❤️ to @jasonmacdonald for the contribution to this release. Welcome to the contributors family!
Full Changelog: v1.1.1...v1.2.0