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
Description
When an entity has a getter with the same type as a relation the Link generated by the LinkFactory gets overriden by the link detected via the getter in LinkResourceMetadataCollectionFactory::mergeLinks.
How to reproduce
Take api-platform demo app
Add the following getter to Book.php
public function getSomeImportantReview(): Review
{
return new Review();
}
"No mapping found for field 'someImportantReview' on class 'App\\Entity\\Book'.",
Possible Solution
Depending on whether this usage should be supported the Links generated by LinkFactory::createLinksFromRelations should only include doctrine relations and no relations detected by getter only.
Additional Context
The text was updated successfully, but these errors were encountered:
MrSpider
changed the title
No mapping found for field <field> on class <class> on graphql request when adding a getter with the same type as a doctrine association
No mapping found for field <field> on class <class> on graphql request when adding a getter with the same return type as a doctrine association
Nov 17, 2022
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
API Platform version(s) affected: 3.0.4
Description
When an entity has a getter with the same type as a relation the
Link
generated by theLinkFactory
gets overriden by the link detected via the getter inLinkResourceMetadataCollectionFactory::mergeLinks
.How to reproduce
Possible Solution
Depending on whether this usage should be supported the
Links
generated byLinkFactory::createLinksFromRelations
should only include doctrine relations and no relations detected by getter only.Additional Context
The text was updated successfully, but these errors were encountered: