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.
Informations about the package light-graphql
Light GraphQL
Light GraphQL is a lightweight GraphQL server implementation designed for simplicity and ease of use. This project demonstrates how to set up a basic GraphQL server using PHP.
This library is built using several dependencies, including thecodingmachine/graphqlite
, which provides annotations and tools for creating GraphQL APIs in PHP. Other key dependencies include:
- league/container: A lightweight dependency injection container.
- symfony/cache: A caching library for optimizing performance.
These libraries work together to provide a robust and flexible foundation for building GraphQL servers.
Installation
Key Components
- Schema Factory: The schema is dynamically created using the
SchemaFactory
provided by theLight\GraphQL\Server
. It allows adding namespaces for controllers. -
Controllers: The
Controllers
namespace is used to define resolvers for GraphQL queries. - GraphQL Execution: The
Server::executeQuery
method is used to execute the GraphQL query against the schema. In the provided example, the query$query
is executed, and the result is converted to an array usingtoArray()
.
Usage Example
ServerRequestInterface handling
use Controllers\RootController;
use GraphQL\GraphQL;
$server = new \Light\GraphQL\Server();
$server->getSchemaFactory()->addNamespace("Controllers");
$response=$server->handle($request);
All versions of light-graphql with dependencies
league/container Version ^4.2
thecodingmachine/graphqlite Version ^8.0
symfony/cache Version ^6.4
mathsgod/graphqlite-mixed-type Version ^2.3
ecodev/graphql-upload Version ^7.0
laminas/laminas-diactoros Version ^3.5