定制 joskfg/graphql-bulk-resolver 二次开发

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

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

joskfg/graphql-bulk-resolver

Composer 安装命令:

composer require joskfg/graphql-bulk-resolver

包简介

GraphQL Bulk Resolver

README 文档

README

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

Trait to avoid N+1 problem in GraphQL when using the webonyx/graphql-php or any wrapper. It is based in the Deferred resolvers that provide the library and allow you to work with them in an easy way.

Documentation

The trait split the resolver in two parts, fetch and pluck.

Fetch

This part receive all the root objects in one array, so you can process all of them in one shoot and return all the data in the best way to be processed in the pluck.

Pluck

The method receives all the data processed and the root that is requesting the info, so it should search inside the data processed and return the specific data.

You must implement the resolver using the DeferredResolverInterface and use the trait in the resolver type like this:

'resolve' => $this->deferredResolve(new MyResolver());

You can see an article about the package at https://medium.com/@JoseCardona/solving-graphql-n-1-in-php-92ed9161dd7b

Testing

joskfg/graphql-bulk-resolver has a PHPUnit test suite and a coding style compliance test suite using PHP CS Fixer.

To run the tests, run the following command from the project folder.

$ docker-compose run test

To run interactively using PsySH:

$ docker-compose run psysh

License

The MIT license. Please see LICENSE for more information.

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固