Download the PHP package mathsgod/light-graphql without Composer
On this page you can find all versions of the php package mathsgod/light-graphql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package light-graphql
Light GraphQL
A lightweight GraphQL server library for PHP 8.3+, built on top of thecodingmachine/graphqlite.
Requirements
- PHP 8.3+
Installation
Dependencies
| Package | Purpose |
|---|---|
thecodingmachine/graphqlite |
GraphQL schema generation via PHP attributes |
league/container |
Dependency injection container |
symfony/cache |
Schema caching |
ecodev/graphql-upload |
File upload support (multipart/form-data) |
laminas/laminas-diactoros |
PSR-7 HTTP request/response |
Usage
Define a Controller
Use #[Query] and #[Mutation] attributes from GraphQLite to define your GraphQL fields:
Execute a Query Directly
Handle a PSR-7 Request
Server implements Psr\Http\Server\RequestHandlerInterface and supports both application/json and multipart/form-data (file uploads):
Constructor Options
Debug Mode
When debug: true, error responses include the exception message and stack trace in the extensions field:
Error Responses
All responses follow the standard GraphQL error format and always return HTTP 200:
API
| Method | Description |
|---|---|
getSchemaFactory(): SchemaFactory |
Returns the GraphQLite SchemaFactory for adding namespaces |
getContainer(): ContainerInterface |
Returns the DI container |
getCache(): CacheInterface |
Returns the PSR-16 cache instance |
executeQuery(?string $query, array $variables, ?string $operationName): ExecutionResult |
Execute a GraphQL query directly |
handle(ServerRequestInterface $request): ResponseInterface |
Handle a PSR-7 HTTP request |
executeGraphQLRequest(ServerRequestInterface $request): ResponseInterface |
Process a pre-parsed PSR-7 request (used internally by handle()) |
All versions of light-graphql with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.3
league/container Version ^5.2
thecodingmachine/graphqlite Version ^8.0
symfony/cache Version ^7.4
mathsgod/graphqlite-mixed-type Version ^2.3
ecodev/graphql-upload Version ^8.0
laminas/laminas-diactoros Version ^3.5
league/container Version ^5.2
thecodingmachine/graphqlite Version ^8.0
symfony/cache Version ^7.4
mathsgod/graphqlite-mixed-type Version ^2.3
ecodev/graphql-upload Version ^8.0
laminas/laminas-diactoros Version ^3.5
The package mathsgod/light-graphql contains the following files
Loading the files please wait ...