graphqlite

Use PHP Annotations to declare your GraphQL API

Github星跟蹤圖


A library that allows you to write your GraphQL queries in simple-to-write controllers.

Features

  • Create a complete GraphQL API by simply annotating your PHP classes
  • Framework agnostic, but Symfony bundle available!
  • Comes with batteries included :battery:: queries, mutations, mapping of arrays / iterators, file uploads, extendable types and more!

Basic example

First, declare a query in your controller:

class ProductController
{
    /**
     * @Query()
     */
    public function product(string $id): Product
    {
        // Some code that looks for a product and returns it.
    }
}

Then, annotate the Product class to declare what fields are exposed to the GraphQL API:

/**
 * @Type()
 */
class Product
{
    /**
     * @Field()
     */
    public function getName(): string
    {
        return $this->name;
    }
    // ...
}

That's it, you're good to go :tada:! Query and enjoy!

{
  product(id: 42) {
    name
  }
}

Want to learn more? Head to the documentation!

Badges

Latest Stable Version
Total Downloads
Latest Unstable Version
License
Scrutinizer Code Quality
Build Status
Coverage Status

主要指標

概覽
名稱與所有者thecodingmachine/graphqlite
主編程語言MDX
編程語言PHP (語言數: 5)
平台
許可證MIT License
所有者活动
創建於2019-01-29 13:09:22
推送於2025-06-07 01:03:50
最后一次提交2025-06-06 17:43:09
發布數29
最新版本名稱v8.1.0 (發布於 2025-06-06 21:02:50)
第一版名稱v3.0.0 (發布於 )
用户参与
星數561
關注者數18
派生數101
提交數1.2k
已啟用問題?
問題數257
打開的問題數29
拉請求數380
打開的拉請求數0
關閉的拉請求數70
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?