Modify response before returning?
michilehr opened this issue · comments
Michi Lehr commented
Hi,
is it possible to modify a response before sending?
Given I have a Configuration with a name that differs from language to language (de and en).
/**
* @Type()
*/
class Configuration
{
private string $name;
public function getName(): ?string
{
return $this->name;
}
}
Now I want to query for the name...
query {
configurations {
name
}
}
... and the response should look like this:
{
"data": {
"configurations": {
"de": {
"name": "config de"
},
"en": {
"name": "config en"
}
}
}
}
Would this even be valid by the GraphQL specification?
Thanks for your help!