hecht-a/graphql-orm
最新稳定版本:v1.0.0
Composer 安装命令:
composer require hecht-a/graphql-orm
包简介
GraphQL ORM for Symfony
关键字:
README 文档
README
GraphQL ORM is a lightweight GraphQL ORM for PHP/Symfony, inspired by concepts from Doctrine ORM.
It allows you to map PHP objects to a GraphQL API using attributes, and provides repositories, a query builder, automatic hydration, relation handling, schema validation, and deep Symfony integration.
Installation
composer require hecht-a/graphql-orm
Quick start
# config/packages/graphql_orm.yaml graphql_orm: endpoint: 'http://localhost:4000/graphql' mapping: entity: dir: '%kernel.project_dir%/src/GraphQL/Entity' namespace: App\GraphQL\Entity repository: dir: '%kernel.project_dir%/src/GraphQL/Repository' namespace: App\GraphQL\Repository
php bin/console graphqlorm:make:entity Task
$tasks = $taskRepository->findAll(); $tasks = $taskRepository->createQueryBuilder() ->select('id', 'title', 'user.name') ->where($qb->expr()->eq('status', 'active')) ->limit(10) ->getQuery() ->getResult();
Documentation
- Configuration
- Entity mapping
- Repositories
- Query Builder
- Pagination
- Dialects
- Schema validation
- Logging
- Profiler
- Hydration hooks —
#[BeforeHydrate],#[AfterHydrate] - Console commands
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-23