github zenstackhq/zenstack v1.2.0
ZenStack Release v1.2.0

latest releases: v2.6.2, v2.6.1, v2.6.0...
11 months ago

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 resolve auth() 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 like useFindUniqueUser({ 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 like useFindManyPost() if the User <-> 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

Don't miss a new zenstack release

NewReleases is sending notifications on new releases.