api-skeletons / zf-doctrine-graphql
GraphQL for Doctrine using Hydrators
Installs: 12 316
Dependents: 0
Suggesters: 0
Security: 0
Stars: 37
Watchers: 5
Forks: 3
Open Issues: 1
Requires
- api-skeletons/zf-doctrine-criteria: ^1.0
- doctrine/collections: ^1.5
- doctrine/common: ^2.8
- doctrine/doctrine-orm-module: ^1.1.8
- doctrine/instantiator: ^1.1
- phpro/zf-doctrine-hydration-module: ^3.0
- webonyx/graphql-php: ^0.12.0
- zendframework/zend-config: ^3.2
- zendframework/zend-hydrator: ^2.4
- zendframework/zend-modulemanager: ^2.8
- zendframework/zend-mvc-console: ^1.2
- zfcampus/zf-doctrine-querybuilder: ^1.7
Requires (Dev)
- api-skeletons/coding-standard: ^1.0
- dprevite/lint: dev-master
- php-coveralls/php-coveralls: ^2.1
- phpstan/phpstan-doctrine: ^0.10
- phpunit/phpunit: ^7.1
- zendframework/zend-test: ^3.2
README
This library uses Doctrine native traversal of related objects to provide full GraphQL querying of entities and all related fields and entities. Entity metadata is introspected and is therefore Doctrine data driver agnostic. Data is collected with hydrators thereby allowing full control over each field using hydrator filters, strategies and naming strategies. Multiple object managers are supported. Multiple hydrator configurations are supported. Works with GraphiQL.
A range of filters are provided to filter collections at any location in the query.
Doctrine provides easy taversal of your database. Consider the following imaginary query:
$entity[where id = 5] ->getRelation() ->getField1() ->getField2() ->getManyToOne([where name like '%dev%']) ->getName() ->getField3() ->getOtherRelation() ->getField4() ->getField5()
And see it realized in GraphQL with fine grained control over each field via hydrators:
{ entity (filter: { id: 5 }) { relation { field1 field2 manyToOne (filter: { name_contains: 'dev' }) { name field3 } } otherRelation { field4 field5 } } }