-
-
Notifications
You must be signed in to change notification settings - Fork 465
Change HAS condition type to always use String in @whereConditions #2725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change HAS condition type to always use String in @whereConditions #2725
Conversation
- Rename DEFAULT_WHERE_HAS_CONDITIONS to DEFAULT_HAS_CONDITION for cleaner type names (WhereConditionsHasCondition vs WhereConditionsWhereHasConditions) - Rename createWhereHasConditionsInputType to createHasConditionInputType - Add tests for nested HAS conditions and AND/OR combinations - Clarify CHANGELOG entry as a fix Co-Authored-By: Claude <noreply@anthropic.com>
…here-has-condition # Conflicts: # CHANGELOG.md
- Delegate createHasConditionInputType to createWhereConditionsInputType to eliminate code duplication (37 lines reduced to 6) - Replace assert() with $this->assertInstanceOf() for PHPUnit consistency Co-Authored-By: Claude <noreply@anthropic.com>
The delegation to createWhereConditionsInputType caused incorrect type references. Keep methods separate for clarity and correctness. Co-Authored-By: Claude <noreply@anthropic.com>
|
Released with https://github.com/nuwave/lighthouse/releases/tag/v6.64.2, thank you |
|
This ended up being a breaking change for my project, despite being released as a patch. |
|
@oortasertecfarma How did this break your project? I was inclined to agree with @DrPowerSlam assessment:
|
Can't speak for @oortasertecfarma , but this was a breaking change for me as well. This increased the cached schema file size from 17mb to 21mb, which caused memory exhaustion errors in ASTCache.php fromCacheOrBuild method, line 64, while reading the cache file. |
|
After looking into it, the issue that occurred in my project after upgrading was caused by a custom override of manipulateArgDefinition in WhereConditionsBaseDirective, which already allowed the use of String in HAS conditions and covered a slightly broader use case. Regarding the schema size mentioned above, I also checked it on my side. |
#2723
Changes
Changes the condition type of
HASarguments in@whereConditionsto always useStringtype, so thecolumntype isn't inherited from the parent node.Breaking changes
Technically this is a breaking change, since users that currently use the unupdated code will go from an Enum type to a String type.
However, I would argue that it's almost impossible to correctly use the current functionality, since you need a perfect overlap between columns in a node and all its relations to make it work.