43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace dominion\file\schema;
|
||
|
|
||
|
use GraphQL\Type\Definition\Type;
|
||
|
use dominion\api\GraphQLSchemaPagination;
|
||
|
use dominion\file\Config;
|
||
|
use dominion\api\GraphQLPagination;
|
||
|
|
||
|
|
||
|
class FileConfigPaginationType extends GraphQLSchemaPagination
|
||
|
{
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
$config = [
|
||
|
'fields' => function(){
|
||
|
$output = $this->getCustomFields();
|
||
|
$output['data'] = [
|
||
|
'type' => Type::listOf(Types::fileConfig()),
|
||
|
'description' => 'Конфигурация миниатюр',
|
||
|
'args' => GraphQLPagination::argumentModify([
|
||
|
'id' => [
|
||
|
'type' => Type::int(),
|
||
|
'description' => 'Id конфига',
|
||
|
],
|
||
|
'sort' => [
|
||
|
'type' => Type::string(),
|
||
|
'description' => 'Сортировка (пример "isNew_asc" или "isVisible_desc")',
|
||
|
],
|
||
|
]),
|
||
|
'resolve' => function($root, $args){
|
||
|
return Config::getData($args, $root);
|
||
|
}
|
||
|
];
|
||
|
return $output;
|
||
|
}
|
||
|
];
|
||
|
parent::__construct($config);
|
||
|
}
|
||
|
|
||
|
}
|