wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
12.7k stars 1.13k forks source link

Fixes the CRUD client helpers #2098

Open infomiho opened 2 weeks ago

infomiho commented 2 weeks ago

Closes #2032

We implement some neat helpers for using the CRUD operations e.g. tasksCrud.getAll.useQuery() so users don't have to import useQuery and write useQuery(tasksCrud.getAll.query).

The way we implemented this broke user expectations that these two things have the same API (minus the queryFn which is there implicitly).

Left to do

infomiho commented 6 days ago

I gave up on type tests because they were very difficult to write. Since they involve writing types that involve React Query's QueryResult wrapper and Prisma's GetResult wrapper I could only test the smallest bits without them failing. I think the headless tests cover the behaviour well and they are enough in the end.