Queries/Actions type
Can I get generated type for context of queries/actions? Docs examples for them are in JS which ruins the following use of them on client.
Currently there is example with self-defined types (https://github.com/wasp-lang/wasp/blob/release/examples/todo-typescript/src/server/serverTypes.ts) but it looks like temporary solution
GitHub
wasp/serverTypes.ts at release · wasp-lang/wasp
The fastest way to develop full-stack web apps with React & Node.js. - wasp/serverTypes.ts at release · wasp-lang/wasp
4 Replies
You actually can now (as of 0.10), when you define the action/query there is a Type generated for you and you can import it
This is for client, I want generated context type for server based on wasp file
Wohooo @fossfighter, you just became a Waspeteer level 2!
Oh no, it's actually for server too https://wasp-lang.dev/docs/typescript#backend-type-support-for-queries-and-actions
TypeScript Support | Wasp
TypeScript is a programming language that brings static type analysis to JavaScript. It is a superset of JavaScript (i.e., all valid JavaScript programs are valid TypeScript programs) and compiles to JavaScript before running. TypeScript's type system detects common errors at build time (reducing the chance of runtime errors in production) and e...