๐Ÿ”ฎ Sanity Create is here. Writing is reinvented. Try now, no developer setup

"Which ID is the actual Sanity ID when running GraphQL queries?"

4 replies
Last updated: Aug 25, 2020
when running sanity graphql quries, we end up with two ID's one is "id" and the other one "_id" . Does anyone know which one is actual sanity ID? I need the ID that will never change.
Aug 25, 2020, 10:27 PM
i think the graphql wrapper just pushes the _id into the id for graphql things
Aug 25, 2020, 10:28 PM
but i always use the _id because i also hybrid groq things for content previews in gatsby sites
Aug 25, 2020, 10:28 PM
_id is always on the sanity side
Aug 25, 2020, 10:28 PM
awesome thanks ๐Ÿ™‚
Aug 25, 2020, 10:31 PM

Sanityโ€“ build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?