A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
"errors": [
{
"message": "Field 'products' doesn't exist on type 'Shop'",
"locations": [
{
"line": 1,
"column": 16
}
],
"path": [
"query",
"shop",
"products"
],
"extensions": {
"code": "undefinedField",
"typeName": "Shop",
"fieldName": "products"
}
}
]
}
Hey @FP_DEV
Can you confirm the query please? The response suggests the query might be structured `{ shop { products {` instead of simply `{ products {`.
Scott | Developer Advocate @ Shopify
Heyy SBD_
Yes, It was structured as `{ shop { products {`.
We were able to use this structure until yesterday without any problems.
Hi @FP_DEV 👋
It's unclear which schema and version is being used here. Currently, neither Admin API nor SFAPI have stable versions that support a `products` field/connection on the `shop` object. Querying `products` on the root will resolve this error: `{ products (first:10) { ... } }`.
Hope that helps!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hey @ShopifyDevSup,
Can you also help me understand why this would suddenly happen and stop working, irrespective of the schema and the version?
The website was working fine one minute and then all the product pages stopped working all of a sudden. We have been using this library for over a year now. -> npmjs(dot)com/package/graphql-js-client
Hey @FP_DEV ,
I definitely get where you're coming from here, this would for sure be frustrating - especially if it's functionality your app depends on, so I just wanted to say thank you for bearing with us here. I also just want to clarify what we're seeing on our end. As mentioned in our earlier reply here, the 'products' field under the 'shop' object isn't officially supported in the stable versions of either the Admin API or the Storefront API. This is likely the root cause of the issue you're reporting.
It may have been working previously due to to various reasons (generally, legacy functionality/dependency retention), but if a specific functionality isn't documented in our developer documentation and officially supported, it can change without notice. This instability/change without notice method also applies to the unstable version of the API as well - so I just wanted to mention that
We recommend sticking to the officially documented fields and structures for your production apps/integrations as this is the best way to ensure the stability and reliability of your apps/functionality. As we mentioned, querying products on the root of your query is the best way to grab specific product information currently, but since you're using the Node library, another place you may want to reach out to for potential further information would be the official Github repo for the Node.js library here. I'd recommend opening an issue on that repo, in case anything has changed with the Node library itself recently.
Hope this helps and thanks again for reaching out
Al | Shopify Developer Support
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog