inherit path from function name instead of random _data/<id> #70
Replies: 1 comment
-
I've been thinking about this a lot, it is a real problem that needs to be solved. So far I've been leaning towards the second parameter approach. Here's some documentation on how it works currently: Currently, the
When we implement custom IDs, we can replace the We can even designate some calls as "stable" so that the build ID isn't used for that particular call and it's possible to use the same URL across deploys, just like a normal API route. |
Beta Was this translation helpful? Give feedback.
-
When using useSSQ and useSSM, it seems that the url seems to be generated like
_data/<some_id>
. It is possible to generate the path from the function name. for eg useSSQ(async function getCurrentUser() {// stuffs
}), would be generating a fetch request to
/_data/getCurrentUser
or maybe more flexible by addingname
orpath
name the the config passed to useSSQ as 2nd parameter. This allow one to debug the requests by inspecting the network tab.Beta Was this translation helpful? Give feedback.
All reactions