Filter by id of reference field

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

Environment

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

Others:
According to this Is reference field expand supported? expand isn’t supported.
However, is it possible to filter by the Id of the reference?

Here is an example:

{
  queryExamplesContents(filter: "id eq '7152ed05-83ac-4236-a6e7-fd8f4bcc26a4'"){
    id
    data {
      applications {
        iv {
          id
          data {
            id {
              iv
            }
          }
        }
      }
    }
  }
} 

It will give me a response:

{
  "data": {
    "queryExamplesContents": [
      {
        "id": "7152ed05-83ac-4236-a6e7-fd8f4bcc26a4",
        "data": {
          "applications": {
            "iv": [
              {
                "id": "b08d64ba-6056-4365-822d-5979ab4b4694",
                "data": {
                  "id": {
                    "iv": "refractories"
                  }
                }
              },
              {
                "id": "3ba3d812-193b-40a3-bc10-79a30106321a",
                "data": {
                  "id": {
                    "iv": "optoelectronics"
                  }
                }
              }
            ]
          }
        }
      }
    ]
  }
}

applications is referenced field and for example data/applications/iv/id exists (e.g. value = ‘3ba3d812-193b-40a3-bc10-79a30106321a’)

The question is: is it possible to create a query by the id of referenced field?

Example:

queryExamplesContents(filter: “data/applications/iv/id eq ‘3ba3d812-193b-40a3-bc10-79a30106321a’”)

would fail with:

“message”: “Error trying to resolve queryExamplesContents.”,

Thank you

Can you format in a way that makes it possible to understand what you are trying to do?

Sorry, should look better now.

It should work exactly like your last example. I will have a look why it does not show a proper error message and then make an update when necessary.

Ok, I managed to find the query:

Instead of this:

queryExamplesContents(filter: “data/applications/iv/id eq ‘3ba3d812-193b-40a3-bc10-79a30106321a’”)

Should be (no ‘id’ in ‘data/applications/iv’):

queryExamplesContents(filter: “data/applications/iv eq ‘3ba3d812-193b-40a3-bc10-79a30106321a’”)

Yes, you are right. I have not seen it in your example, sorry.

But it should show a proper error message.

I have pushed an update with better error handling.