andi-lab/graphql-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

andi-lab/graphql-php

最新稳定版本:1.0.1

Composer 安装命令:

composer require andi-lab/graphql-php

包简介

GraphQL library for PHP

README 文档

README

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status Code Coverage Psalm Level

GraphQL library

The GraphQL library for PHP allows you to define a GraphQL API using attributes, interfaces, and prepared abstract classes.

Features

Key features of the library include:

  • framework agnostic, currently integrated with SpiralFramework on RoadRunner;
  • support code first & schema first principles, which can simultaneously complement each other;
  • extending via middleware layers.

Simple Example

use Andi\GraphQL\Attribute\Argument;
use Andi\GraphQL\Attribute\MutationField;
use Andi\GraphQL\Attribute\QueryField;

final class SimpleController
{
    #[QueryField(name: 'echo')]
    #[MutationField(name: 'echo')]
    public function echoMessage(#[Argument] string $message): string
    {
        return 'echo: ' . $message;
    }
}

This example shows how easy it is to define Query & Mutation. At the same time, the library provides full control when defining a GraphQL schema: custom types, required fields, default values, and much more.

Documentation

Documentation is currently available in:

Examples

The library includes examples of defining a GraphQL schema. All definitions mentioned in the documentation are present in the examples in one form or another.

License

See LICENSE

Community

Telegram group: GraphQL library for PHP

Roadmap

  • release 1.0
    • documentation of the development of middleware layers, with an example
    • documentation and example of connecting the ecodev/graphql-upload library for uploading files
    • support multiple schemas for andi-lab/graphql-php-spiral
  • release 1.1
    • mockup types and fields
  • other release
    • inputs validate
    • integration with Apollo Federation

统计信息

  • 总下载量: 1.68k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-11