Changing the return URL slug from GraphQL using Storefront API

Ivandev15
New Member
1 0 0

Hello, I've created a website using the Shopify API, and am pulling products and articles using the IDs of each element.

 

However, the return slug ends up being something like:

https://xxxxxx/article/Z2lkOi8vc2hvcGlmeS9BcnRpY2xlLzU1Njk3MzgxODAzOA==

is there any way to replace everything after /article/ with the handle of the item in question?

 

Thank you.

Reply 1 (1)
L_J_K
Shopify Staff
Shopify Staff
400 64 81

Hey @Ivandev15 

Had you tried base 64 decoding the end of that URL? The end of it is the base 64 encoded value of the Article ID -  if I window.atob it, it'll give you something like - gid://shopify/Article/12345678. 

Hope that helps - let me know if I'm missing anything!

 

 

 

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!