Appsync how to use [String] inside query

523 Views Asked by At

I am trying to get products using specific brand names. I have set up my query as brandList : [String] and the query is as follows

            {
                "terms": {
                    "brand_name": 
                       $brandList
                }
            },

I am not sure how can I pass my query to Appsync. the original query should be like this

"["brand1","brand2","brand3"]". how can I handle the list of string with just brand name.

1

There are 1 best solutions below

0
On

To be able to execute a query by filtering with an "in" operator it is only possible by using the enhanced filters (or by using the request mapping template).

I suggest you look here: https://docs.aws.amazon.com/appsync/latest/devguide/aws-appsync-real-time-enhanced-filtering.html