8000 GitHub - zartata/doctrine-graphql: Doctrine ORM to GraphQL bridge
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

zartata/doctrine-graphql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doctrine-graphql

Build Status Documentation Status

Doctrine ORM to PHP GraphQL bridge.

How it works

This library provides a DoctrineGraphQL builder class to build all Doctrine entities as GraphQL types by following a naming convention.

For every entity class mapped to GraphQL object type it will create basic GraphQL Query and Mutations.

Installation

composer require ncrypthic/doctrine-graphql

Usage

use LLA\DoctrineGraphQL\DoctrineGraphQL;
use GraphQL\Server\Helper;
use GraphQL\Server\ServerConfig;

/* @var EntityManager $em */
// Get Doctrine's entity manager

$builder = new DoctrineGraphQL();
$builder
    ->buildTypes($em)
    ->buildQueries($em)
    ->buildMutations($em);
    
$schema = $builder->toGraphQLSchema();
$config = ServerConfig::create(['schema'=>$schema]);

$helper = new Helper();
$req = $helper->parseHttpRequest();

$res = is_array($req)
  ? $helper->executeBatch($config, $req)
  : $helper->executeOperation($config, $req);

Queries

See Queries

Mutations

See Mutations

About

Doctrine ORM to GraphQL bridge

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%
0