ctx.auth.getUserIdentity(). Use it to scope reads and writes to the current user.
In a query
In a mutation
Same shape — get the identity, throw on missing, write scoped to the user.In an action
Identical.What’s in the identity
Common patterns
- Require sign-in
- Optional sign-in
- Role check
Related
Built-in auth
The auth system overview.
Roles & permissions
Role-based access patterns.
Data access control
Security best practices.
