question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support `_some`/`_every`/`_none` filters for related fields

See original GitHub issue

Parent issue: https://github.com/keystonejs/keystone-5/issues/35

These are available in Graph.Cool

For example:

{
  allUsers (
    where: { posts_some: { title_contains: "world" } },
    first: 10
  ) { 
    id
    name
    posts { title }
  }
}

Will filter to get only users who have a post with world in the title.

Open questions:

  1. ~How does the _some & _every filters differ?~
  2. ~If _some & _every are the same, can we just use the fieldname as the filter key (without the suffix)?~
  3. ~Is the _none the inverse of _some or _every? Or something entirely different?~
  4. Why _none, and not _not to be consistent with other filters?
  5. ~Am I miss-understanding this completely? Is the _some & _every filters designed to filter the Users returned? Ie; in the above example, will it only return uses who have at least one post with a title containing "world"? The equivalent query but with _every would return only users that have every post with such a title.~ Yes. see: https://github.com/keystonejs/keystone-5/issues/217#issuecomment-412427012

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
molombycommented, Aug 13, 2018

How does the _some & _every filters differ?

In the example above, the _some filter will return any users who have 1 or more posts with “world” in the title. If an _every filter was used instead, users would only be returned if all their posts had a title that contained “world”.

Is the _none the inverse of _some or _every? Or something entirely different?

_none is the inverse of _some. Again, looking to the example above, if we used a _none filter instead, users would only be returned if none of their posts had “world” in the title.

The relevant Graphcool docs.

0reactions
jesstelfordcommented, Aug 14, 2018

See also the current depth limitation: https://github.com/keystonejs/keystone-5/issues/86

Read more comments on GitHub >

github_iconTop Results From Across the Web

Filter on Related List - Salesforce Help
The automated filters present on the related list are from the columns added to the related list. To add columns to the related...
Read more >
Filtering for Scalar List Fields · Issue #5010 · prisma ... - GitHub
Hi, in #169 you have implemented the support for Array of primitives. Do you have a plan for supporting filtering by such array?...
Read more >
lightning - Filter in Related List using fields from related record
Write your own Lightning component that filters the related list appropriately. Use a solution like Doug Ayers' Filter Related Lists Without ...
Read more >
Apply a filter to view select records in an Access database
To filter on one or only a few of values in a long list, first clear the (Select All) check box and then...
Read more >
Filter data in a range or table - Microsoft Support
Select this icon to change or clear the filter. Related Topics. Excel Training: Filter data in a table · Guidelines and examples for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found