public static function apply($query, array $args, array $scopes, ResolveInfo $resolveInfo)
    {
        /** @var \Nuwave\Lighthouse\Execution\QueryFilter $queryFilter */
        if ($queryFilter = $resolveInfo->queryFilter ?? false) {
            $query = $queryFilter->filter($query, $args);
        }

        foreach ($scopes as $scope) {
            call_user_func([$query, $scope], $args);
        }

        return $query;
    }