Open ghost opened 4 years ago
Can you attempt the GraphQL query in an API client such as Postman / Insomnia? The corresponding query is in the readme here: https://github.com/Shopify/mobile-buy-sdk-android/blob/99480d418f2a3fbf60e82c091a31a8de7f936713/README.md#fetch-product-details-
This will help you determine if the issue is in your code or the product. You will want to use the Storefront API ID ex. Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzQ1NzI0MTExMzQwMjM=
I can fetch first 10 products but when I use the same ID of any product to fetch details of that specific product, it throws an error of invalid global id I have made sure that product is available on app sales channel. I have tried all these options individually but got same response
Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzQ1NzI0MTExMzQwMjM= gid://shopify/Product/4572411134023 4572411134023
Code
Storefront.QueryRootQuery query = Storefront.query(rootQuery -> rootQuery .node(new ID("4572411134023"), nodeQuery -> nodeQuery .onProduct(productQuery -> productQuery .title() .description() .images(arg -> arg.first(10), imageConnectionQuery -> imageConnectionQuery .edges(imageEdgeQuery -> imageEdgeQuery .node(imageQuery -> imageQuery .src() ) ) ) .variants(arg -> arg.first(10), variantConnectionQuery -> variantConnectionQuery .edges(variantEdgeQuery -> variantEdgeQuery .node(productVariantQuery -> productVariantQuery .price() .title() .available() ) ) ) ) ) );