mathsgod/graphqlite-mixed-type

为 graphqlite 的混合类型

2.2.0 2024-09-17 07:26 UTC

This package is auto-updated.

Last update: 2024-09-17 07:28:39 UTC


README

PHP Composer

graphqlite-mixed-type

thecodingmachine/graphqlite 提供输入和输出混合类型

安装设置

$factory = new SchemaFactory($cache, $container);
//...
$factory->addRootTypeMapperFactory(new MixedTypeMapperFactory);

示例

class Controllers{
    
    /**
     * @param mixed $a
     */
    #[Query(outputType: "mixed")]
    public function mixedInput($a)
    {
        return $a;
    }
}
query {
    mixedInput(a:{hello:"world"})
}

它将输出

{
  "data": {
    "mixedInput": {
      "hello": "world"
    }
  }
}