What is the recommended way to only fetch specific fields with the Prismic client?

I'm using the prismic client to fetch some data and I only need the uid:

const pages = await client.getAllByType("page");
return pages.map(({ uid }) => ({ uid }));

From what I can find in the online documentation, the only way to do this is using the graphquery field: Content Relationship — Prismic Docs.

The documentation on this field says that it is legacy and not recommended for new projects. Is there another field I can use to only fetch the uid field in the response, or is this the recommended approach?

const pages = await client.getAllByType("page", {
	graphQuery: `{ 
		page {
			uid
		}
	}`,
});

Hey @ollie3,

Welcome to the community :slight_smile:

Have you had a look at fetchLinks? Here: Content API Reference — Prismic Docs !