Shopify / mobile-buy-sdk-ios

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.
MIT License
452 stars 198 forks source link

Failed to fetch Products name: Buy.Graph.QueryError.invalidQuery reasons: "Field products doesn't exist on type Shop" #1212

Open VikramSingh1994 opened 1 year ago

VikramSingh1994 commented 1 year ago

Hi @cocoahero @dbart01 ,

After 5th July, SDK released we are getting the issue on searching products by name (string)

        let query = Storefront.buildQuery { $0
            .shop {$0
                .products(first: Int32(25), query: "Zara Full shirt") { $0
                    .fragmentForStandardProduct()
                }
            }
        }

            let task  = self.client.queryGraphWith(query) { (query, error) in
            if let query = query  {
            let products = PageableArray( with: query.shop.products.edges, pageInfo:  query.shop.products.pageInfo)
                completion(products)
            } else {
                completion(nil)
            }
        }
        task.resume()
        return task

Please suggest if anyone has a solution.

### Tasks
- [ ] https://github.com/Shopify/mobile-buy-sdk-ios/issues/1211