You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having a problem when I search for multiple terms, connected to multiple entries. When I search for "products" that are connected to the slug of multiple terms, the graphQL returns all items because the QueryBuilder doesn't understand the multi array.
How to reproduce
I tried this GraphQL query
{
entries(collection: "products", filter: {product_type: {in: {slug: ["term1","term2"]}}, locale: {is: "default"}}) {
data {
... on Entry_Products_Products {
id
title
slug
}
}
}
}
I did a quick fix to the whereIn function to solve this problem. It checks if $values is an array and if so, it creates multiple wheres. If it's not an array, it will continue with the old way.
I don't want to create a pull request for this, because I think the problem begins earlier when preparing the query. Not too familiar with Statamic yet.
Logs
No response
Versions
Statamic 3.2.20 Pro
Laravel 8.70.2
PHP 7.4.24
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered:
Bug description
I'm having a problem when I search for multiple terms, connected to multiple entries. When I search for "products" that are connected to the slug of multiple terms, the graphQL returns all items because the QueryBuilder doesn't understand the multi array.
How to reproduce
I tried this GraphQL query
I did a quick fix to the whereIn function to solve this problem. It checks if $values is an array and if so, it creates multiple wheres. If it's not an array, it will continue with the old way.
src/Query/Builder.php
I don't want to create a pull request for this, because I think the problem begins earlier when preparing the query. Not too familiar with Statamic yet.
Logs
No response
Versions
Statamic 3.2.20 Pro
Laravel 8.70.2
PHP 7.4.24
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: