'How should I use Regex in AWS Amplify GraphQL

So, I want to get the filtered data to my client, I coded:

  async function getData() {
    const exampleData= await API.graphql(graphqlOperation(listExample,{
      variables: { limit: 1000 },
      filter: {     
        order_number: {
           regexp: `.*TEST.*` 
          }
      }
    }));
    dispatch({ type: QUERY, example: exampleData.data.listExample.items });
  }

But I couldn't receive any data,

Accroding to this document https://docs.amplify.aws/lib/graphqlapi/query-data/q/platform/js/#filtering-queries

I tried eq, ne, etc. They all work fine and get filtered data.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source