yarec/graphql-client

There is no license information available for the latest version (1.0.1) of this package.

graphql

Installs: 96

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/yarec/graphql-client

1.0.1 2019-01-19 01:09 UTC

This package is auto-updated.

Last update: 2025-09-19 15:06:22 UTC


README

Usage

$endpoint = 'http://api.example.com/graphql';
$client = new Client($endpoint);

// for one
$opts = [
    'args' => [
        'id'=> 1234
    ],
    'resp' => [
        'id',
        'name',
        'email'
    ]
];

$data = $client->query('user', $opts);


//for list
$opts = [
    'params' => [
        'per_page' => 3,
        'page' => 2,
    ],
    'args' => ['sex' => 'male'],
    'resp' => [
        'data' => [
            'id',
            'name',
            'email'
        ]
    ]
];

$data = $this->client->query('users', $opts);

DEV

composer config repositories.gql-client path $PATH/yarec/graphql-client

composer require yarec/graphql-client -vvv