overblog/graphql-php-generator
Composer 安装命令:
composer require overblog/graphql-php-generator
包简介
GraphQL types generator
关键字:
README 文档
README
GraphQL PHP types generator...
Installation
composer require overblog/graphql-php-generator
Usage
<?php $loader = require __DIR__.'/vendor/autoload.php'; use GraphQL\Schema; use Overblog\GraphQLGenerator\Generator\TypeGenerator; use Symfony\Component\ExpressionLanguage\Expression; $configs = [ 'Character' => [ 'type' => 'interface', 'config' => [ 'description' => new Expression('\'A character\' ~ \' in the Star Wars Trilogy\''), 'fields' => [ 'id' => ['type' => 'String!', 'description' => 'The id of the character.'], 'name' => ['type' => 'String', 'description' => 'The name of the character.'], 'friends' => ['type' => '[Character]', 'description' => 'The friends of the character.'], 'appearsIn' => ['type' => '[Episode]', 'description' => 'Which movies they appear in.'], ], 'resolveType' => 'Overblog\\GraphQLGenerator\\Tests\\Resolver::resolveType', ], ], /*...*/ 'Query' => [ 'type' => 'object', 'config' => [ 'description' => 'A humanoid creature in the Star Wars universe or a faction in the Star Wars saga.', 'fields' => [ 'hero' => [ 'type' => 'Character', 'args' => [ 'episode' => [ 'type' => 'Episode', 'description' => 'If omitted, returns the hero of the whole saga. If provided, returns the hero of that particular episode.', ], ], 'resolve' => ['Overblog\\GraphQLGenerator\\Tests\\Resolver', 'getHero'], ], ], ], /*...*/ ], ]; $typeGenerator = new TypeGenerator('\\My\\Schema\\NP'); $classesMap = $typeGenerator->generateClasses($configs, __DIR__ . '/cache/types'); $loader->addClassMap($classesMap); $schema = new Schema(\My\Schema\NP\QueryType::getInstance());
overblog/graphql-php-generator 适用场景与选型建议
overblog/graphql-php-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 524.76k 次下载、GitHub Stars 达 29, 最近一次更新时间为 2016 年 04 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「generator」 「type」 「graphql」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 overblog/graphql-php-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 overblog/graphql-php-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 overblog/graphql-php-generator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
A bundle providing fields for image upload with jquery upload and image cropping with jcrop for symfony2
A simple Symfony bundle that adds boolean form field type.
GraphQL authentication for your headless Craft CMS applications.
A PHP Abstract Enum Class
This package provides type-safe extension of the laravel collection, forcing a single type of object.
统计信息
- 总下载量: 524.76k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 31
- 点击次数: 11
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-26