1 | <?php |
||
9 | class Client |
||
10 | { |
||
11 | /** |
||
12 | * @var ClientInterface |
||
13 | */ |
||
14 | private $httpClient; |
||
15 | |||
16 | /** |
||
17 | * @var ResponseBuilder |
||
18 | */ |
||
19 | private $responseBuilder; |
||
20 | |||
21 | 20 | public function __construct(ClientInterface $httpClient, ResponseBuilder $responseBuilder) |
|
26 | |||
27 | /** |
||
28 | * @throws \UnexpectedValueException When response body is not a valid json |
||
29 | * @throws \RuntimeException When there are transfer errors |
||
30 | */ |
||
31 | 10 | public function query(string $query, array $variables = null): Response |
|
35 | |||
36 | /** |
||
37 | * @throws \UnexpectedValueException When response body is not a valid json |
||
38 | * @throws \RuntimeException When there are transfer errors |
||
39 | */ |
||
40 | 2 | public function mutate(string $query, MutationObject $mutation): Response |
|
44 | |||
45 | 12 | private function executeQuery(string $query, $variables): Response |
|
64 | } |
||
65 |