ts-api-spec no type safety
Hello guys, I am trying multiple repos.
I have a simple "tasks"(same as example in docs) schema and function in project 1.
I ran
npx convex-helpers ts-api-spec
, copied the code over to project 2 in api.ts
But I am not getting any type safety when calling useQuery.
api.ts example:
3 Replies
hi! do you have args and returns validators defined on your convex functions? we can’t generate types for you if you don’t have them defined
ahh i see, can you point me out to how the return validators work?
see the "returns" field when you create a query/mutation/action: https://docs.convex.dev/functions/validation#adding-validators
Argument and Return Value Validation | Convex Developer Hub
Argument and return value validators ensure that