Log in
Log into community
Join the Webstudio community
View all posts
Related posts
Was this helpful?
๐
๐
๐
Powered by
Hall
Active
Updated 4 weeks ago
0
Follow
Slug variable from an API resource?
Slug variable from an API resource?
Active
0
Follow
R
Richard
3 months ago
ยท
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
Share
Open in Discord
O
Oleg Isonen
3 months ago
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
O
Oleg Isonen
3 months ago
I don't see a problem from what you described
R
Richard
3 months ago
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
O
Oleg Isonen
3 months ago
in resource the query pararams are part of the URL, called "get parameters"
O
Oleg Isonen
3 months ago
check out our youtube, we had examples for using REST
R
Richard
3 months ago
Thanks, I'm all set and it's working now - this one helped a lot
https://youtu.be/3mW7cPDXIxY?feature=shared
O
Oleg Isonen
3 months ago
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
Join on Discord