@@ -20,25 +20,25 @@ class Client
2020 protected $ endpointUrl ;
2121
2222 /**
23- * @var array
23+ * @var \GuzzleHttp\Client
2424 */
25- protected $ authorizationHeaders ;
25+ protected $ httpClient ;
2626
2727 /**
28- * @var \GuzzleHttp\Client
28+ * @var array
2929 */
30- protected $ httpClient ;
30+ protected $ httpOptions ;
3131
3232 /**
3333 * Client constructor.
3434 *
3535 * @param string $endpointUrl
36- * @param array $authorizationHeaders
36+ * @param array $httpOptions
3737 */
38- public function __construct (string $ endpointUrl , array $ authorizationHeaders = [])
38+ public function __construct (string $ endpointUrl , array $ httpOptions = [])
3939 {
4040 $ this ->endpointUrl = $ endpointUrl ;
41- $ this ->authorizationHeaders = $ authorizationHeaders ;
41+ $ this ->httpOptions = $ httpOptions ;
4242 $ this ->httpClient = new \GuzzleHttp \Client ();
4343 }
4444
@@ -73,10 +73,9 @@ public function runQuery($query, bool $resultsAsArray = false, array $variables
7373 */
7474 public function runRawQuery (string $ queryString , $ resultsAsArray = false , array $ variables = []): ?Results
7575 {
76- // Set request headers for authorization and content type
77- if (!empty ($ this ->authorizationHeaders )) {
78- $ options ['headers ' ] = $ this ->authorizationHeaders ;
79- }
76+ // Set request options for \GuzzleHttp\Client
77+ $ options = (!empty ($ this ->httpOptions )) ? $ this ->httpOptions : [];
78+
8079 $ options ['headers ' ]['Content-Type ' ] = 'application/json ' ;
8180
8281 // Convert empty variables array to empty json object
0 commit comments