Support `_some`/`_every`/`_none` filters for related fields
See original GitHub issueParent 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:
- ~How does the
_some
&_every
filters differ?~ - ~If
_some
&_every
are the same, can we just use the fieldname as the filter key (without the suffix)?~ - ~Is the
_none
the inverse of_some
or_every
? Or something entirely different?~ - Why
_none
, and not_not
to be consistent with other filters? - ~Am I miss-understanding this completely? Is the
_some
&_every
filters designed to filter theUser
s returned? Ie; in the above example, will it only return uses who have at least onepost
with atitle
containing"world"
? The equivalent query but with_every
would return only users that have everypost
with such atitle
.~ Yes. see: https://github.com/keystonejs/keystone-5/issues/217#issuecomment-412427012
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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”._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.
See also the current depth limitation: https://github.com/keystonejs/keystone-5/issues/86