![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/app/code/Magefan/BlogGraphQl/Model/Posts/ |
<?php /** * Copyright © Magefan ([email protected]). All rights reserved. * Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement). */ declare(strict_types=1); namespace Magefan\BlogGraphQl\Model\Posts; use Magento\Framework\GraphQl\Query\Resolver\Argument\FieldEntityAttributesInterface; use Magento\Framework\GraphQl\ConfigInterface; /** * Class FilterArgument * @package Magefan\BlogGraphQl\Model\Posts */ class FilterArgument implements FieldEntityAttributesInterface { /** @var ConfigInterface */ private $config; /** * FilterArgument constructor. * @param ConfigInterface $config */ public function __construct(ConfigInterface $config) { $this->config = $config; } /** * Get the attributes for an entity * * @return array */ public function getEntityAttributes(): array { $fields = []; /** @var \Magento\Framework\GraphQl\Config\Element\Field $field */ foreach ($this->config->getConfigElement('BlogPost')->getFields() as $field) { $fields[$field->getName()] = 'String'; } return $fields; } }