You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,7 +223,9 @@ $gql = $builder->getQuery();
223
223
# Constructing The Client
224
224
225
225
A Client object can easily be instantiated by providing the GraphQL endpoint
226
-
URL. The Client constructor also receives an optional "authorizationHeaders"
226
+
URL.
227
+
228
+
The Client constructor also receives an optional "authorizationHeaders"
227
229
array, which can be used to add authorization headers to all requests being sent
228
230
to the GraphQL server.
229
231
@@ -236,6 +238,33 @@ $client = new Client(
236
238
);
237
239
```
238
240
241
+
242
+
The Client constructor also receives an optional "httpOptions" array, which **overrides** the "authorizationHeaders" and can be used to add custom [Guzzle HTTP Client request options](https://guzzle.readthedocs.io/en/latest/request-options.html).
243
+
244
+
Example:
245
+
246
+
```
247
+
$client = new Client(
248
+
'http://api.graphql.com',
249
+
[],
250
+
[
251
+
'connect_timeout' => 5,
252
+
'timeout' => 5,
253
+
'headers' => [
254
+
'Authorization' => 'Basic xyz'
255
+
'User-Agent' => 'testing/1.0',
256
+
],
257
+
'proxy' => [
258
+
'http' => 'tcp://localhost:8125', // Use this proxy with "http"
259
+
'https' => 'tcp://localhost:9124', // Use this proxy with "https",
260
+
'no' => ['.mit.edu', 'foo.com'] // Don't use a proxy with these
0 commit comments