[SOLVED] Reference type field searching or filtering issue


#1

I have…

  • [ O ] Checked the logs and have provided uploaded a log file and provided a link because I found something suspicious there.

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ O ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

When we use a References type field as a List Field, it is not able to be searched or filtered by a specific condition.

Expected behavior

Content with reference type field should be searched or filtered by condition.

Minimal reproduction of the problem

Environment

  • [ O ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: v 3.2

Browser:

  • [ O ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:
image


#2

Have you defiined the target schema for your reference field in the validation tab?

You must also set Max Items to 1


#3

Hi Sebastian,

Yes I’ve defined the target schema and set Max Items to 1 as well, but still not working.

image


#4

Okay, I will have a look later this day.


#5

So far I could not reproduce it.


#6

Hi Sebastian,

It was the issue in 3.2 version and have solved out with 3.3 upgrade.

We would like to know the GraphQL query for that filter.

Because, we tried the below query to filter it by a reference object field value in GraphQL, however it doesn’t work as expected.

queryXXXXContents(filter: “data/station/iv/data/stationCode/iv eq ‘ABC’”){ … }

but we are able to retrieve using Id as below

queryXXXXContents(filter: “data/station/iv eq ‘f0e62902-b379-4723-aabb-78fb8778111f’”) {

Ideally we would like to be able to query by reference object fields as the first example.

Could you guide us how to do this please?

Thank you
Aaron


#7

You have to use the second approach for now. The first one is almost impossible to implement properly.