Skip to content
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

No products returned with a Products Query #891

Open
FourthElementLtd opened this issue Sep 16, 2024 · 0 comments
Open

No products returned with a Products Query #891

FourthElementLtd opened this issue Sep 16, 2024 · 0 comments

Comments

@FourthElementLtd
Copy link

Hi Team,

Up to a few days ago, this query was running absolutely happily and showing products based on a visitor going to a Woocommerce Product Category.

products(where: {
categoryId: '.$cateID.',
status: "publish",
visibility: VISIBLE},
first: 18,
after:"") {
nodes {
sku
type
name
onSale
slug
image {
guid
}
}
pageInfo {
endCursor
hasNextPage
}
}

Where I substitute $cateID for the Woocommerce category, however, now no products are returned. In the graphQL IDE, this is the result of a query being performed

"data": {
"products": {
"nodes": [],
"pageInfo": {
"endCursor": null,
"hasNextPage": false
}
}
},

DEBUG says this, but not sure if it's related

"extensions": {
"debug": [
{
"type": "GRAPHQL_DEBUG",
"message": "Interface field argument "ProductVariation.metaData(keysIn:)" expected to be of type "" but got "[String]". Please ensure the field arguments match the interface field arguments or rename the argument.",

I would have expected to see product data being returned, but nothing. I have trimmed the query down to just the category ID, but still blank. I have also switched off all plugins apart from Woocommerce and all the graphQL ones (which haven't updated in a while)

The issue is happening across my local environment and also on a test and staging environment.

Plugin Versions
WooGraphQL Version: 0.19.0 (on local environment)
WPGraphQL Version: 1.28.1
WordPress Version: 6.6.2
WooCommerce Version: 9.3.1

Additional context
All the other graphQL queries work fine, I use them to pull out data from a custom post type and also run a query to pull out all the product data, these work absolutely fine, which makes me confused as to if it's a plugin conflict.

Thank you, Darren.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant