GraphQL issue
Unanswered
Atlantic cod posted this in #help-forum
Atlantic codOP
Hi everyone,
I used that GraphQL query :
However, when i don't set any variables but category or set them null, i have no result as if variables were set. It's for them to be optional. If I remove those filters (but category) i have my results.
What is it due to ?
I used that GraphQL query :
query ProductQuery(
$category: String
$minPrice: GraphQLStringOrFloat
$maxPrice: GraphQLStringOrFloat
$condition: String
$materials: [String]
$colors : [String]
) {
Products(
filter: {
status: { _eq: "published" }
availability: { _eq: "available" }
condition: { _eq: $condition }
price: { _between: [$minPrice, $maxPrice] }
materials: { Materials_id: { name: { _in: $materials } } }
colors: { Colors_id: { name: { _in: $colors } } }
}
) {
id
name
price
slug
thumbnail {
id
title
}
category(filter: { slug: { _eq: $category } }) {
name
}
}
}However, when i don't set any variables but category or set them null, i have no result as if variables were set. It's for them to be optional. If I remove those filters (but category) i have my results.
What is it due to ?