New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Enable filtering for non array properties contained in an array #4111

danhounshell opened this Issue Feb 17, 2018 · 4 comments


None yet
5 participants

danhounshell commented Feb 17, 2018


This was previously raised in #1645, allowing for filtering for a property in an array using the example:

query Foo {
    filter: { id: { in: ['1', '2', '3'] } }
  ) {

@KyleAMathews answered that it is already a feature and showed an example using tags: { in: [$tag] }. He is correct, but it only works for properties, like tags, that are arrays. It does not work for properties that are strings. The example above, filtering by id, does not work.

It would be great if in and notin were supported by all property types.

FWIW I was able to work around this by adding an ids field to the node in onCreateNode that is basically just an array with the one single value of the id of the node. Then it my queries I query for fields: { ids: { in: [$ids] } }.

Actual result

Query throws a graphQL error, syntax is not supported.

Expected behavior

Query should resolve and include any nodes with ids of 123, 456 or 789.

Steps to reproduce

1. Perform a graphQL allThings query with a filter for id existing in an array of strings:
filter: { id: { in: ['123', '456', '789'] } }


This comment has been minimized.

adam-kuhn commented Feb 19, 2018

I'm willing to give this a try

@fk fk added the GraphQL label Feb 19, 2018


This comment has been minimized.


pieh commented Feb 19, 2018

@adam-kuhn couple hints if You want to implement this:

Here we add operators to filters in schema:

And here's where actual filtering take place -


This comment has been minimized.

adam-kuhn commented Feb 20, 2018

hey... I think this is over my head. So don't expect a solution from me. Thanks for the hints, I'll still attempt to get my head around this, just for the sake of learning


This comment has been minimized.


m-allanson commented Feb 20, 2018

No problem, thanks for giving it a shot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment