Solved

GraphQL product id prefix

michaeltheodore
Explorer
59 6 9

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. 

Accepted Solutions (2)

vix
Shopify Staff
540 103 121

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. 

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

michaeltheodore
Explorer
59 6 9

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

View solution in original post

Replies 2 (2)

vix
Shopify Staff
540 103 121

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. 

To learn more visit the Shopify Help Center or the Community Blog.

michaeltheodore
Explorer
59 6 9

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