wasp-lang / wasp

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

Properly type `useQuery` #2361

Open infomiho opened 4 weeks ago

infomiho commented 4 weeks ago

For users to get benefits of type auto-complete in their IDE, we should properly type the options param of our useQuery helper: https://github.com/wasp-lang/wasp/blob/73e55326bd9f427bd3e390f97ca86be776ab2b02/waspc/data/Generator/templates/sdk/wasp/client/operations/hooks.ts#L18

Also, useQuery's type says that the payload is always optional (but this actually depends on the operation). We should fix that too