Skip to content

[Feature] Support OR operator with column filters #6040

@PaulRBerg

Description

@PaulRBerg

Description

The or operator is supported but it doesn't support column filters.

Attempting to make the following query will yield an error:

employees(
  first: 5,
  where: {
    age_gt: 21,
    or: [
       { status: "active" },
       { stage:"review" }
     ]
   }
) {
    id
    name
    age
    contactAddress
  }
}

This error will be returned by the Graph Node:

ClientError: Filter must by an object

Normally, GraphQL supports this syntax.

For now, the fix is to remove age_gt from the top-level column filter, and repeat it under each or object, like so:

where: {
  or: [
    { age_gt: 21, status: "active" },
    { age_gt: 21, status: "review" }
  }
}

But this approach leads to a lot of duplicated code.

Discord Confusion

There has been quite a bit of confusion about this in the Discord server, e.g. this message.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions