Join the Webstudio community

Updated 4 weeks ago

Slug variable from an API resource?

Hi, is it possible to get the slug variable to go in /post/:slug from a Resource rather than GraphQL?

Context is I'm testing out Pocketbase https://pocketbase.io which doesn't have GraphQL, only an API

Thanks in advance
O
R
7 comments
you mean pocketbase has rest api and you need to use slug variable from the url and pass it as query params to the rest api
I don't see a problem from what you described
Thanks for the quick reply. I'm quite a newbie at this stuff, so not sure I've explained it well

If it had GraphQL I could write the query in this first screenshot to get the slug and pass it

But the Resource type doesn't have anywhere to write the query
Attachments
image.png
image.png
in resource the query pararams are part of the URL, called "get parameters"
check out our youtube, we had examples for using REST
Thanks, I'm all set and it's working now - this one helped a lot https://youtu.be/3mW7cPDXIxY?feature=shared
Great, let us know if there is anything in the documentation that can be improved that would have helped earlier
Add a reply
Sign up and join the conversation on Discord