Products are not filtered by category name
<!--
Hello 👋 Thank you for submitting an issue.

Before you start, please make sure your issue is understandable and reproducible.
To make your issue readable make sure you use valid Markdown syntax.

https://guides.github.com/features/mastering-markdown/

Please ensure you have also read and understand the contributing guide.

https://github.com/strapi/strapi/blob/main/CONTRIBUTING.md#reporting-an-issue
-->

## Bug report

### Required System information

- Node.js version: node/v18.17.1
- NPM version: npm/9.6.7
- Strapi version: 5.4.2
- Database: postgres 
- Operating system: macos darwin arm64
- Is your project Javascript or Typescript:  Typescript

<!-- Did you know you can run `yarn strapi report` or `npm run strapi report` to get this information easier? -->

### Describe the bug

Products are not filtered by category name

### Steps to reproduce the behavior

```
{
  "kind": "collectionType",
  "collectionName": "categories",
  "info": {
    "singularName": "category",
    "pluralName": "categories",
    "displayName": "Category",
    "description": ""
  },
  "options": {
    "draftAndPublish": true
  },
  "pluginOptions": {},
  "attributes": {
    "name": {
      "type": "string",
      "required": true
    },
    "category": {
      "type": "relation",
      "relation": "oneToOne",
      "target": "api::category.category"
    },
    "products": {
      "type": "relation",
      "relation": "manyToMany",
      "target": "api::product.product",
      "mappedBy": "categories"
    }
  }
}
```

```
{
  "kind": "collectionType",
  "collectionName": "products",
  "info": {
    "singularName": "product",
    "pluralName": "products",
    "displayName": "Product",
    "description": ""
  },
  "options": {
    "draftAndPublish": true
  },
  "pluginOptions": {},
  "attributes": {
    "name": {
      "type": "string",
      "required": true
    },
    "categories": {
      "type": "relation",
      "relation": "manyToMany",
      "target": "api::category.category",
      "inversedBy": "products"
    }
  }
}
```

Graphql query
```
query Products {
  products(filters: {
    categories: {
      name: {
        contains: "Products"
      }
    }
  }) {
    documentId
  }
}

```
4. See error "message": "Invalid key categories",

### Expected behavior

search will work

### Screenshots

<img width="760" alt="image" src="https://github.com/user-attachments/assets/7817cd02-6ecb-4851-a3e2-ed5655ad0022">