Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

"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?