directus / directus/directus

GraphQL filter error in Insights panel for M2A relationship

Open
#26,222 2 comments 0 reactions 0 assignees View on GitHub
Bug GraphQL Med Impact Med Reach Studio UX
Dominant language
TypeScript
Stars
37.9k
Forks
4.9k
Avg merge
3d 21h
Merged PRs (30d)
36

Description

### Describe the Bug

In the insights panel, I was using the List panel type to get a list of articles that contain a M2A section that has a wysiwyg field that contains a particular word. When setting up a filter for that M2A section, the filter builds this raw string:
```
{
"_and": [
{
"sections": {
"item:body": {
"content": {
"_contains": "certainword"
}
}
}
}
]
}
```

However graphQL does not like "item:body" because of the colon. I was able to resolve the issue by manually changing the raw string to "item__body" with two underscores. But I'm thinking that this should happen with the regular editor tools without having to edit the raw string.

Image

### To Reproduce

1. Create an Insights List Panel item. Use a collection with a M2A collection.
2. Try to filter on a field within that relational field.

### Directus Version

v11.13.0

### Hosting Strategy

Self-Hosted (Docker Image)

### Database

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.