2017 © Pedro Peláez
 

library graphql-php-client

A simple client to help execute queries and mutations across GraphQL

image

omnilance/graphql-php-client

A simple client to help execute queries and mutations across GraphQL

  • Thursday, June 22, 2017
  • by omnilance
  • Repository
  • 1 Watchers
  • 4 Stars
  • 1,012 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 6 Versions
  • 73 % Grown

The README.md

Omnilance GraphQL PHP Client

A simple client to help execute queries and mutations across GraphQL, (*1)


Installation

composer require omnilance/graphql-php-client or composer require "omnilance/graphql-php-client": ">=0.0.3", (*2)


Simple Usage

use Omnilance\GraphQL\Client;
$client = new Client($api_token);

additionaly you can set custom host, (*3)

$client->setHost($host);

Run query

$query = '{ 
    domain_check(domain: "rx-name.net" {
        cost,
        avail
    }
}';
$response = $client->response($query);

$query = '{
        allDomains(first:10) {
        domain {
                id,
                name,
                register_date,
                expired_date,
        }
    }
}';

$response = $client->response($query);

foreach($response->allDomains->domain as $domain) {
    print $domain->name;
}

Response class

all()

Use $response->all(); to get all of the data returned in the response, (*4)

errors()

Use $response->errors(); to get all the errors returned in the response, (*5)

hasErrors()

Use $response->hasErrors(); to check if the response contains any errors, (*6)

The Versions

22/06 2017

dev-master

9999999-dev

A simple client to help execute queries and mutations across GraphQL

  Sources   Download

BSD-3-Clause

The Development Requires

php client graphql

22/06 2017

0.0.5

0.0.5.0

A simple client to help execute queries and mutations across GraphQL

  Sources   Download

BSD-3-Clause

The Development Requires

php client graphql

19/06 2017

0.0.4

0.0.4.0

A simple client to help execute queries and mutations across GraphQL

  Sources   Download

BSD-3-Clause

The Development Requires

php client graphql

17/05 2017

0.0.3

0.0.3.0

A simple client to help execute queries and mutations across GraphQL

  Sources   Download

BSD-3-Clause

The Development Requires

php client graphql

16/05 2017

0.0.2

0.0.2.0

A simple client to help execute queries and mutations across GraphQL

  Sources   Download

BSD-3-Clause

The Development Requires

php client graphql

15/05 2017

0.0.1

0.0.1.0

A simple client to help execute queries and mutations across GraphQL

  Sources   Download

BSD-3-Clause

The Development Requires

php client graphql