You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional context
After some debugging, I observed that the data was correctly retrieved from the database.
The problem might start from ApiPlatform\GraphQl\State\Provider\ReadProvider#107 ReadProvider
changed the title [-]The class \"App\\Entity\\EntityName\" cannot be retrieved from \"App\\Entity\\EntityName\"[/-][+]The class "App\Entity\EntityName" cannot be retrieved from "App\Entity\EntityName"[/+]on Dec 20, 2023
changed the title [-]The class "App\Entity\EntityName" cannot be retrieved from "App\Entity\EntityName"[/-][+]LinksHandlerTrait : The class "App\Entity\EntityName" cannot be retrieved from "App\Entity\EntityName"[/+]on Dec 20, 2023
@soyuka no. The entity has id autoincrement as the identifier.
Only normal fields typed with enum (like in the example) have this problem. (I also have setters and getters defined as i know it impacts propertyResolver)
It seems to occur only for graphql endpoint.
I also did more tests by changing the column name from state to type and other non-common names), same problem.
Activity
[-]The class \"App\\Entity\\EntityName\" cannot be retrieved from \"App\\Entity\\EntityName\"[/-][+]The class "App\Entity\EntityName" cannot be retrieved from "App\Entity\EntityName"[/+][-]The class "App\Entity\EntityName" cannot be retrieved from "App\Entity\EntityName"[/-][+]LinksHandlerTrait : The class "App\Entity\EntityName" cannot be retrieved from "App\Entity\EntityName"[/+]soyuka commentedon Dec 20, 2023
Are you using the enum as identifier? this isn't supported may we see the whole resource or some more informations as this is not enough?
xterr commentedon Dec 20, 2023
@soyuka no. The entity has id autoincrement as the identifier.
Only normal fields typed with enum (like in the example) have this problem. (I also have setters and getters defined as i know it impacts propertyResolver)
It seems to occur only for graphql endpoint.
I also did more tests by changing the column name from state to type and other non-common names), same problem.
Thank you 👍
soyuka commentedon Dec 20, 2023
I see, can you provide a reproducer ?
xterr commentedon Dec 20, 2023
I created a repository for this purpose:
https://github.com/xterr/api-platform-links-handler-trait
You can find a test case in the readme
Thank you
GwendolenLynch commentedon Apr 8, 2024
This looks to be fixed by #6092
The tl;dr of what was happening was right here
core/src/GraphQl/Resolver/Factory/ResolverFactory.php
Line 41 in 875cc15
$body
was equal to0
so the loose comparison sent things down the wrong code path.