cleanup of #[Field], QueryFieldDescriptor and QueryField itself, separating prefetch functionality from them
allow userland implementation of prefetch-like features, i.e. deferring the resolution of a field the same way prefetch does
This 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
new #[Prefetch] attribute supports callables, both through the container and through static methods: #[Prefetch([SomeService::class, 'method'])], #[Prefetch([SomeHelper::class, 'staticMethod'])], #[Prefetch('staticMethodInSourceClass')]
non static calls on the source object are no longer supported: #[Prefetch('methodOnSource')]. There's an exception for the deprecated #[Field(prefetchMethod: 'method')] - it continues to work
as a side effect of moving it to parameter level, multiple #[Prefetch] annotations per field are now allowed; order of input parameters in the scheme is determined by order of parameters on the field itself (see TestTypeWithPrefetchMethods)
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
)