All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Laravel pint.
- BREAKING: Require Laravel 11 and PHP 8.2.
- Handle empty schema extension config.
- Support extending schema using partial GraphQL schema files.
- Handle
Illuminate\Auth\Access\AuthorizationException
exceptions.
- BREAKING: Require Laravel 10 and PHP 8.1.
- BREAKING Fields that uses a resolver method are now exclusively resolved using that method. Previously, if a resolver method returned
null
, the library would continue to try and resolve the field using the built in array and object resolvers.
- Support for eloquent strictness.
- Cast backed enum to its value when return type is a "leaf" (enum or scalar).
- BREAKING: Support passing php Enums to resolvers.
- Support for backed enums.
- BREAKING: Require Laravel 9 and PHP 8.
- Handle
Symfony\Component\HttpKernel\Exception\HttpException
exceptions.
- The new
beforeExecutionHook
hook lets your GraphQL controller (using theHandlesGraphqlRequests
trait) inspect the schema and query before entering the execution phase.
- Upgrade graham-campbell/testbench@^5.6 because of breaking change in
GrahamCampbell\TestBench\AbstractPackageTestCase
.
- BREAKING: Strict check for expected value in
assertPromiseFulfills
. - BREAKING: Improved performance when using data loaders with a tailored implementation based on
amphp/amp
instead ofleinonen/php-dataloader
. See UPGRADE.md for details on how to upgrade.
- Support PHP 8
- In addition to
schemaPath()
it's now possible to override theschema()
method. This can be useful if your GraphQL schema needs to be fetched from some other source than a file on disk. #33
- BREAKING: Upgrade to webonyx/[email protected]. See https://github.com/webonyx/graphql-php/blob/v14.3.0/UPGRADE.md for breaking changes.
- Support Laravel 8.
AssertsPromises
trait, useful for testing data loaders.
- Custom implementation of
CacheMap
with improved keys to prevent excessive looping.
- Union support 🎉. Types are resolved using the same technique as for interfaces:
$source['__typename']
,$source->__typename
,Parent@resolveTypeForField()
(Query@resolveType
for queries and mutations) or class base name.
- Don't recursively convert Collection to array in DataLoader.
- Require PHP 7.2.5.
- Support Laravel 7.
- BREAKING: Removes leading slashes in the default namespace configuration to better support dependency injection with the laravel container. #24
- Support for shared data loaders when resolvers use the same underlying data.
- Support Laravel 6 🎉.
- When resolving
Boolean
values from arrays or objectsfalse
was incorrectly filtered out, resulting in anull
value instead.
- Interface support 🎉. Types are resolved using
$source['__typename']
,$source->__typename
,Parent@resolveTypeForField()
(Query@resolveType
for queries and mutations) or class base name.
- BREAKING: Upgrade to webonyx/[email protected] for improved performance and specification compliance. The
category
andvalidation
keys previously available next tomessage
in errors has now been moved to theextensions
part of errors as per the June 2018 GraphQL specification. - BREAKING: Support for various casing from source data. Previously Butler GraphQL assumed
snake_case
for source data attributes when resolving fields (to mimic the Eloquent standard). This has now been extended to supportsnake_case
,camelCase
andkebab-case
by default. To change this behaviour you can override thepropertyNames(ResolveInfo $info): array
method in your GraphQL controller. The oldpropertyName(ResolveInfo $info): string
method has been removed.
- Stop catching Exceptions in
HandlesGraphqlRequests->fieldFromResolver
to avoid intercepting Exceptions from the service container. - Pass
operationName
from the request toGraphQL::promiseToExecute
.
- Decorate the response with debug information when using barryvdh/laravel-debugbar.
- Upgrade webonyx/[email protected] for improved schema language support.
- The code in
HandlesGraphqlRequests->errorFormatter()
always assumed\Exception
from\GraphQL\Error\Error->getPrevious()
when it fact it returns\Throwable
. We now ensure that we always pass\Exception
toExceptionHandler->report()
.
- Use
base_path()
instead ofapp_path()
to ensure the default config works in Lumen.
- Handle reporting of GraphQL errors (invalid queries and schema validation errors).
- Implement error reporting of exceptions during requests.
This marks the release of Butler GraphQL v1.0.0, completely rewritten to make it easier than ever to create GraphQL APIs using Laravel.
- Simplified setup with auto-disovered service provider with easy-to-use conventions.
- Use a schema.graphql file to define your GraphQL API.
- Data Loader included to prevent N+1 issues.
- Add a status field to the output of all mutations.
- Initial release