An open API service indexing awesome lists of open source software.

https://github.com/mathsgod/graphqlite-mixed-type

input and output mixed type for thecodingmachine/graphqlite
https://github.com/mathsgod/graphqlite-mixed-type

graphql php

Last synced: 4 months ago
JSON representation

input and output mixed type for thecodingmachine/graphqlite

Awesome Lists containing this project

README

          

[![PHP Composer](https://github.com/mathsgod/graphqlite-mixed-type/actions/workflows/php.yml/badge.svg)](https://github.com/mathsgod/graphqlite-mixed-type/actions/workflows/php.yml)

# graphqlite-mixed-type

input and output mixed type for thecodingmachine/graphqlite

## Setup
```php

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

```

## Example

```php
class Controllers{

/**
* @param mixed $a
*/
#[Query(outputType: "mixed")]
public function mixedInput($a)
{
return $a;
}
}
```

```gql
query {
mixedInput(a:{hello:"world"})
}
```
It will output
```json
{
"data": {
"mixedInput": {
"hello": "world"
}
}
}
```