-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Field 'presentmentPrices' doesn't exist on type 'ProductVariant' #959
Comments
We fixed this by upgrading the package. |
I made sure the package resolved to the latest version which made this particular error go away. |
I am using version 2.11 I'm getting error while I'm trying to fetch the collection. variant price is causing the issue. I see in the generated query two brackets are extra after price. please check the code below and please let me know how to resolve this. code : const collectionQuery = this.client.graphQLClient.query((root) => { query generated: {"query":"query { collections (first: 25) { pageInfo { hasNextPage,hasPreviousPage },edges { cursor,node { id,title,description,products (first: 200) { pageInfo { hasNextPage,hasPreviousPage },edges { cursor,node { id,title,description,tags,images (first: 10) { pageInfo { hasNextPage,hasPreviousPage },edges { cursor,node { id,originalSrc } } },metafields (identifiers: [{key: "stylistId" namespace: "stylist_ids"} {key: "wigProperties" namespace: "STL_properties"}]) { id,value,key },options { id,name,values },variants (first: 50) { pageInfo { hasNextPage,hasPreviousPage },edges { cursor,node { id,product { id },title,availableForSale,quantityAvailable,sku,selectedOptions { name,value },price { } } } } } } } } } } }"} |
The same thing happened to my app yesterday. I have tried updating the package version but am still seeing this issue as well as several others. Bug detailsDescribe the bug When using the Shopify GraphQL API through the SDK, multiple queries are failing that were previously working. Errors received indicate both To Reproduce The error is consistently reproduced when making any queries involving the following fields: 'price', 'compareAtPrice', 'paymentDue', 'totalTax', 'subtotalPrice', 'totalPrice', 'totalShippingPrice', 'totalRefunded', 'presentmentPrices' and 'description'. An example response from the API is included below, however, due to the formatting constraints, the JSON response is not included in a separate code block: {
"errors": [
{
"message": "Field must have selections (field 'price' returns MoneyV2 but has no selections. Did you mean 'price { ... }'?)",
...
},
{
"message": "Field 'presentmentPrices' doesn't exist on type 'ProductVariant'",
...
},
...
]
} Unfortunately, I cannot provide the Expected behavior The queries that were previously working should continue to work without any errors. If there were changes in the Shopify GraphQL API that would require updates to these queries, those changes should have been documented in the SDK's release notes or changelog. Environment (please complete the following information):
Additional context The application was working fine until recently. There were no changes made on our end that would have affected these queries. It seems possible that there was a change or update on Shopify's end that caused this issue. |
👋 Each version of JS Buy SDK is directly linked to a Storefront API version and the SDK response will change as the underlying API evolves. As per our Changelog, it notes that there has been a few major changes in Storefront API in the last couple of release - notably API v2022-01 and v2022-10 where An important thing to note is that the support for a JS Buy SDK version is directly linked to the corresponding Storefront API version - if an SDK version is calling an API version that is not supported, the server will respond with the oldest supported API version. For example, using SDK version |
Also, if you are using the |
Hey @melissaluu and team, Thanks for the response! So, a quick clarification:
If so, two follow up questions:
Thanks for the help! |
Hi @JeffJassky, Glad I can help!
A new version of the Storefront API is released every quarter so we just released
Yes - the Storefront API will continue to evolve and it's a good idea to keep your queries up to date.
As per the release schedule, a stable API version is supported for a minimum of 12 months.
Our developer changelog, release notes and API docs are good references to help you migrate your queries. |
Thanks again @melissaluu. So, unfortunately presentmentPrices has been discontinued entirely. If you're trying to get prices for multiple currencies, it looks like we're supposed to use something called the @incontext directive, which is not currently supported by the js-buy-sdk. However: there is an open feature request to add support for @incontext directive in #884 and further reference to it in #853 |
Were they? It seems like the version was bumped up but the SDK wasn't updated with it. Types haven't been updated. The type for |
👋 @crimsonhawk47 - which version of the SDK are you using? Can you provide more details on where you're seeing the price string type? Since SDK v2.17.0, all predefined queries' price related fields have been updated to get the |
Please complete the checklist before filing an issue:
None of the above? Create an issue. Be sure to include all the necessary information for us to understand and reproduce the problem:
Bug details
Describe the bug
Hi, I am encountering an error while using the shopify-js-buy package version 2.9.0 in my app build process.
To Reproduce
Framework using nuxtjs
Since yesterday, I have been encountering this error.
The text was updated successfully, but these errors were encountered: