GraphQL filter collections by other related collection attributes #2672
creative-andrew
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have Posts collection that has a relationship with a Categories collection.
In GraphQL I am able to query things like
However, I noticed that I can only use the category ID generated by Mongo.
If want to use for example the name of the category or slug it seems not to be possible.
Right now it is possible to do this in REST - - it'd be where[category.slug][equals]=SLUG/NAME
### Problem
The problem with GraphQL is that it's super-strongly typed - meaning that we would need to extend the GraphQL where types to include a LOT more valid properties - - basically, for each relationship field, you'd now need to output a category__fieldName for each field type that exists on category, which will get messy
### Possible Solution
Define the properties that should be included in the where args in the collection config file, that way we don't need to register all of them.
### Related discussion
https://discord.com/channels/967097582721572934/1107010234842624060
Beta Was this translation helpful? Give feedback.
All reactions