mathsgod / graphqlite-mixed-type

input and output mixed type for thecodingmachine/graphqlite

Repository from Github https://github.commathsgod/graphqlite-mixed-typeRepository from Github https://github.commathsgod/graphqlite-mixed-type

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"
    }
  }
}

About

input and output mixed type for thecodingmachine/graphqlite

License:MIT License


Languages

Language:PHP 100.0%