blitzjs.com
blitzjs.com copied to clipboard
Documentation request: interacting with API endpoints
What do you want and why?
My application uses mutations and queries for part of its operations, and API endpoints for other parts - where I'm dealing with a library like Replicache with its own assumptions / preferences about how requests work.
Doing this is not very obvious, and I've been able to get it to work, but it involves stuff like attaching the anti-csrf token yourself to your requests.
And I'm not sure my implementation is correct because i get a lot of scary AuthenticationErrors in production, which indicate that there's some magic in useQuery that is not documented or usable with API calls.
It would be great to get docs on this corner, which I know is a bit narrow, but still pretty important. If you have an API endpoint that gives you user avatar thumbnails, how do you auth it, end to end? Do cookies refresh based on it? Etc.
We definitely need to and will put more details into our documentation.
In past invokeWithMiddleWare
was used in API endpoints, now it seems to be abandoned. What is the actual way now? Just invoke(methodName, params)
?