Filtering and Searching

I need help running a search function and a filter from a drop-down using graphql. cant seem to find anything relating to graphql

Hi @Vincent_1, What have you tried and what issues are you running into? There are a few of us here who have ReTool working with GraphQL APIs.

Perhaps start here: GraphQL Integration

so far am able to search from one column, using the filter but I want to search from the entire table and also when attempt to filter from the dropdown the whole table just collapses. here is a code sample of what I have done.

query ListTrans($limit: Int) {
  listTrans(limit: $limit,filter: {transRefID: {beginsWith: "{{search_input.value}}"}}) {
    items {

the above query works just fine to search through the table with in one column it breaks the moment i add something like this

query ListTrans($limit: Int) {
 ListTrans(limit: $limit,filter: {paymentRefID: {beginsWith: "{{search_orders.value}}"}, status: {eq: '{{status_filter_orders.value.value}}'}}})

it returns the following error because i have incased statusinput with single quotes

[{"path":null,"locations":[{"line":2,"column":28,"sourceName":null}],"message":"Validation error of type WrongType: argument 'filter.status.eq' with value 'EnumValue{name='undefined'}' is not a valid 'TransStatus' @ 'listTrans'"}]

and if i remove the single quotes i get an empty list

query ListTrans($limit: Int) {
  listTrans(limit: $limit,filter: {paymentRefID: {beginsWith: "{{search_orders.value}}"}, status: {eq: {{status_filter_orders.value}}}}) 

have you considered updating your inputs to accept the entire object and send that object when you trigger the api? Obviously I don't know how you're triggering this in ReTool.

For example

  listTrans(limit: $limit, filter: $filter) { ...

send the object to the query as $filter

const filterParam = { 
  transRefID: {
    beginsWith: "{{search_input.value}}"

send on trigger (if your calling trigger):

  additionalScope: {
    filter: filterParam,

In the GraphQL query you can define the variable $filter as {{ filter }} and it will be filled in.

If you provide how you are calling the query we can see about other options.