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
- Host: GitHub
- URL: https://github.com/mathsgod/graphqlite-mixed-type
- Owner: mathsgod
- License: mit
- Created: 2021-08-24T04:00:51.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-02-07T04:55:37.000Z (over 1 year ago)
- Last Synced: 2025-10-05T19:48:30.197Z (9 months ago)
- Topics: graphql, php
- Language: PHP
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](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"
}
}
}
```