mathsgod/graphqlite-mixed-type

mixed type for graphqlite

2.2.0 2024-09-17 07:26 UTC

This package is auto-updated.

Last update: 2024-12-17 08:06:47 UTC


README

PHP Composer

graphqlite-mixed-type

input and output mixed type for thecodingmachine/graphqlite

Setup

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

Example

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

It will output

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