public function handleField(FieldValue $value, Closure $next): FieldValue
    {
        $previousResolver = $value->getResolver();

        return $next(
            $value->setResolver(
                function ($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) use ($previousResolver) {
                    $gate = app(Gate::class);
                    $gateArguments = $this->getGateArguments();

                    if ($id = $args['id'] ?? null) {
                        /** @var \Illuminate\Database\Eloquent\Model $modelClass */
                        $modelClass = $this->getModelClass();

                        $gateArguments[0] = $modelClass::findOrFail($id);
                    }

                    $this->getAbilities()->each(
                        function (string $ability) use ($context, $gate, $gateArguments): void {
                            $this->authorize($context->user(), $gate, $ability, $gateArguments);
                        }
                    );

                    return call_user_func_array($previousResolver, func_get_args());
                }
            )
        );
    }