-
-
Notifications
You must be signed in to change notification settings - Fork 937
Allow to fetchEager a non-serializable property fix #1290 #1297
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
Conversation
|
@soyuka thanks for the quick work! |
|
Hmm yes indeed updated ^^. |
|
Perfect, works for me! |
|
Obviously the docs should be updated, but also clarified, as at the moment the eager loading page (https://api-platform.com/docs/core/performance) doesn't really say that eager loading is linked to serialization. |
|
|
||
| if (false === $propertyMetadata->isReadableLink() || false === $propertyMetadata->isReadable()) { | ||
| continue; | ||
| if (false === $propertyMetadata->getAttribute('fetchEager', false)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can merge this condition with the previous one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really :|. I tried things in my head but it doesn't seem to end up well because it's not a condition to break but rather a condition to not break when we should have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plus this is far more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay got it I think:
if ((false === $propertyMetadata->isReadableLink() || false === $propertyMetadata->isReadable()) && false === $propertyMetadata->getAttribute('fetchEager', false)) {
continue;
}
|
good to merge @soyuka ? |
|
Needs rebase but good to merge. |
The following will bypass `readable` and `readableLink`: ``` @ApiProperty(attributes={"fetchEager": true}) ```
Allow to fetchEager a non-serializable property fix api-platform#1290
The following will bypass
readableandreadableLink:ping @bendavies could you give this a try?