Download the PHP package xaddax/webonyx-psr15-middleware without Composer
On this page you can find all versions of the php package xaddax/webonyx-psr15-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package webonyx-psr15-middleware
PSR-15 GraphQL Middleware
A framework-agnostic PSR-15 middleware for handling GraphQL requests using webonyx/graphql-php.
Features
- PSR-15 compliant middleware
- Framework agnostic
- Schema caching support
- Request preprocessing capabilities
- Flexible response handling
- Operation-specific resolvers with dependency injection support
- Resolver documentation
Documentation
- Configuration
- Request Preprocessing
- Response Handling
- Resolvers
Installation
Requirements
- PHP 8.3+
- PSR-7 implementation (e.g., nyholm/psr7)
- PSR-17 HTTP factories implementation
- PSR-6 cache implementation (optional, e.g., symfony/cache)
Basic Usage
Schema Generation
The library includes support for generating schemas from .graphql files:
Framework Integration
Slim 4
Mezzio
Laravel
Request Preprocessing
You can add authentication/authorization by implementing the RequestPreprocessorInterface:
Development
Code Quality
The project uses PHP_CodeSniffer for coding standards and PHPStan for static analysis.
To check coding standards:
To automatically fix coding standards:
To run static analysis:
To run all checks (coding standards, static analysis, and tests):
Testing
To run the test suite:
Examples
Check the examples/ directory for complete working examples with different frameworks:
examples/slim/- Slim 4 integrationexamples/mezzio/- Mezzio integrationexamples/laravel/- Laravel integration
License
MIT License. See LICENSE file for details.
==========================
To use the middleware in Laminas Mezzio, configure the factories
in config/autoload/dependencies.global.php
Add configuration in config/autoload/graphql.global.php
see the WebOnyx Server Configuration Documentation for the full options for the server config.
You'll need to set up the route. In config/routes.php
Schema Definition Language
You can also use a Schema Definition Language as discussed in the webonyx documentation.
In config/autoload/graphql.global.php change the schema in the serverConfig to generatedSchema
Then inside of the graphQL config add the generatedSchema configuration
See the documentation for
parserOptions
The cached data is stored in data/cache/graphql.
All versions of webonyx-psr15-middleware with dependencies
ext-mbstring Version *
composer-plugin-api Version ^2.0
psr/cache Version ^3.0
psr/container Version ^2.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
psr/http-server-middleware Version ^1.0
psr/log Version ^3.0
webonyx/graphql-php Version ^15.0.0