efabrica/nette-graphql

Nette implementation of efabrica/graphql package.

0.2.7 2024-07-19 13:44 UTC

This package is auto-updated.

Last update: 2024-11-19 14:41:42 UTC


README

This package is implementation of efabrica/graphql and generates GraphQL schema from nette database explorer.

Installation

Via composer

composer require efabrica/nette-graphql

Usage

Configuration

# config.neon

extensions:
    graphql: Efabrica\GraphQL\Nette\Bridge\DI\NetteGraphQLExtension
    
services:
    - Symfony\Component\String\Inflector\EnglishInflector

    graphql.schemaLoader:
        setup:
            - #...

    graphql.resolverFactory:
        setup:
            - #...

Loader options

Resolver options

Query execution

$input = json_decode(file_get_contents('php://input'), true);
$response = $graphQL->executeQuery($input['query']);