Releases: thecodingmachine/graphqlite
Releases · thecodingmachine/graphqlite
v3.1.4
v3.1.3
v3.1.2
v4.0.3
v4.0.2
Bugfix release
Warning! This release contains a (minor) BC break about the name given to enum types.
Given the fact that enum types where almost non functionals in v4.0.1,
and given the fact it is unlikely they have been used until now, I'm exceptionnaly introducing
this BC break to introduce Enum types that are behaving in a more consistent way. See #235 for details.
- #227 #233 Fixed "enum failed to work (most of the time) as output parameters"
- #235 #232 Changed the way enums are named in the schema
Note: I do not have a clear visibility of the usage of this feature in the wild since the release of 4.0 a few weeks ago. My bet is noone will be impacted. If you are impacted by this breaking change, please fill an issue to let me know.
v4.0.1
v4.0.0
This is a complete refactoring from 3.x. While existing annotations are kept compatible, the internals have completely
changed.
New features:
- You can directly annotate a PHP interface with
@Typeto make it a GraphQL interface - You can autowire services in resolvers, thanks to the new
@Autowireannotation - Added user input validation (using the Symfony Validator or the Laravel validator or a custom
@Assertionannotation - Improved security handling:
- Unauthorized access to fields can now generate GraphQL errors (rather that schema errors in GraphQLite v3)
- Added fine-grained security using the
@Securityannotation. A field can now be marked accessible or not depending on the context.
For instance, you can restrict access to the field "viewsCount" of the typeBlogPostonly for post that the current user wrote. - You can now inject the current logged user in any query / mutation / field using the
@InjectUserannotation
- Performance:
- You can inject the Webonyx query plan in a parameter from a resolver
- You can use the dataloader pattern to improve performance drastically via the "prefetchMethod" attribute
- Customizable error handling has been added:
- You can throw GraphQL errors with
TheCodingMachine\GraphQLite\Exceptions\GraphQLException - You can specify the HTTP response code to send with a given error, and the errors "extensions" section
- You can throw many errors in one exception with
TheCodingMachine\GraphQLite\Exceptions\GraphQLAggregateException
- You can throw GraphQL errors with
- You can map a given PHP class to several PHP input types (a PHP class can have several
@Factoryannotations) - You can force input types using
@UseInputType(for="$id", inputType="ID!") - You can extend an input types (just like you could extend an output type in v3) using the new
@Decorateannotation - In a factory, you can exclude some optional parameters from the GraphQL schema
Many extension points have been added
- Added a "root type mapper" (useful to map scalar types to PHP types or to add custom annotations related to resolvers)
- Added "field middlewares" (useful to add middleware that modify the way GraphQL fields are handled)- Added a "parameter type mapper" (useful to add customize parameter resolution or add custom annotations related to parameters)
New framework specific features:
Symfony:
- The Symfony bundle now provides a "login" and a "logout" mutation (and also a "me" query)
Laravel:
- Native integration with the Laravel paginator has been added
Internals:
- The
FieldsBuilderclass has been split in many different services (FieldsBuilder,TypeHandler, and a
chain of root type mappers) - The
FieldsBuilderFactoryclass has been completely removed. - 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
than 3.x. Try it out!