{"id":29543183,"url":"https://github.com/api-skeletons/doctrine-orm-graphql","last_synced_at":"2026-05-04T01:05:43.692Z","repository":{"id":200257309,"uuid":"705400410","full_name":"API-Skeletons/doctrine-orm-graphql","owner":"API-Skeletons","description":"GraphQL Type Driver for Doctrine ORM","archived":false,"fork":false,"pushed_at":"2026-04-05T19:09:06.000Z","size":2079,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"13.0.x","last_synced_at":"2026-04-05T21:30:20.328Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/API-Skeletons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-15T22:53:35.000Z","updated_at":"2026-04-05T19:08:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4052e8f-b656-4d8c-8336-d63807e399c9","html_url":"https://github.com/API-Skeletons/doctrine-orm-graphql","commit_stats":null,"previous_names":["api-skeletons/doctrine-orm-graphql"],"tags_count":65,"template":false,"template_full_name":null,"purl":"pkg:github/API-Skeletons/doctrine-orm-graphql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/API-Skeletons%2Fdoctrine-orm-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/API-Skeletons%2Fdoctrine-orm-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/API-Skeletons%2Fdoctrine-orm-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/API-Skeletons%2Fdoctrine-orm-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/API-Skeletons","download_url":"https://codeload.github.com/API-Skeletons/doctrine-orm-graphql/tar.gz/refs/heads/13.0.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/API-Skeletons%2Fdoctrine-orm-graphql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32245151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-17T13:08:44.106Z","updated_at":"2026-04-25T00:02:08.373Z","avatar_url":"https://github.com/API-Skeletons.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://placehold.co/10x10/337ab7/337ab7.png\" width=\"100%\" height=\"15px\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/api-skeletons/doctrine-orm-graphql/master/docs/banner.png\" width=\"450px\"\u003e\n\u003c/p\u003e\n\n\nGraphQL Type Driver for Doctrine ORM\n====================================\n\n[![Build Status](https://github.com/API-Skeletons/doctrine-orm-graphql/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/API-Skeletons/doctrine-orm-graphql/actions/workflows/continuous-integration.yml?query=branch%3Amain)\n[![Code Coverage](https://codecov.io/gh/API-Skeletons/doctrine-orm-graphql/branch/main/graphs/badge.svg)](https://codecov.io/gh/API-Skeletons/doctrine-orm-graphql/branch/main)\n[![PHPStan](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg)](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg)\n[![psalm](https://img.shields.io/badge/psalm-level%201-brightgreen.svg)](https://img.shields.io/badge/psalm-level%201-brightgreen.svg)\n[![License](https://poser.pugx.org/api-skeletons/doctrine-orm-graphql/license)](//packagist.org/packages/api-skeletons/doctrine-orm-graphql)\n\n    GraphQL, with types so neat,\n    Felt a longing, a database heat.\n    \"I'd love,\" it would sigh,\n    \"To be SQL, oh my!\n    With relations and joins, oh so sweet!\"\n\nThis library provides a GraphQL driver for Doctrine ORM for use with the [webonyx/graphql-php](https://github.com/webonyx/graphql-php) library.  \nIt **does not** try to redefine how that excellent library operates.  Instead, it creates types to be used \nwithin the framework that library provides.\n\nMany other GraphQL libraries for Doctrine ORM are available.  \nSome of these such as [overblog/graphql-bundle](https://github.com/overblog/GraphQLBundle/tree/master)\nand [API Platform](https://api-platform.com/) are integrations into frameworks.  But all of these libraries\nuse the same underlying library, [webonyx/graphql-php](https://github.com/webonyx/graphql-php) and that library\nhas its own way of doing things.  This library is a driver for that library and together they are framework agnostic.\n\n\nInstallation\n------------\n\nVia composer:\n\n```bash\ncomposer require api-skeletons/doctrine-orm-graphql\n```\n\n\nDocumentation\n-------------\n\nFull documentation is available at https://doctrine-orm-graphql.apiskeletons.dev or in the [docs](https://github.com/api-skeletons/doctrine-orm-graphql/blob/master/docs) directory.\n\n\nFeatures\n--------\n\n* Supports all [Doctrine Types](https://doctrine-orm-graphql.apiskeletons.dev/en/latest/types.html#data-type-mappings) and allows custom types\n* Pagination with the [GraphQL Complete Connection Model](https://graphql.org/learn/pagination/#complete-connection-model)\n* [Filtering of sub-collections](https://doctrine-orm-graphql.apiskeletons.dev/en/latest/queries.html)\n* [Events](https://github.com/API-Skeletons/doctrine-orm-graphql#events) for modifying queries, entity types and more\n* [Multiple configuration group support](https://doctrine-orm-graphql.apiskeletons.dev/en/latest/driver.html#group)\n\n\nTechnical Features\n------------------\n\n* Attribute-based metadata\n* PHP 8.4 Lazy Ghost Objects for deferred type initialization\n* PSR-14 Event-Driven Architecture for query and type customization\n* Custom PSR-11 Container with lazy initialization and buildable types\n* Advanced hydration system with Doctrine Laminas Hydrator and extraction strategies\n* Dynamic QueryBuilder generation with filter translation and event-driven query modification\n  to solve N+1 query problems\n\n\nExamples\n--------\n\nThe **LDOG Stack**: Laravel, Doctrine ORM, and GraphQL uses this library:  https://ldog.apiskeletons.dev\n\nFor an working implementation see https://graphql.lcdb.org\n\n\nQuick Start\n-----------\n\nAdd attributes to your Doctrine entities or see [globalEnable](https://doctrine-orm-graphql.apiskeletons.dev/en/latest/driver.html#globalenable) for all entities in your schema without attribute configuration.\n\n```php\nuse ApiSkeletons\\Doctrine\\ORM\\GraphQL\\Attribute as GraphQL;\n\n#[GraphQL\\Entity]\nclass Artist\n{\n    #[GraphQL\\Field]\n    public $id;\n\n    #[GraphQL\\Field]\n    public $name;\n\n    #[GraphQL\\Association]\n    public $performances;\n}\n\n#[GraphQL\\Entity]\nclass Performance\n{\n    #[GraphQL\\Field]\n    public $id;\n\n    #[GraphQL\\Field]\n    public $venue;\n\n    /**\n     * Not all fields need attributes.\n     * Only add attribues to fields you want available in GraphQL\n     */\n    public $city;\n}\n```\n\nCreate the driver and GraphQL schema\n\n```php\nuse ApiSkeletons\\Doctrine\\ORM\\GraphQL\\Driver;\nuse Doctrine\\ORM\\EntityManager;\nuse GraphQL\\Type\\Definition\\ObjectType;\nuse GraphQL\\Type\\Definition\\Type;\nuse GraphQL\\Type\\Schema;\n\n$driver = new Driver($entityManager);\n\n$schema = new Schema([\n    'query' =\u003e new ObjectType([\n        'name' =\u003e 'query',\n        'fields' =\u003e [\n            'artists' =\u003e $driver-\u003ecompleteConnection(Artist::class),\n        ],\n    ]),\n    'mutation' =\u003e new ObjectType([\n        'name' =\u003e 'mutation',\n        'fields' =\u003e [\n            'artistUpdateName' =\u003e [\n                'type' =\u003e $driver-\u003etype(Artist::class),\n                'args' =\u003e [\n                    'id' =\u003e Type::nonNull(Type::id()),\n                    'input' =\u003e Type::nonNull($driver-\u003einput(Artist::class, ['name'])),\n                ],\n                'resolve' =\u003e function ($root, $args) use ($driver): Artist {\n                    $artist = $driver-\u003eget(EntityManager::class)\n                        -\u003egetRepository(Artist::class)\n                        -\u003efind($args['id']);\n\n                    $artist-\u003esetName($args['input']['name']);\n                    $driver-\u003eget(EntityManager::class)-\u003eflush();\n\n                    return $artist;\n                },\n            ],\n        ],\n    ]),\n]);\n```\n\nRun GraphQL queries\n\n```php\nuse GraphQL\\GraphQL;\n\n$query = '{\n  artists {\n    edges {\n      node {\n        id\n        name\n        performances {\n          edges {\n            node {\n              venue\n            }\n          }\n        }\n      }\n    }\n  }\n}';\n\n$result = GraphQL::executeQuery(\n    schema: $schema,\n    source: $query,\n    variableValues: null,\n    operationName: null\n);\n\n$output = $result-\u003etoArray();\n```\n\nRun GraphQL mutations\n\n```php\nuse GraphQL\\GraphQL;\n\n$query = '\n  mutation ArtistUpdateName($id: Int!, $name: String!) {\n    artistUpdateName(id: $id, input: { name: $name }) {\n      id\n      name\n    }\n  }\n';\n\n$result = GraphQL::executeQuery(\n    schema: $schema,\n    source: $query,\n    variableValues: [\n        'id' =\u003e 1,\n        'name' =\u003e 'newName',\n    ],\n    operationName: 'ArtistUpdateName'\n);\n\n$output = $result-\u003etoArray();\n```\n\n\nFilters\n-------\n\nFor every enabled field and association, filters are available for querying.\n\nExample\n\n```gql\n{\n  artists (\n    filter: {\n      name: {\n        contains: \"Dead\"\n      }\n    }\n  ) {\n    edges {\n      node {\n        id\n        name\n        performances (\n          filter: {\n            venue: {\n              eq: \"The Fillmore\"\n            }\n          }\n        ) {\n          edges {\n            node {\n              venue\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nEach field has their own set of filters.  Based on the field type, some or all of the following filters are available:\n\n* eq - Equals.\n* neq - Not equals.\n* lt - Less than.\n* lte - Less than or equal to.\n* gt - Greater than.\n* gte - Greater than or equal to.\n* isnull - Is null.  If value is true, the field must be null.  If value is false, the field must not be null.\n* between - Between.  Identical to using gte \u0026 lte on the same field.  Give values as `low, high`.\n* in - Exists within an array.\n* notin - Does not exist within an array.\n* startwith - A like query with a wildcard on the right side of the value.\n* endswith - A like query with a wildcard on the left side of the value.\n* contains - A like query.\n* sort \u0026 sortPriority - Sort the results by a field.  Use sortPriority to sort by multiple fields.\n\nYou may [exclude any filter](https://doctrine-orm-graphql.apiskeletons.dev/en/latest/attributes.html#entity) from any entity, association, or globally.\n\n\nHistory\n-------\n\nThe roots of this project go back to May 2018 with https://github.com/API-Skeletons/zf-doctrine-graphql; written for \nZend Framework 2.  It was migrated to the framework agnostic \nhttps://packagist.org/packages/api-skeletons/doctrine-graphql but the name of that repository was incorrect \nbecause it did not specify ORM only.  So this repository was created and the others were abandoned.\n\nThis was written for the [Live Concert Database](https://lcdb.org)\n\nLicense\n-------\n\nSee [LICENSE](https://github.com/api-skeletons/doctrine-orm-graphql/blob/master/LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapi-skeletons%2Fdoctrine-orm-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapi-skeletons%2Fdoctrine-orm-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapi-skeletons%2Fdoctrine-orm-graphql/lists"}