-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Price not showing on products query #176
Comments
@mehidi258 the schema design was changed drastically in v0.3.0, if you are using WPGraphiQL, I recommend using the Explorer panel to view and get a general idea of what the schema shape |
I searched for price in wpgraphiql explorer but did not find. Can somebody please let me know how I can find price in products query |
@ganeshpprasad Here's an example query. Prices fields only exist on the query ($id: ID!, $idType: ProductIdTypeEnum) {
product(id: $id, idType: $idType) {
id
productId
name
... on SimpleProduct {
price
regularPrice
salePrice
dateOnSaleFrom
dateOnSaleTo
}
... on VariableProduct {
price
regularPrice
salePrice
dateOnSaleFrom
dateOnSaleTo
}
}
} |
when I do this give this error: |
I am using wp-graphql-woocommerce with wp-graphql and wp-graphiql
here is my query
query MyQuery { products(first: 20) { nodes { productId slug name price } } }
it gives me an error
Cannot query field "price" on type "Product".
The text was updated successfully, but these errors were encountered: