Warning: mysqli_query(): (HY000/1021): Disk full (/tmp/#sql-a2c-1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device") in /var/www/html/wp-includes/wp-db.php on line 2024

Warning: mysqli_query(): (HY000/1021): Disk full (/tmp/#sql-a2c-1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device") in /var/www/html/wp-includes/wp-db.php on line 2024
class="post-442461 post type-post status-publish format-standard hentry" id="post-442461">

Magento 2: Add custom filter to existent GraphQL products query

I’m developing a headless solution using Magento as a product catalogue and i’m facing a small challenge (i’m pretty sure that is not challenging at all, for people that have experience with Magento framework, that is not my case). I’m using the 2.3.3 version of Magento btw.

I have to add a custom filter to the existent GraphQL products query (store_id, that represents the website id in Magento) and i’m a bit lost on how to implement that.

Basically i will have multiple stores created (e.g Portugal, United Kingdom) in Magento and i want to retrieve for example only the products that belongs to the Portugal Store (that is given by this new store_id filter). Can anyone help me?

I have seen this solution somewhere: http://www.mujahidh.com/how-to-filter-product-collection-with-default-graphql-products-query/

But it doesn’t work at all for me, the products query is returning an Internal error and after some debugging i have found this error: Warning: Invalid argument supplied for foreach() in magento2\lib\internal\Magento\Framework\GraphQl\Query\Resolver\Argument\AstConverter.php

Any ideas on how to overcome that? What am i missing?

Thanks in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *