-
Notifications
You must be signed in to change notification settings - Fork 98
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
Prefetch refactor #588
Merged
oojacoboo
merged 17 commits into
thecodingmachine:master
from
oprypkhantc:prefetch-refactor
Aug 3, 2023
Merged
Prefetch refactor #588
oojacoboo
merged 17 commits into
thecodingmachine:master
from
oprypkhantc:prefetch-refactor
Aug 3, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@oprypkhantc thanks for this. I'll get #584 reviewed and hopefully merged soon! |
# Conflicts: # src/FieldsBuilder.php # src/Parameters/PrefetchDataParameter.php # src/QueryField.php # src/QueryFieldDescriptor.php # website/docs/field-middlewares.md
Hey @oojacoboo, this is ready for review. |
Thanks @oprypkhantc, looks good - merged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR targets two things:
#[Field]
,QueryFieldDescriptor
andQueryField
itself, separatingprefetch
functionality from themThis includes changes from #584, so that would need to be merged first; then this can be reviewed properly.
On the changes:
prefetchMethod
parameter of#[Field]
now trigger a deprecation error#[Prefetch]
attribute supports callables, both through the container and through static methods:#[Prefetch([SomeService::class, 'method'])]
,#[Prefetch([SomeHelper::class, 'staticMethod'])]
,#[Prefetch('staticMethodInSourceClass')]
#[Prefetch('methodOnSource')]
. There's an exception for the deprecated#[Field(prefetchMethod: 'method')]
- it continues to work#[Prefetch]
annotations per field are now allowed; order of input parameters in the scheme is determined by order of parameters on the field itself (seeTestTypeWithPrefetchMethods
)