I'm currently loading all my blog posts on one page like so using getStaticProps.
const allPosts = await client.getAllByType("blog_post", {
predicates: [prismic.predicate.not("my.blog_post.status", "9 - Promoted")],
orderings: {
field: "my.blog_post.published",
direction: "desc",
},
})
This returns all the blog post data for all the content in every single post. Is there a way to get the API to only return a few specific fields? I only really a headline, image and the URL to the post. I don't need anything in the body content or repeated slices.
I'm getting a warning when I run my project:
Warning: data for page "/blog" is 3.83 MB, this amount of data can reduce performance.
See more info here: https://nextjs.org/docs/messages/large-page-data
Looking through the documentation I see ways to query by specific parameters but I don't see anything to get the API to return only certain fields. Wondering if this is possible or if I'm just not understanding the documentation.
To be clear I'm not trying to query by specific fields, I'm trying to query all blog posts and have the API return ONLY a few specific fields.
Thanks!
- N