My Products
Help
Sigbjørn Eide
CONTRIBUTOR ***

Filter on values from joinup

by Sigbjørn Eide

Hi,

 

How to filter on values from joinup?

 

Example:

When getting contacts for customers you filter on contactFor > 0, but to make sure you only get contacts for customers, not suppliers, you also want to filter on customerNo from joinup_Associate_via_ContactFor. Using the syntax for fitering on nested objects in GraphQL I expected the following query to work:

query GetContacts($cid: Int) {
  useCompany(no: $cid) {
    associate(
      filter: {_and: [
        {contactFor: {_gt: 0}}, 
        {joinup_Associate_via_ContactFor: {customerNo: {_gt: 0}}}
      ]}
    ) 
    {
      items {
        associateNo
        name
        joinup_Associate_via_ContactFor {
          customerNo
          name
        }
      }
    }
  }
}

 But joinup_Associate_via_ContactFor is not defined in FilterExpression_Associate. 

4 REPLIES 4
omelhus
PARTNER

by omelhus

Hey,

 

This would be incredible useful. Please see if there's any chance to implement it.

by Marius Bancila

You can only filter on the fields of the table, not on joined data. 

Sigbjørn Eide
CONTRIBUTOR ***

Hmm, any plans to include this feature? Both filtering on joinup values and filtering on existence of joindown values will help reduce the payload size and thereby probably increase performance.

I had added this request to our backlog to investigate what we can do to make it possible. But I can't give you estimates at this point.