tbenniks
(Tim Benniks)
May 14, 2020, 2:53pm
1
Hi all,
I have a page of type video. It is published but when I query a list of all videos in the API it does not show up. But when I query it directly it shows up.
This happens in both the REST and GraphQL endoints.
This works:
{
video(uid: "interview-with-debbie-obrien-from-nuxtjs", lang: "en-us") {
_meta {
uid
}
}
This however doe snot show the page:
{
allVideos {
edges {
node {
_meta {
uid
}
}
}
}
}
Everything seems to be published and the type is saved.
Thanks!
Tim
Phil
(Phil Snow)
May 14, 2020, 3:18pm
2
Hey Tim,
It sounds like a pagination issue, do you have more than 20 results?
The REST api has a default limit of 20 results and a max of 100, here’s the docs for Vue about paginating your results.
https://prismic.io/docs/vuejs/query-the-api/pagination-for-results
The GraphQL api has a max of 20 results, here’s the docs for pagination with it,
https://prismic.io/docs/graphql/query-the-api/paginate-your-results
Let me know if you need anything else
2 Likes
tbenniks
(Tim Benniks)
May 14, 2020, 3:31pm
3
This is definitely it. I have 21 items. The last published item doesn’t come back in the graphQL result.
Thanks for the tip!
I’ll look into the cursor system to resolve this.
Tim
tbenniks
(Tim Benniks)
May 22, 2020, 5:10pm
4
As I wasn’t able to resolve the issue with the GraphQL and Gridsome in my context. I created this workaround: https://github.com/timbenniks/gridsome-source-prismic
2 Likes