Closed jack-of-blades closed 2 years ago
Hi there,
Could you provide a bit more context? I haven't come across that issue before. Without knowing more about the rest of the query etc, could the issue be related to image rather than images?
Hi, @pasdo501
Here is the entire query:
allWpVariableProduct(
filter: {
productCategories: {
nodes: { elemMatch: { databaseId: { in: $categoryIds } } }
}
}
) {
nodes {
name
productId
shortDescription
price
regularPrice
onSale
averageRating
slug
image {
sourceUrl
}
acf_product_information {
productHoverImage {
sourceUrl
}
}
categories: productCategories {
nodes {
slug
databaseId
}
}
attributes {
nodes {
name
variation
}
}
paColours {
nodes {
attributeId: databaseId
}
}
paSizes {
nodes {
attributeId: databaseId
}
}
acf_product_tile_add_ons {
squareMetresOfTilesPerBox
}
variations {
nodes {
variationId
name
onSale
price
regularPrice
attributes {
nodes {
attributeId
value
}
}
image {
mediaItemUrl
}
acf_product_tile_add_ons {
squareMetresOfTilesPerBox
}
}
}
}
}
Let me know if I need to provide more details. As mentioned, the issue only seems to occur when querying for the image url's for product variations and only on a live build. When I run this query in GraphiQL the data is retrieved perfectly.
When I remove the erroneous part the query works fine. Currently we're resorting to using a product variation's parent image for the variation.
Are you using another plugin, e.g. wp-graphql? I don't believe the allWpVariableProduct
data type is produced by this plugin. The types from this plugin would be, for example allWcProducts
.
@pasdo501
Thanks for the response.
Yes we are using the wp-graphql plugin. I thought the problem might lie here but I'll log an issue over there.
Thanks!
When querying for product variation image
sourceURL
ormediaItemURL
the following error is presented:The query works fine however when run in GraphiQL.