-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
Force int
cast on ModelsLoader count
#2646
Conversation
When dealing with **legacy databases** the count for this related model returns a string like `"88"`, not `88`. ``` comments: [Comment] @hasmany(type: PAGINATOR) ``` After upgrading to PHP 8.4 this does not work anymore. And it throws a error _"Nuwave\Lighthouse\Execution\ModelsLoader\CountModelsLoader::extractCount(): Return value must be of type int, string returned"_ **Changes** Always cast to integer. Because, this count must be an integer, always. **Breaking changes** No.
Co-authored-by: Benedikt Franke <[email protected]>
@spawnia your suggested approach didn’t work. I also fixed the quote issue, but no luck. |
How is it not working? It is still casting to int. |
@spawnia the pipeline is failing :( it was passing at my first commit. But not after yours. |
I added the missing import with robsontenorio@2484c84, GitHub seems stuck at the moment. |
@spawnia i forced an dummy commit but I don’t get what is wrong with GitHub actions. Now phpstan complains about other things. |
Released with https://github.com/nuwave/lighthouse/releases/tag/v6.47.1, thank you @robsontenorio |
When dealing with legacy databases the count for this related model returns a string like
"88"
, not88
.After upgrading to PHP 8.4 this does not work anymore. And it throws a error
"Nuwave\Lighthouse\Execution\ModelsLoader\CountModelsLoader::extractCount(): Return value must be of type int, string returned"
Changes
Always cast to integer. Because, this count must be an integer, always.
Breaking changes
No.