定制 ayimdomnic/graph-ql-l5.3 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ayimdomnic/graph-ql-l5.3

Composer 安装命令:

composer create-project ayimdomnic/graph-ql-l5.3

包简介

Facebook GraphQl for Laravel developers

README 文档

README

After the Developer Workshop in Nairobi, I have resolved to Move from Rest to GraphQL, This is a package to assit me with the same as I develop may laravel APIs

#Requirements

  1. PHP 5.6 and Above
  2. Laravel 5.3

#Instalation

  1. composer require ayimdomnic/graph-ql-l5.3
  2. add Ayimdomnic\GraphQl\GraphQlServiceProvider::class, to config/app
  3. add 'GraphQl' => 'Ayimdomnic\GraphQl\Helper\Facade\GraphQl', to the Facades
  4. publish php artisan vendor:publish

#Usage

#Creating a Query(#creating-a-query)

	namespace App\GraphQl\Type;
	
	use GraphQL\Type\Definition\Type;
	use Ayimdomnic\GraphQl\Helper\Type as GraphQLType;
    
    class UserType extends GraphQLType {
        
        protected $attributes = [
			'name' => 'User',
			'description' => 'A user'
		];
		
		public function fields()
		{
			return [
				'id' => [
					'type' => Type::nonNull(Type::string()),
					'description' => 'The id of the user'
				],
				'email' => [
					'type' => Type::string(),
					'description' => 'The email of user'
				]
			];
		}
			
			
		#########If you want to resolve the field yourself, you can declare a method
		###################with the following format resolve[FIELD_NAME]Field()
		protected function resolveEmailField($root, $args)
		{
			return strtolower($root->email);
		}
        
    }

Creating a Mutation

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固