CMS Development

TDwebdev
Contributor | Diamond Partner
Contributor | Diamond Partner

Graphql how to filter on hubdb select column

Hi,

 

I want to filter on hubdb select column: product and onderwerp:

 

And because it is a select column do i have to put this: $product.value ?

If i dont use a variable and place hardcoded a value the filter works. But i want it based on a hubdb multi select column.

 

Code:

 

#  label: "Downloads listing"
#  description: "Query that retrieves and filters downloads in different ways. When filtering by company we need to find the company first and then fetch its associated downloads. We use the directives  and @include to control which query will run. The last two queries fetch the values we use for generating the filtering options in the UI."
#  $offset: {{ request.query_dict.offset || 0 }}
#  $limit: {{ (module.cards_per_row * module.rows_per_page) || 5 }}
#  $product: {{ request.query_dict.product || '' }}
#  $onderwerp: {{ request.query_dict.onderwerp  || '' }}

query downloads_listing(
  $offset: Int, 
  $limit: Int, 
  $product_name: [HS_Enum],
  $onderwerp_text: [HS_Enum] )
  {

    HUBDB {
      # Gets vacatures when there is either no filtering, or we're filtering by location and/or department.
      downloads_filter: downloads_collection(limit: $limit, offset: $offset, filter: {product__eq: $product, onderwerp__eq: $onderwerp}) {
        items {
          name
          url
        }
        hasMore
        limit
        offset
        total
      }
      downloads_dropdown_values: downloads_collection {
        items {
          product
          onderwerp
          datum
        }
      }
    }
  }

 

 

 

 



Vet Digital

Did my post solve your question? Help the community by marking it as a solution
0 Upvotes
1 Reply 1
TiphaineCuisset
Community Manager
Community Manager

Graphql how to filter on hubdb select column

Hi @TDwebdev 

 

Thank you for reaching out.

 

I want to tag some of our experts here - @Kevin-C @Indra @miljkovicmisa @Anton do you have any thoughts for @TDwebdev on this? 

 

Thank you!

Best

Tiphaine


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


0 Upvotes