Re: Storefront API is not working with handle

Solved

Storefront API is not working with handle

Arunk
Tourist
4 1 0

did anyone can help me here I am using storefront API Query looks like

 

{ 
  productByHandle(handle:"my-handle") { 
    variants(first:1) { 
      edges { 
        node { 
          id 
        } 
      }
    }
  }
}

and the response is coming like 

{
    "data": {
        "productByHandle": null
    }
}

Note: Storefront API are correct/working fine tested with other queries

Accepted Solution (1)
Arunk
Tourist
4 1 0

This is an accepted solution.

 I found the solution to its permission issue we can say. we have to make the "Access Products" checked it's not mentioned anywhere in docs but it's working 

Thank you @Visely-Team  @_JB 

Screenshot 2020-04-22 at 11.44.08 AM.png

View solution in original post

Replies 8 (8)

Visely-Team
Shopify Partner
1843 210 488

This response is returned when no products with handle equals to "my-handle" exist. Are you sure you have a product like this?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
Arunk
Tourist
4 1 0

Hi @Visely-Team  "my-handle" Its just the example I have tested with the correct handle 

Visely-Team
Shopify Partner
1843 210 488

Is the product available? I.e. assigned to the Online Store channel?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
Arunk
Tourist
4 1 0

@Visely-Team  Yes, the Product is also available. have inventory  and assigned to online channel

_JB
Shopify Staff (Retired)
836 100 223

Hey @Arunk,

 

Can you please send along the product_id for the product you're having an issue with, and please let me know your app's ID ( the last set of numbers in the URL when viewing the app in the Partner Dashboard). I can use this to investigate further and hopefully spot the issue.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Arunk
Tourist
4 1 0

This is an accepted solution.

 I found the solution to its permission issue we can say. we have to make the "Access Products" checked it's not mentioned anywhere in docs but it's working 

Thank you @Visely-Team  @_JB 

Screenshot 2020-04-22 at 11.44.08 AM.png

Visely-Team
Shopify Partner
1843 210 488

Nice, didn't know about that one. Funny thing it is misspelled 🙂

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog

GrantDB
Shopify Partner
74 3 14

I had this too.  The name of that sales channel is the name app I think.  For me it was a time thing, as I think the app needs to be applied (added to the sales channels for each product) and that takes time