Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 701 Bytes

graphql.md

File metadata and controls

32 lines (25 loc) · 701 Bytes

GraphQL API

Back to the navigation

Wraps GitHub v4 API (GraphQL API).

Execute a query

$rateLimits = $client->api('graphql')->execute($query);

Use variables

Variables allow specifying of requested data without dynamical change of a query on a client side.

$query = <<<'QUERY'
query showOrganizationInfo (
  $organizationLogin: String!
) {
  organization(login: $organizationLogin) {
    name
    url
  }
}
QUERY;
$variables = [
    'organizationLogin' => 'KnpLabs'
];

$orgInfo = $client->api('graphql')->execute($query, $variables);