[Solved] Display limited number of posts (maximum 3) instead of all posts.
[Solved] Display limited number of posts (maximum 3) instead of all posts.
At a glance
The community member has a posts directory page that displays all posts from Hygraph, and they want to display a maximum of 3 posts on the homepage. They tried adding "[1]" after .data.data.posts but encountered an error. A community member suggested setting the limit in the GraphQL query, and another community member confirmed that adding first: 3 to the query solved the issue. The problem has been marked as [Solved].
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