evilfreelancer/simplegqlient
最新稳定版本:1.0.0
Composer 安装命令:
composer require evilfreelancer/simplegqlient
包简介
The simplest GraphQL client written in PHP
README 文档
README
The simplest GraphQL client written in PHP. Inspired by the Lighthouse PHP project, in particular by embedded client that can be used for testing of Laravel-based GraphQL implementation of server.
composer require evilfreelancer/simplegqlient
Small example
require_once __DIR__ . '/../vendor/autoload.php'; $githubToken = 'xxx'; $client = new \SimpleGQLient\Client('https://api.github.com/graphql', [ 'Authorization' => 'Bearer ' . $githubToken, 'Accept' => 'application/vnd.github.hawkgirl-preview+json,', ]); $response = $client->graphQL(/** @lang GraphQL */ ' { user(login: "evilfreelancer") { repositories(ownerAffiliations: OWNER, isFork: false, first: 100) { nodes { name languages(first: 10, orderBy: { field: SIZE, direction: DESC }) { edges { size node { color name } } } } } } } '); // \Psr\Http\Message\ResponseInterface in response $output = $response->getBody()->getContents(); var_dump($output);
Roadmap
- Basic client
- Multipart support
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-02