much 2 yearn
CCConvex Community
•Created by much 2 yearn on 3/17/2024 in #support-community
Best practice to get userId from from user user in function
in the next/expo monorepo they use getting the userId from the userIdentity, but unsure if this is best practice in case this value will change among auth providers and also because it default to type string and not . Is there a way to get userId from the auth flow for your functions or is the best way to pass the userId as an argument from the frontend?
vs
6 replies
CCConvex Community
•Created by much 2 yearn on 3/16/2024 in #support-community
Use zod schemas for argument validation
I am using the zod helper library to use zod as validation but it I get an error when trying to use the zod schema from another file, but it works when writing the schema in the zMutation
error: Index signature for type 'string' is missing in type 'ZodObject. Is it possible to pass a defined schema or must all zod validation be done at that scope
8 replies
CCConvex Community
•Created by much 2 yearn on 1/28/2024 in #support-community
useQuery caching and layout question
Hello! Right now I have multiple nested layout pages in next 14 fetching data using useQuery . Is there caching for same queries or will it call each time on the client when using useQuery ? Cuz I call it 4 times in separate layouts. Seems like a bad practice at a glance but it it’s helpful not having to prop drill down. Any advice on best practice here ?
2 replies