|
| 1 | +--- |
| 2 | +id: changelog |
| 3 | +title: Changelog |
| 4 | +sidebar_label: Changelog |
| 5 | +--- |
| 6 | + |
| 7 | +## 5.0.0 |
| 8 | + |
| 9 | +#### Dependencies: |
| 10 | + |
| 11 | +- Upgraded to using version 14.9 of [webonyx/graphql-php](https://github.com/webonyx/graphql-php) |
| 12 | + |
| 13 | +## 4.3.0 |
| 14 | + |
| 15 | +#### Breaking change: |
| 16 | + |
| 17 | +- The method `setAnnotationCacheDir($directory)` has been removed from the `SchemaFactory`. The annotation |
| 18 | + cache will use your `Psr\SimpleCache\CacheInterface` compliant cache handler set through the `SchemaFactory` |
| 19 | + constructor. |
| 20 | + |
| 21 | +#### Minor changes: |
| 22 | + |
| 23 | +- Removed dependency for doctrine/cache and unified some of the cache layers following a PSR interface. |
| 24 | +- Cleaned up some of the documentation in an attempt to get things accurate with versioned releases. |
| 25 | + |
| 26 | +## 4.2.0 |
| 27 | + |
| 28 | +#### Breaking change: |
| 29 | + |
| 30 | +The method signature for `toGraphQLOutputType` and `toGraphQLInputType` have been changed to the following: |
| 31 | + |
| 32 | +```php |
| 33 | +/** |
| 34 | + * @param \ReflectionMethod|\ReflectionProperty $reflector |
| 35 | + */ |
| 36 | +public function toGraphQLOutputType(Type $type, ?OutputType $subType, $reflector, DocBlock $docBlockObj): OutputType; |
| 37 | + |
| 38 | +/** |
| 39 | + * @param \ReflectionMethod|\ReflectionProperty $reflector |
| 40 | + */ |
| 41 | +public function toGraphQLInputType(Type $type, ?InputType $subType, string $argumentName, $reflector, DocBlock $docBlockObj): InputType; |
| 42 | +``` |
| 43 | + |
| 44 | +#### New features: |
| 45 | + |
| 46 | +- [@Input](annotations-reference.md#input-annotation) annotation is introduced as an alternative to `@Factory`. Now GraphQL input type can be created in the same manner as `@Type` in combination with `@Field` - [example](input-types.mdx#input-attribute). |
| 47 | +- New attributes has been added to [@Field](annotations-reference.md#field-annotation) annotation: `for`, `inputType` and `description`. |
| 48 | +- The following annotations now can be applied to class properties directly: `@Field`, `@Logged`, `@Right`, `@FailWith`, `@HideIfUnauthorized` and `@Security`. |
| 49 | + |
| 50 | +## 4.1.0 |
| 51 | + |
| 52 | +#### Breaking change: |
| 53 | + |
| 54 | +There is one breaking change introduced in the minor version (this was important to allow PHP 8 compatibility). |
| 55 | + |
| 56 | +- The **ecodev/graphql-upload** package (used to get support for file uploads in GraphQL input types) is now a "recommended" dependency only. |
| 57 | + If you are using GraphQL file uploads, you need to add `ecodev/graphql-upload` to your `composer.json`. |
| 58 | + |
| 59 | +#### New features: |
| 60 | + |
| 61 | +- All annotations can now be accessed as PHP 8 attributes |
| 62 | +- The `@deprecated` annotation in your PHP code translates into deprecated fields in your GraphQL schema |
| 63 | +- You can now specify the GraphQL name of the Enum types you define |
| 64 | +- Added the possibility to inject pure Webonyx objects in GraphQLite schema |
| 65 | + |
| 66 | +#### Minor changes: |
| 67 | + |
| 68 | +- Migrated from `zend/diactoros` to `laminas/diactoros` |
| 69 | +- Making the annotation cache directory configurable |
| 70 | + |
| 71 | +#### Miscellaneous: |
| 72 | + |
| 73 | +- Migrated from Travis to Github actions |
| 74 | + |
| 75 | + |
| 76 | +## 4.0.0 |
| 77 | + |
| 78 | +This is a complete refactoring from 3.x. While existing annotations are kept compatible, the internals have completely |
| 79 | +changed. |
| 80 | + |
| 81 | +#### New features: |
| 82 | + |
| 83 | +- You can directly [annotate a PHP interface with `@Type` to make it a GraphQL interface](inheritance-interfaces.mdx#mapping-interfaces) |
| 84 | +- You can autowire services in resolvers, thanks to the new `@Autowire` annotation |
| 85 | +- Added [user input validation](validation.mdx) (using the Symfony Validator or the Laravel validator or a custom `@Assertion` annotation |
| 86 | +- Improved security handling: |
| 87 | + - Unauthorized access to fields can now generate GraphQL errors (rather that schema errors in GraphQLite v3) |
| 88 | + - Added fine-grained security using the `@Security` annotation. A field can now be [marked accessible or not depending on the context](fine-grained-security.mdx). |
| 89 | + For instance, you can restrict access to the field "viewsCount" of the type `BlogPost` only for post that the current user wrote. |
| 90 | + - You can now inject the current logged user in any query / mutation / field using the `@InjectUser` annotation |
| 91 | +- Performance: |
| 92 | + - You can inject the [Webonyx query plan in a parameter from a resolver](query-plan.mdx) |
| 93 | + - You can use the [dataloader pattern to improve performance drastically via the "prefetchMethod" attribute](prefetch-method.mdx) |
| 94 | +- Customizable error handling has been added: |
| 95 | + - You can throw [many errors in one exception](error-handling.mdx#many-errors-for-one-exception) with `TheCodingMachine\GraphQLite\Exceptions\GraphQLAggregateException` |
| 96 | +- You can force input types using `@UseInputType(for="$id", inputType="ID!")` |
| 97 | +- You can extend an input types (just like you could extend an output type in v3) using [the new `@Decorate` annotation](extend-input-type.mdx) |
| 98 | +- In a factory, you can [exclude some optional parameters from the GraphQL schema](input-types#ignoring-some-parameters) |
| 99 | + |
| 100 | + |
| 101 | +Many extension points have been added |
| 102 | + |
| 103 | +- Added a "root type mapper" (useful to map scalar types to PHP types or to add custom annotations related to resolvers) |
| 104 | +- Added ["field middlewares"](field-middlewares.md) (useful to add middleware that modify the way GraphQL fields are handled) |
| 105 | +- Added a ["parameter type mapper"](argument-resolving.md) (useful to add customize parameter resolution or add custom annotations related to parameters) |
| 106 | + |
| 107 | +New framework specific features: |
| 108 | + |
| 109 | +#### Symfony: |
| 110 | + |
| 111 | +- The Symfony bundle now provides a "login" and a "logout" mutation (and also a "me" query) |
| 112 | + |
| 113 | +#### Laravel: |
| 114 | + |
| 115 | +- [Native integration with the Laravel paginator](laravel-package-advanced.mdx#support-for-pagination) has been added |
| 116 | + |
| 117 | +#### Internals: |
| 118 | + |
| 119 | +- The `FieldsBuilder` class has been split in many different services (`FieldsBuilder`, `TypeHandler`, and a |
| 120 | + chain of *root type mappers*) |
| 121 | +- The `FieldsBuilderFactory` class has been completely removed. |
| 122 | +- Overall, there is not much in common internally between 4.x and 3.x. 4.x is much more flexible with many more hook points |
| 123 | + than 3.x. Try it out! |
0 commit comments