[4.x]: GraphQL "not" keyword working with tag field ids
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
What happened?
Description
Hello, I'm trying to filter out entries that include certain tag ids using GraphQL.
However an entry query with a tag field argument with variable ["not", ...ids] returns all entries that include the id(s) instead of of all entries not including.
Example below:
As a note: i've also tried using relatedToTags using the not keyword in the id argument inside that but it also returned the same results - all entries including the id.
Steps to reproduce
- Make an entry or entries query with a tag field argument in the graphiql
- Pass a variable such as
"not 123",["not", "123", "1234"],["not 124"]on the tag field argument - Run and get results including the id(s) instead of the inverse
Expected behavior
Show all entries that does not contain the tag with id(s)
Actual behavior
Shows all entries that includes the id(s)
Craft CMS version
4.4.5
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the tag-field filter in GraphiQL using the reported Craft CMS 4.4.5 queries and variables. Trace the entry query's tag field argument handling and compare it with relatedToTags; done means tag IDs prefixed with not exclude matching entries, including for multiple IDs, with regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100