Skip to main content
Version: 5.0

Changelog

5.0.0

Dependencies:

4.3.0

Breaking change:

  • The method setAnnotationCacheDir($directory) has been removed from the SchemaFactory. The annotation cache will use your Psr\SimpleCache\CacheInterface compliant cache handler set through the SchemaFactory constructor.

Minor changes:

  • Removed dependency for doctrine/cache and unified some of the cache layers following a PSR interface.
  • Cleaned up some of the documentation in an attempt to get things accurate with versioned releases.

4.2.0

Breaking change:

The method signature for toGraphQLOutputType and toGraphQLInputType have been changed to the following:

/**
* @param \ReflectionMethod|\ReflectionProperty $reflector
*/
public function toGraphQLOutputType(Type $type, ?OutputType $subType, $reflector, DocBlock $docBlockObj): OutputType;

/**
* @param \ReflectionMethod|\ReflectionProperty $reflector
*/
public function toGraphQLInputType(Type $type, ?InputType $subType, string $argumentName, $reflector, DocBlock $docBlockObj): InputType;

New features:

  • @Input 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.
  • New attributes has been added to @Field annotation: for, inputType and description.
  • The following annotations now can be applied to class properties directly: @Field, @Logged, @Right, @FailWith, @HideIfUnauthorized and @Security.

4.1.0

Breaking change:

There is one breaking change introduced in the minor version (this was important to allow PHP 8 compatibility).

  • The ecodev/graphql-upload package (used to get support for file uploads in GraphQL input types) is now a "recommended" dependency only. If you are using GraphQL file uploads, you need to add ecodev/graphql-upload to your composer.json.

New features:

  • All annotations can now be accessed as PHP 8 attributes
  • The @deprecated annotation in your PHP code translates into deprecated fields in your GraphQL schema
  • You can now specify the GraphQL name of the Enum types you define
  • Added the possibility to inject pure Webonyx objects in GraphQLite schema

Minor changes:

  • Migrated from zend/diactoros to laminas/diactoros
  • Making the annotation cache directory configurable

Miscellaneous:

  • Migrated from Travis to Github actions

4.0.0

This is a complete refactoring from 3.x. While existing annotations are kept compatible, the internals have completely changed.

New features:

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:

Internals:

  • The FieldsBuilder class has been split in many different services (FieldsBuilder, TypeHandler, and a chain of root type mappers)
  • The FieldsBuilderFactory class 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!