GraphQL\Type\Definition\FieldArgument::createMap PHP Méthode

createMap() public static méthode

public static createMap ( array $config ) : array
$config array
Résultat array
    public static function createMap(array $config)
    {
        $map = [];
        foreach ($config as $name => $argConfig) {
            if (!is_array($argConfig)) {
                $argConfig = ['type' => $argConfig];
            }
            $map[] = new self($argConfig + ['name' => $name]);
        }
        return $map;
    }

Usage Example

 protected function __construct(array $config)
 {
     $this->name = $config['name'];
     $this->type = $config['type'];
     $this->resolve = isset($config['resolve']) ? $config['resolve'] : null;
     $this->args = isset($config['args']) ? FieldArgument::createMap($config['args']) : [];
     $this->description = isset($config['description']) ? $config['description'] : null;
     $this->deprecationReason = isset($config['deprecationReason']) ? $config['deprecationReason'] : null;
 }
All Usage Examples Of GraphQL\Type\Definition\FieldArgument::createMap