Skip to content

Commit d0365b5

Browse files
committed
Document support of GraphQL variables
1 parent 5fc4032 commit d0365b5

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
44

55
## 2.6.0 (unreleased)
66

7+
### Added
8+
9+
- Support for graphql api [variables](https://developer.github.com/v4/guides/forming-calls/#working-with-variables) (#612)
10+
711
## 2.5.0
812

913
### Added

doc/graphql.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,25 @@ Wraps [GitHub v4 API (GraphQL API)](http://developer.github.com/v4/).
88
```php
99
$rateLimits = $client->api('graphql')->execute($query);
1010
```
11+
12+
#### Use variables
13+
14+
[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.
15+
16+
```php
17+
$query = <<<'QUERY'
18+
query showOrganizationInfo (
19+
$organizationLogin: String!
20+
) {
21+
organization(login: $organizationLogin) {
22+
name
23+
url
24+
}
25+
}
26+
QUERY;
27+
$variables = [
28+
'organizationLogin' => 'KnpLabs'
29+
];
30+
31+
$orgInfo = $client->api('graphql')->execute($query, $variables);
32+
```

0 commit comments

Comments
 (0)