library graphql-client
A GraphQL client for PHP
camuthig/graphql-client
A GraphQL client for PHP
- Thursday, November 30, 2017
- by camuthig
- Repository
- 1 Watchers
- 0 Stars
- 80 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 4 Versions
- 36 % Grown
PHP GraphQL Client
A simple, dependency-free GraphQL client for PHP 7.1+, (*1)
Install
composer require camuthig/graphql-client
Usage
<?php
use Camuthig\Graphql\Client\Client;
$headers = [
'X-From' => 'The Test',
];
$client = new Client('https://9jv9z4w3kr.lp.gql.zone/graphql', $headers);
$graphql = <<<'GRAPHQL'
query($input: String!) {
hello(input: $input)
}
GRAPHQL;
$result = $client->execute($graphql, ['input' => 'everyone']);
var_dump($result->hasErrors()); // false
var_dump($result->getErrors()); // []
var_dump($result->getData());
/*
array(1) {
["hello"]=>
string(15) "Hello everyone! From The Test"
}
*/
dev-master
9999999-dev
A GraphQL client for PHP
Sources
Download
MIT
The Requires
The Development Requires
by
Chris Muthig
0.3.0
0.3.0.0
A GraphQL client for PHP
Sources
Download
MIT
The Requires
The Development Requires
by
Chris Muthig
0.1.0
0.1.0.0
A GraphQL client for PHP
Sources
Download
MIT
The Requires
The Development Requires
by
Chris Muthig
0.2.0
0.2.0.0
A GraphQL client for PHP
Sources
Download
MIT
The Requires
The Development Requires
by
Chris Muthig