$args */ public function handle($root, array $args, $context, ResolveInfo $resolveInfo, Closure $next) { $rebingType = $resolveInfo->fieldDefinition->config['rebingType'] /** @phpstan-ignore-next-line */ ?? $resolveInfo->fieldDefinition->config['type']->getWrappedType()->config['rebingType']; if (! $rebingType instanceof EloquentType) { return $next($root, $args, $context, $resolveInfo); } $bindableFields = collect($rebingType->fieldClasses()) ->filter(fn (Field $field) => $field instanceof BindableField && Arr::has($args, $field->getName())) ->all(); /** @var Field&BindableField $field */ foreach ($bindableFields as $field) { $resolver = $field->bindResolver($args); if ($resolver === null) { $args['model'] = $rebingType->model()::query() ->where($field->getColumn(), Arr::get($args, $field->getName())) ->firstOrFail(); continue; } $args[$field->getName()] = $resolver; } return $next($root, $args, $context, $resolveInfo); } }