GraphQL product id prefix

Solved
Highlighted
Tourist
10 1 2

Hi Shopify community.

I'm currently building an app using the Shopify buy sdk => https://shopify.github.io/js-buy-sdk/

and

I am querying all products in my store with GraphQL, here's a screenshot:

prefix.jpg

 

I don't understand why the products ids have a prefix such as "Shopify__Product__" and the rest of the id as you can see in the screenshot.

Is this normal behaviour?

In my code I skip the prefix because it gives me errors, but honestly I can't for the life of me figure out why there's a prefix and I can't seem to find any info about this.

Please help?

Appreciated. 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
503 98 91

This is an accepted solution.

Hi @michaeltheodore 

 

It does not look like you are querying the Storefront API directly (or through the SDK). Is this through something like Gatsby or another 3p connector? That would explain the formatting differences. 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes
Highlighted
Tourist
10 1 2

This is an accepted solution.

Hi @vix

Thanks for replying.

Indeed I was using a Gatsby plugin that had some errors in it.

I switched to the buy sdk on github and now everything works perfectly.

Mike

2 Likes