init
This commit is contained in:
42
schema/FileConfigPaginationType.php
Normal file
42
schema/FileConfigPaginationType.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user