Actually i am not sure if this should be a feature request or a bug issue
query {
teaser {
data {
domain {
domain
}
}
}
}
query {
teaser(filter: {
domain: {
domain_eq: "mydomain"
}
}) {
data {
domain {
domain
}
}
}
}
response should contain only filtered items
unexpected response like:
{
"errors": [
{
"message": "Field \"domain\" is not defined by type TeaserFilter.",
"extensions": {
"category": "graphql"
},
"locations": [
{
"line": 3,
"column": 9
}
]
}
]
}
In a simple collection filtering works as expected. Here we just have to input fields for country and term and no relations:
query {
terms(filter: {
country_eq: "de"
}) {
data {
country
term
}
}
}
Working on this already.
love to hear that, thanks!
Hey, sorry about this, but I misread your issue (possibly out of tiredness). I was not actually planning to implement this, but I can definitely look into it.
At first glance, it looks like it's not a bug, but relation filters simply were not implemented.
@rijkvanzanten @bjgajjar Should we add this? My guess is that it's not technically hard to do.
I second that, exactly in the same situation and can't really get items filtered from a nested field.
My guess is that it's not technically hard to do.
@Owlree are you looking into it?
I'd love to have this functionality too
I really need this feature ! :'(
We prioritize feature requests by 馃憤 on the ticket (not sure if sub-comments count too), and if they are sponsored:
https://docs.directus.io/getting-started/supporting-directus.html#commissioned-features
Also, seeing it's an open source project, feel free to open a PR for things like this @stouch 馃檪
Yeah thank you guys for your responsiveness, I'll do this
any news about this problem/feature?
@EugenioSantos we're moving the API to a Laravel / GraphQL powered codebase over on https://github.com/directus/api-next. While this is not an immediate short term solution, we'll be fully supporting graphql in the next major version
@rijkvanzanten
Thanks for the reply 馃憤. Do you have a release forecast for the next major version?
Hard to pinpoint exactly. I'd rather not make any promises I can't keep 馃檪 We're a small team working for free, so the best I can say is keep an eye on github.com/directus/directus/releases. We're trying to have an alpha out pretty soon!
I am also looking forward for an ability to filter on nested attributes.
For now I made it happen with the _contains filter for a nested model.
service(filter: {community_contains: "${special_id}"}) {
data {
id
name
teaser
community {
special_id
}
}
}
This somehow returns me only service data for the correct community. The special_id needs to be a string.
You need to be sure, that the value of special_id cannot be the value of another field of community. It looks like, that the _contains searches in every field of a model.
any news about this problem/feature? thnks!
Most helpful comment
Hey, sorry about this, but I misread your issue (possibly out of tiredness). I was not actually planning to implement this, but I can definitely look into it.
At first glance, it looks like it's not a bug, but relation filters simply were not implemented.
@rijkvanzanten @bjgajjar Should we add this? My guess is that it's not technically hard to do.