An open API service indexing awesome lists of open source software.

https://github.com/thecodingmachine/graphqlite-bundle

A Symfony bundle for thecodingmachine/graphqlite.
https://github.com/thecodingmachine/graphqlite-bundle

Last synced: 21 days ago
JSON representation

A Symfony bundle for thecodingmachine/graphqlite.

Awesome Lists containing this project

README

          

[![Latest Stable Version](https://poser.pugx.org/thecodingmachine/graphqlite-bundle/v/stable)](https://packagist.org/packages/thecodingmachine/graphqlite-bundle)
[![License](https://poser.pugx.org/thecodingmachine/graphqlite-bundle/license)](https://packagist.org/packages/thecodingmachine/graphqlite-bundle)
[![Build Status](https://github.com/thecodingmachine/graphqlite-bundle/actions/workflows/test.yaml/badge.svg)](https://github.com/thecodingmachine/graphqlite-bundle/actions/workflows/test.yaml/badge.svg)

# GraphQLite bundle

Symfony bundle for the `thecodingmachine/graphqlite` package.
It discovers your annotated controllers and types, builds the schema, exposes the `/graphql` endpoint through a PSR-7
bridge (with optional upload handling), and keeps the Symfony request available as the GraphQL context.

Part of the bundle docs: https://graphqlite.thecodingmachine.io/docs/symfony-bundle

See [thecodingmachine/graphqlite](https://github.com/thecodingmachine/graphqlite).

## Requirements

- PHP 8.1+
- Supports:
- Symfony 6.4/7.0/8.0
- GraphQLite ^8

## Installation

```bash
composer require thecodingmachine/graphqlite-bundle
```

Ensure the bundle is enabled (Symfony Flex does this automatically via `config/bundles.php` after `composer require`).

### Configure routes

Import the bundle routes to expose `/graphql`:

```yaml
# config/routes/graphqlite.yaml
graphqlite_bundle:
resource: '@GraphQLiteBundle/Resources/config/routes.php'
```

### Configure namespaces

Tell GraphQLite where to look for controllers and types:

```yaml
# config/packages/graphqlite.yaml
graphqlite:
namespace:
controllers: App\\GraphQL\\Controller
types:
- App\\GraphQL\\Type
- App\\Entity
```

## Quickstart

Create a controller with GraphQLite attributes:

```php