Join the Webstudio community

Updated 3 months ago

[Solved] Display limited number of posts (maximum 3) instead of all posts.

At a glance
I have rendered posts directory page that brings all posts from hygraph (from the tutorial)
I then created same 'Data variable' on homepage, and brought posts on homepage too

BUT on homepage i want to display maximum 3 posts (unlike on Directory i'll display all posts)
How can i limit it to maximum 3 posts

(P.S: I tried adding "[1]" after .data.data.posts but it shows error

Thankyou
Attachment
image.png
O
m
3 comments
set limit in your gql query
Great thank you Oleg for pointing me in the right direction

Posting for anyone else (like me who doesn't know GraphQL arguments and looking to do this)

added "first: 3" (Shown in screenshot)
Attachment
image.png
[Solved] Display limited number of posts (maximum 3) instead of all posts.
Add a reply
Sign up and join the conversation on Discord