client = HttpClient::create(); } public function makeRequest($query, $variables = []) { $options = (new HttpOptions()) ->setJson(['query' => $query, 'variables' => $variables]) ->setHeaders([ 'Content-Type' => 'application/json', 'User-Agent' => 'Symfony GraphQL client', ]); return $this->client ->request('POST', self::ENDPOINT, $options->toArray()) ->toArray(); } }