Filter on a json repeater

Hello.

We have a Repeater field (divisions) containing only one field: id (string) on a collection.
We have a Postgres database.

We try to filter on this id like this:

    const filter: Record<string, unknown> = {
      status: { _eq: 'published' },
      divisions: {
          _some: {
              id: {
                  _eq: divisionId,
               },
          },
      },
    };

This has no effect whatsoever.

We have tried deep, alias, json with the same result.

Is there any possibilities to filter on a json field?

Thanks in advance

2 Answers

2

Hello @MagnusAndersson

You cannot properly filter inside a Repeater field because it is stored as JSON.
If you need filtering, it should be modeled as a relational collection instead.

Thanks for the reply.

–

Hi @MagnusAndersson, this should be possible now - in theory.
See my thread in Confused about new JSON filter - GraphQL with a very similar problem with a likely bug that makes it yet impossible at the moment.

Thanks for the heads up! Have you reported thus as a change request or a bug?

–