Resolve the field directive.

@param  \Nuwave\Lighthouse\Schema\Values\FieldValue  $value
@param  \Closure  $next
@return \Nuwave\Lighthouse\Schema\Values\FieldValue

@throws \Nuwave\Lighthouse\Exceptions\DirectiveException
12992
public function handleField(FieldValue $value, Closure $next): FieldValue
    {
        $contextAttributeName = $this->directiveArgValue('context');
        if (! $contextAttributeName) {
            throw new DirectiveException(
                "The `inject` directive on {$value->getParentName()} [{$value->getFieldName()}] must have a `context` argument"
            );
        }

        $argumentName = $this->directiveArgValue('name');
        if (! $argumentName) {
            throw new DirectiveException(
                "The `inject` directive on {$value->getParentName()} [{$value->getFieldName()}] must have a `name` argument"
            );
        }

        $previousResolver = $value->getResolver();

        return $next(
            $value->setResolver(
                function ($rootValue, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) use ($contextAttributeName, $argumentName, $previousResolver) {
                    return $previousResolver(
                        $rootValue,
                        Arr::add($args, $argumentName, data_get($context, $contextAttributeName)),
                        $context,
                        $resolveInfo
                    );
                }
            )
        );
    }
1212370
public function handle(Request $request, Closure $next)
    {
        View::share('request', $request);
        View::share('editor', Editor::getFacadeRoot());

        $viewHelpers = Config::get('boomcms.viewHelpers');

        foreach ($viewHelpers as $key => $value) {
            View::share($key, $value);
        }

        return $next($request);
    }
776208
public function handle(Request $request, Closure $next)
    {
        $this->collectModules(function ($fileInfo) {
            $this->resolveClass($fileInfo, function ($module) {
                if ($module instanceof Module) {
                    $this->registerModule($module);
                }

                if ($this->navigableResource($module)
                    && ($navigation = $this->application->make('scaffold.navigation'))
                ) {
                    $this->makeNavigation($module, $navigation);
                }
            });
        });

        return $next($request);
    }
757245
public function resolveField(FieldValue $fieldValue): FieldValue
    {
        [$className, $methodName] = $this->getMethodArgumentParts('resolver');

        $namespacedClassName = $this->namespaceClassName(
            $className,
            $fieldValue->defaultNamespacesForParent()
        );

        $resolver = Utils::constructResolver($namespacedClassName, $methodName);

        $additionalData = $this->directiveArgValue('args');

        return $fieldValue->setResolver(
            function ($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) use ($resolver, $additionalData) {
                return $resolver(
                    $root,
                    array_merge($args, ['directive' => $additionalData]),
                    $context,
                    $resolveInfo
                );
            }
        );
    }
1076884
public function handle($request, Closure $next, $value)
    {
        if (\Gate::denies($value)) {
            app()->abort(403, 'Missing permission \''.$value.'\'');
        }

        return $next($request);
    }
766756
public function handleField(FieldValue $value, Closure $next): FieldValue
    {
        $eventBaseName = $this->directiveArgValue('dispatch')
            /*
             * @deprecated The aliases for dispatch will be removed in v4
             */
            ?? $this->directiveArgValue('fire')
            ?? $this->directiveArgValue('class');
        $eventClassName = $this->namespaceClassName($eventBaseName);
        $previousResolver = $value->getResolver();

        return $next(
            $value->setResolver(
                function () use ($previousResolver, $eventClassName) {
                    $result = call_user_func_array($previousResolver, func_get_args());

                    $this->eventsDispatcher->dispatch(
                        new $eventClassName($result)
                    );

                    return $result;
                }
            )
        );
    }
909053
public function modifyValue($value) : Field
    {
        if (is_string($value)) {
            $this->attributes['value'] = explode(',', $value);
        }

        if ($value instanceof \Closure) {
            $this->attributes['value'] = $value($this->attributes);
        }

        if (is_null($value)) {
            $this->attributes['value'] = [];
        }

        return $this;
    }
277057
public function handleField(FieldValue $value, Closure $next): FieldValue
    {
        $resolver = $value->getResolver();

        return $next(
            $value->setResolver(
                function (Model $parent, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) use ($resolver): Deferred {
                    $loader = BatchLoader::instance(
                        RelationBatchLoader::class,
                        $resolveInfo->path,
                        [
                            'relationName' => $this->directiveArgValue('relation', $this->definitionNode->name->value),
                            'args' => $args,
                            'scopes' => $this->directiveArgValue('scopes', []),
                            'resolveInfo' => $resolveInfo,
                        ]
                    );

                    return new Deferred(function () use ($loader, $resolver, $parent, $args, $context, $resolveInfo) {
                        return $loader
                            ->load(
                                $parent->getKey(),
                                ['parent' => $parent]
                            )->then(
                                function () use ($resolver, $parent, $args, $context, $resolveInfo) {
                                    return $resolver($parent, $args, $context, $resolveInfo);
                                }
                            );
                    });
                }
            )
        );
    }
804276
public function setField(Closure $value)
    {
        $this->onValidate();
        $this->attributes['field'] = $value;
        @list($name, $type) = explode(':', $this->attributes['type']);
        $whereType                 = [
            'name' => $name,
        ];
        if (!is_null($type)) {
            array_set($whereType, 'type', $type);
        }

        $typeModel = FieldType::query()->where($whereType)->firstOrFail();
        $where     = [
            'name'          => $this->name,
            'brand_id'      => brand_id(),
            'imported'      => 1,
            'type_id'       => $typeModel->id,
            'force_display' => 1
        ];
        $field     = FieldView::query()->where($where)->first();
        if (is_null($field)) {
            return $this;
        }
        $this->attributes($field);


        return $this;
    }
633338
public function resolve(
        ValueInterface $value,
        FixtureInterface $fixture,
        ResolvedFixtureSet $fixtureSet,
        array $scope,
        GenerationContext $context
    ): ResolvedValueWithFixtureSet {
        if (null === $this->resolver) {
            throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
        }

        $context->markAsNeedsCompleteGeneration();
        $fixtureReferenceResult = $this->resolver->resolve($value->getReference(), $fixture, $fixtureSet, $scope, $context);
        $context->unmarkAsNeedsCompleteGeneration();

        /** @var ResolvedFixtureSet $fixtureSet */
        list($instance, $fixtureSet) = [$fixtureReferenceResult->getValue(), $fixtureReferenceResult->getSet()];

        try {
            $propertyValue = $this->propertyAccessor->getValue($instance, $value->getProperty());
        } catch (SymfonyNoSuchPropertyException $exception) {
            throw NoSuchPropertyExceptionFactory::createForFixture($fixture, $value, 0, $exception);
        } catch (\Exception $exception) {
            throw UnresolvableValueExceptionFactory::create($value, 0, $exception);
        }

        return new ResolvedValueWithFixtureSet(
            $propertyValue,
            $fixtureSet
        );
    }
41077
public function handle($request, Closure $next)
    {
        config(['request.timezone' => $this->determineRequestTimezone($request)]);

        return $next($request);
    }
872483
public function lte($field, $value)
    {
        return function ($object) use ($field, $value) {
            return ClosureExpressionBuilder::getObjectFieldValue($object, $field) <= $value;
        };
    }
1223744
public function handleField(FieldValue $value, Closure $next): FieldValue
    {
        $relations = $this->directiveArgValue('relations', []);
        $resolver = $value->getResolver();

        return $next($value->setResolver(function () use ($resolver, $relations) {
            $result = call_user_func_array($resolver, func_get_args());
            ($result instanceof Deferred)
                ? $result->then(function (Collection &$items) use ($relations) {
                    $items->load($relations);

                    return $items;
                })
                : $result->load($relations);

            return $result;
        }));
    }
776169
public function handle($request, Closure $next)
    {
        $route = $request->route();

        $this->router->substituteBindings($route);

        $this->substituteImplicitBindings($route);

        return $next($request);
    }
650675
public function resolveField(FieldValue $fieldValue): FieldValue
    {
        $method = $this->directiveArgValue(
            'name',
            $this->definitionNode->name->value
        );

        return $fieldValue->setResolver(
            function ($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) use ($method) {
                return call_user_func([$root, $method], $root, $args, $context, $resolveInfo);
            }
        );
    }
288326
public function resolve(
        ValueInterface $value,
        FixtureInterface $fixture,
        ResolvedFixtureSet $fixtureSet,
        array $scope,
        GenerationContext $context
    ): ResolvedValueWithFixtureSet {
        if (null === $this->argumentResolver) {
            throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
        }

        $arguments = $value->getArguments();
        foreach ($arguments as $index => $argument) {
            if ($argument instanceof ValueInterface) {
                $resolvedSet = $this->argumentResolver->resolve($argument, $fixture, $fixtureSet, $scope, $context);

                $arguments[$index] = $resolvedSet->getValue();
                $fixtureSet = $resolvedSet->getSet();
            }
        }

        return $this->resolver->resolve(
            new ResolvedFunctionCallValue($value->getName(), $arguments),
            $fixture,
            $fixtureSet,
            $scope,
            $context
        );
    }
579858
public function handleField(FieldValue $value, Closure $next): FieldValue
    {
        $type = $value->getParentName();
        $resolver = $value->getResolver();

        return $next(
            $value->setResolver(
                function () use ($type, $resolver) {
                    $resolvedValue = call_user_func_array($resolver, func_get_args());

                    return $this->globalId->encode(
                        $type,
                        $resolvedValue
                    );
                }
            )
        );
    }