Shopify / js-buy-sdk

The JS Buy SDK is a lightweight library that allows you to build ecommerce into any website. It is based on Shopify's API and provides the ability to retrieve products and collections from your shop, add products to a cart, and checkout.
https://shopify.github.io/js-buy-sdk
MIT License
976 stars 255 forks source link

Shopify-buy unable to retrieve several parameteres #949

Open RamJogal opened 1 year ago

RamJogal commented 1 year ago

Hi team , team. When I try to access Shopify products using the npm package Shopify -buy, I get the error shown above. Framework React

Shopify-buy Version

2.19.0

 {
    "message": "Selections can't be made on scalars (field 'price' returns Money but has selections [amount, currencyCode])",
    "locations": [
        {
            "line": 1,
            "column": 56
        }
    ],
    "path": [
        "fragment VariantFragment",
        "price"
    ],
    "extensions": {
        "code": "selectionMismatch",
        "nodeName": "field 'price'",
        "typeName": "Money"
    }
}
JeffJassky commented 1 year ago

This is also happening to me - all of a sudden out of nowhere. Any chance you found a work around? #960 and #959 seem to be related.

RamJogal commented 1 year ago

Yes This was Beacuse While Using the SDK i wasn't providing the API version as " " in the arguments so of which many parameters were missing, to solve the above issue i added some value to API version in the argument now every thing is working fine

RamJogal commented 1 year ago

Hi Jeff My bad Earlier I kept the API Version as " " in arguments after that I tried that with some values everything was working fine so after that i removed the API version argument from the arguments this.client = Client.buildClient({ domain, storefrontAccessToken, });