Download the PHP package player259/graphql-bundle without Composer
On this page you can find all versions of the php package player259/graphql-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download player259/graphql-bundle
More information about player259/graphql-bundle
Files in player259/graphql-bundle
Package graphql-bundle
Short Description Lightweight Symfony GraphQL bundle over webonyx/graphql-php with DI and autowiring
License MIT
Informations about the package graphql-bundle
Player259GraphQLBundle
About
The Player259GraphQLBundle integrates webonyx/graphql-php library into symfony applications.
Features
- Types-as-services with Dependency Injection
- Controller-like resolvers with Autowiring
- Type definition and resolvers in the same class, see Basic usage
- No extra configuration files
- No static calls
- Native webonyx/graphql-php type system with all its features and great documentation
- Integrated Type Registry
- Possible Code splitting for Query and Mutation types
- Simplified Deferred resolving with integrated buffer
Installation
The Player259GraphQLBundle requires PHP 7.1+ and Symfony 4.4+.
You can install the bundle using Symfony Flex:
$ composer require player259/graphql-bundle
If you're not using Flex, then add the bundle to your config/bundles.php
:
Import routing file:
Or assign endpoint to specific url:
By default bundle registers /graphql
endpoint.
Configuration
Default configuration in config/packages/player259_graphql.yaml
.
With debug
option set to true
response errors will contain debugMessage
and trace
.
logger
parameter is a service name to log exceptions.
If it's prefixed with ?
it will not throw exception if no such service exists.
Example
To create your first GraphQL API (with default Symfony 5 installation and no configuration):
- Create class which extends webonyx
ObjectType
with nameQuery
- Add at least one field and resolver
- Make a request to
/graphql
url
Documentation
Usage examples can be found in documentation.
Not yet implemented
Pass execution rules, disabling introspection, query depth and complexity.
Dispatching events to override server parameters such as promiseAdapter, error formatters and handlers.
Allow to merge non-root types to get more flexibility.
Maybe custom type config property resolveMethod
to call specific method or another service.
Another option is annotations, something like @GraphQL\Resolve("App\GraphQL\QueryType", "users")
so it could be attached to any service with public method.
There will be no autowiring but it can be useful in some cases.
License
Released under the MIT License, see LICENSE.
All versions of graphql-bundle with dependencies
ext-json Version *
nyholm/psr7 Version ^1.2
psr/log Version ^1|^2
symfony/config Version ^4.4|^5.0
symfony/dependency-injection Version ^4.4|^5.0
symfony/http-kernel Version ^4.4|^5.0
symfony/property-access Version ^4.4|^5.0
symfony/psr-http-message-bridge Version ^2.0
webonyx/graphql-php Version ^0.12.6|^0.13.0|^14.0