Access Old UID of a document in Gatsby


This article is really helpful at explaining how old URLs are stored on a document which helps with redirection: Error: This value is already used by another document | Prismic Help Center

But I can't figure out how to access old UIDs of a document within my Gatsby graphql query. Has someone encountered this before?


Hi Kristiyan,

Thanks for contributing to the Prismic community.

I not sure I understood your question, but If you mean that you want to retrieve old UIDs for a given document, then the answer is, it is not possible.

The article you have described does mention the opposite by doing :


You get the new UID of a document. by providing the old UID.

But can you please tell us the use-case you need to get the old UID for?

Looking forward to your reply,

Thanks for the reply @Fares

My use-case would be to setup redirects for when/if the marketing team changes the URL, I would like to grab the old URLs and setup a redirect rule to go to the new URL.