It is easy to miss the fact that you need to use our api from wasp/client/api to performa authenticated API requests toward Wasp custom APIs that you defined. We should somehow make that more obvious.
Maybe at the place where auth: and authRequired are documented, also mention that they need to use wasp/client/api?
Or waht if we monkey-patched axios and fetch, only in dev, to warn you if you try to use them to access custom APIs? Ha that is a bit wild, probably too wild / intrusive, even if only during dev.
What if we provided even stronger sdk for this -> we could not give you just api from wasp/client/api, but give you already typed functions to call specific apis. So incentive would be stronger to use this.
Anyway we should make this more prominent in the docs, I am sure there is some space to do that, and then it would be interesting to also do something in the Wasp itself.
It is easy to miss the fact that you need to use our
api
fromwasp/client/api
to performa authenticated API requests toward Wasp custom APIs that you defined. We should somehow make that more obvious.Maybe at the place where
auth:
andauthRequired
are documented, also mention that they need to usewasp/client/api
? Or waht if we monkey-patched axios and fetch, only in dev, to warn you if you try to use them to access custom APIs? Ha that is a bit wild, probably too wild / intrusive, even if only during dev. What if we provided even stronger sdk for this -> we could not give you justapi
fromwasp/client/api
, but give you already typed functions to call specific apis. So incentive would be stronger to use this.Anyway we should make this more prominent in the docs, I am sure there is some space to do that, and then it would be interesting to also do something in the Wasp itself.