Download the PHP package phps-cans/psr7-middleware-graphql without Composer
On this page you can find all versions of the php package phps-cans/psr7-middleware-graphql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phps-cans/psr7-middleware-graphql
More information about phps-cans/psr7-middleware-graphql
Files in phps-cans/psr7-middleware-graphql
Package psr7-middleware-graphql
Short Description This package contains a PSR-15 middleware to handle GraphQL requests
License MIT
Homepage https://github.com/phps-cans/psr7-middleware-graphql
Informations about the package psr7-middleware-graphql
PSR 15 compliant middleware to handle graphql
This package is currently under development. This package use the official package of graphql's integration to handle Graphql Request.
This middleware is executed if the content-type
of the request is application/graphql
or if the configured URL is reached (by default it is /graphql)
This middleware use the StandardServer
to handle request. It is free to you to create the schema and the server.
This middleware expect that JSON has already been decoded (by example with Psr7Middlewares\Middleware\Payload
)
Easy use:
To be able to use this package easily we recommend you to use:
This way, the zend-stratigility server is ready to use, JSON body are automatically parsed, middleware are piped, the StandardServer and Schema are automatically created.
Using ServiceProvider
We recommend to use stratigility-harmony to automatically configure your stratigility's server.
This package provide a ServiceProvider by default (src/ServiceProvider/DefaultServiceProvider.php). It expect the StandardServer
to be registered in the container under the name GraphQL\Server\StandardServer
. If you use Middleware List, it update the queue using the constant MiddlewareOrder::ROUTER_EARLY
.
using any http-interop compilant Middleware pipe
This example is based on zend-stratigility middleware pipe:
Feel free to report any issues.
TODO
- Write unit testing
- Allow formmating errors
All versions of psr7-middleware-graphql with dependencies
ext-json Version *
psr/http-message Version ^1
psr/http-server-handler Version ^1
psr/http-server-middleware Version ^1
psr/http-factory Version ^1
webonyx/graphql-php Version ^0.13