You are here

public function LockrClient::query in Lockr 7.3

Parameters

array $data:

Return value

array

File

vendor/lockr/lockr/src/LockrClient.php, line 92

Class

LockrClient

Namespace

Lockr

Code

public function query(array $data) {
  $resp = $this->httpClient
    ->request('POST', '/graphql', [
    'json' => $data,
  ]);
  $resp_data = json_decode((string) $resp
    ->getBody(), true);
  if (!empty($resp_data['errors'])) {
    throw new LockrApiException($resp_data['errors']);
  }
  return $resp_data['data'];
}