Skip to content

Modify response before returning? #523

@michilehr

Description

@michilehr

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions