All Projects → overblog → Graphqlphpgenerator

overblog / Graphqlphpgenerator

Licence: mit
GraphQL PHP types generator...

Projects that are alternatives of or similar to Graphqlphpgenerator

Booben
Web app constructor based on React, with GraphQL bindings
Stars: ✭ 96 (+284%)
Mutual labels:  graphql, generator
Catalyst
Typescript NodeJS Microservices Boilerplate with Generator CLI - Moleculer, GraphQL, REST, OAuth2, Jaeger, Grafana, Prometheus, Ory Hydra, Ory Keto w/ Access Control middleware, Moleculer-DB GraphQL mixin, Pug, Redis, sibling client repo (login, persistance layer, react-native-web, ios, android)
Stars: ✭ 30 (+20%)
Mutual labels:  graphql, generator
Generators
API Generator - instantly generate REST and GraphQL APIs (openapi (OAS) 3.0.0)
Stars: ✭ 213 (+752%)
Mutual labels:  graphql, generator
Laravel Graphql
GraphQL implementation with power of Laravel
Stars: ✭ 56 (+124%)
Mutual labels:  graphql, generator
Typegraphql Prisma
Prisma 2 generator to emit TypeGraphQL types and CRUD resolvers from your Prisma 2 schema
Stars: ✭ 137 (+448%)
Mutual labels:  graphql, generator
Project Webcube
Continuously updated JS infrastructure for modern web dev
Stars: ✭ 141 (+464%)
Mutual labels:  graphql, generator
Graphback
Graphback - Out of the box GraphQL server and client
Stars: ✭ 323 (+1192%)
Mutual labels:  graphql, generator
Api
Stars: ✭ 18 (-28%)
Mutual labels:  graphql
Td Angular Barcode
Barcode Generator for Angular 1 (Supports 90+ barcode types: qr, aztec, code128, ean, isbn, interleaved2of5, ...)
Stars: ✭ 22 (-12%)
Mutual labels:  generator
Strawberry
A new GraphQL library for Python 🍓
Stars: ✭ 891 (+3464%)
Mutual labels:  graphql
Go Envparser
a go generator based env to go-struct decoder.
Stars: ✭ 17 (-32%)
Mutual labels:  generator
Grpc Gateway Generator
A script to generate a ready to use grpc-gateway with swagger, by just providing the path to the protos and a simple configuration file.
Stars: ✭ 18 (-28%)
Mutual labels:  generator
Swapi Graphql
A GraphQL schema and server wrapping SWAPI.
Stars: ✭ 921 (+3584%)
Mutual labels:  graphql
React Hasura Todo
A react todo app using Hasura Graphql engine
Stars: ✭ 18 (-28%)
Mutual labels:  graphql
E2e Ts Gql Workshop
End-to-end Type-Safe GraphQL Workshop
Stars: ✭ 24 (-4%)
Mutual labels:  graphql
Diversidad Media
Diversidad Media is a platform to generate more diverse spaces, through Movies, Books, Music, and others. The project is in fast growth and there are many things to do. We are still covering the basics.
Stars: ✭ 17 (-32%)
Mutual labels:  graphql
Agots
Anomaly Generator on Time Series
Stars: ✭ 24 (-4%)
Mutual labels:  generator
Generator Modular Angular
A truly modular yeoman generator for AngularJS all device apps.
Stars: ✭ 23 (-8%)
Mutual labels:  generator
Graphql Mst
Convert GraphQL to mobx-state-tree models
Stars: ✭ 22 (-12%)
Mutual labels:  graphql
Swapi Graphql Lambda
A GraphQL schema hosted in AWS Lambda wrapping http://swapi.co/
Stars: ✭ 19 (-24%)
Mutual labels:  graphql

OverblogGraphQLPhpGenerator

GraphQL PHP types generator...

Code Coverage Build Status

Requirements

PHP >= 5.4

Installation

composer require overblog/graphql-php-generator

Usage

<?php
$loader = require __DIR__.'/vendor/autoload.php';

use GraphQL\Schema;
use Overblog\GraphQLGenerator\Generator\TypeGenerator;
use Symfony\Component\ExpressionLanguage\Expression;

$configs = [
    'Character' => [
        'type' => 'interface',
        'config' => [
            'description' => new Expression('\'A character\' ~ \' in the Star Wars Trilogy\''),
            'fields' => [
                'id' => ['type' => 'String!', 'description' => 'The id of the character.'],
                'name' => ['type' => 'String', 'description' => 'The name of the character.'],
                'friends' => ['type' => '[Character]', 'description' => 'The friends of the character.'],
                'appearsIn' => ['type' => '[Episode]', 'description' => 'Which movies they appear in.'],
            ],
            'resolveType' => 'Overblog\\GraphQLGenerator\\Tests\\Resolver::resolveType',
        ],
    ],
    /*...*/
    'Query' => [
        'type' => 'object',
        'config' => [
            'description' => 'A humanoid creature in the Star Wars universe or a faction in the Star Wars saga.',
            'fields' => [
                'hero' => [
                    'type' => 'Character',
                    'args' => [
                        'episode' => [
                            'type' => 'Episode',
                            'description' => 'If omitted, returns the hero of the whole saga. If provided, returns the hero of that particular episode.',
                        ],
                    ],
                    'resolve' => ['Overblog\\GraphQLGenerator\\Tests\\Resolver', 'getHero'],
                ],
            ],
        ],
        /*...*/
    ],
];

$typeGenerator = new TypeGenerator('\\My\\Schema\\NP');
$classesMap = $typeGenerator->generateClasses($configs, __DIR__ . '/cache/types');

$loader->addClassMap($classesMap);

$schema = new Schema(\My\Schema\NP\QueryType::getInstance());
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].