Hi!
I'm trying to retrieve a list of documents by id using the in predicate. Based on the docs here Rest API Technical Reference - Prismic the order of the documents should be the same as the order in the in array.
This is how I'm doing the query
const categories = await client.query(
[
Prismic.Predicates.at("document.type", "category"),
Prismic.Predicates.in("document.id", [
"YZEuGhIAAC0ApnUV",
"YZE-wRIAAC0Apr62",
"YZE_hxIAACkApsI3",
"YZE_zBIAACkApsNy",
"YZFAJxIAAC0ApsUJ",
"YZFAZBIAACwApsYZ",
"YknJQxIAACwAt7So",
"YkuhzhIAAC4Av9xg",
"Ykm_nRIAAC8At4m8",
]),
],
{
graphQuery,
}
)
And this is the order of the ids I get back
console.log(
"🚀 ~ categories.results",
categories.results.map(({ id }) => id)
)
🚀 ~ categories.results [
'Ykm_nRIAAC8At4m8',
'YZEuGhIAAC0ApnUV',
'YkuhzhIAAC4Av9xg',
'YZFAZBIAACwApsYZ',
'YZE_zBIAACkApsNy',
'YZFAJxIAAC0ApsUJ',
'YZE_hxIAACkApsI3',
'YknJQxIAACwAt7So',
'YZE-wRIAAC0Apr62'
]
As you can see the order of the ids is completely different than the order given.
By the way I'm still using v5
Thank you!