mathsgod/graphqlite-mixed-type

mixed type for graphqlite

2.1.0 2022-10-13 09:38 UTC

This package is auto-updated.

Last update: 2024-04-13 12:48:41 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"
    }
  }
}