diff --git a/doc/graphql.md b/doc/graphql.md index 89080b24227..4151012342c 100644 --- a/doc/graphql.md +++ b/doc/graphql.md @@ -9,6 +9,16 @@ Wraps [GitHub v4 API (GraphQL API)](http://developer.github.com/v4/). $rateLimits = $client->api('graphql')->execute($query); ``` +#### Authentication + +To use [GitHub v4 API (GraphQL API)](http://developer.github.com/v4/) requests must [authenticated]((../security.md)). + +```php +$client->authenticate($token, null, Github\Client::AUTH_ACCESS_TOKEN); + +$result = $client->api('graphql')->execute($query); +``` + #### Use variables [Variables](https://developer.github.com/v4/guides/forming-calls/#working-with-variables) allow specifying of requested data without dynamical change of a query on a client side. @@ -28,5 +38,7 @@ $variables = [ 'organizationLogin' => 'KnpLabs' ]; +$client->authenticate('', null, Github\Client::AUTH_ACCESS_TOKEN); + $orgInfo = $client->api('graphql')->execute($query, $variables); -``` \ No newline at end of file +```