commadore/graphql-qb
Composer 安装命令:
composer require commadore/graphql-qb
包简介
A php GraphQL Query Builder. Nice API. Readable queries.
README 文档
README
I have a use case where I need to mock this lib, so statics and traits aren't desirable
graphql-qb
A php GraphQL Query Builder. Nice API. Readable queries. Examples in Unit Tests.
Includes:
- Query / Mutation / Fragment
- Sorted Fields
- Mandatory Operation Object
- Add variables
- Add arguments
- Directives (Include / Skip)
- Sub query
TODO:
- Arguments in sub queries
<?php include_once 'vendor/autoload.php'; use Commadore\GraphQL\Operation; use Commadore\GraphQL\Query; $operation = new Operation(Query::KEYWORD, 'article'); $query1 = new Query('article', [ 'id' => 999, 'title' => 'Hello World', 'note' => 3.5, ], [ 'id', 'title', 'body', ]); $operation->fields(['article' => $query1]); echo $operation;
query article { article: article(id: 999, note: 3.5, title: "Hello World") { body id title } }
统计信息
- 总下载量: 3.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-04