NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #2524 most downloaded on Packagist
Write your GraphQL queries in simple to write controllers (using webonyx/graphql-php).
Latest stable
v8.4.0
Last release 12 days ago
09 Nov 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 35 of 35 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
35 releases · first in 2019
Drag across the ruler to compare, or tap a release to open it.
fix: Undefined array input type by @michael-georgiadis in #819
Full Changelog: v8.3.1...v8.4.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
#[EnumValue] now controls enum case exposure. Once any case of a #[Type]-mapped enum carries
#[EnumValue], the enum is in opt-in mode: only annotated cases are exposed and unannotated cases
are hidden from the schema (mirroring #[Field]'s opt-in model on classes). A fully-unannotated
mapped enum still exposes every case and emits a deprecation notice. Migration: any enum that
intentionally left some cases unannotated (for example, for docblock-only descriptions) must now
add #[EnumValue] to every case it wants exposed.getaway(), issue(), settings() or setup() (a
prefix followed by a lowercase letter) are no longer mis-stripped and keep their full name as the
field name. Migration: if a #[Field]/#[SourceField] method relied on the old behavior (for
example issue() exposing a field named sue), set an explicit field name with #[Field(name:)]
or the source field's name.#[Cost] text in
introspection and printed schemas changes from Cost: complexity = ... on its own line to the list item
- Cost: complexity = .... Migration: update anything that parses or snapshots field descriptions.
(#838) @oojacobooT|null|Undefined without a PHP default now resolves to Undefined::VALUE
instead of null, and no longer prints a = null default in the schema. A constructor parameter or
property without a PHP default gets Undefined::VALUE too, instead of being left unset, unless the
constructor already assigned the property. Migration: code that treated null as "not sent" for such
a field should compare against Undefined::VALUE.
(#838) @oojacoboo#[EnumValue] is now the per-case schema-exposure toggle, so internal enum cases can be kept out
of the public schema by omitting the attribute.
(#826)SchemaFactory::stripFieldPrefixes(getters:, setters:) configures the method-name prefixes
stripped to derive field names and matched when resolving property accessors. Adding has to the
getters exposes hassers such as hasStock() via #[SourceField]; the defaults (get/is, set)
preserve the previous behavior.
(#827, generalizing
#766) @oojacoboo @adynemo#[Security] rules
@oojacoboo, alongside the existing expression form, with access to the field context and custom
refusal messages.T|Undefined now say in their GraphQL description that they may be
omitted and whether null is accepted ("May be omitted; null is not accepted." or "May be omitted; null is
accepted."), since GraphQL types can't express it. Disable with
SchemaFactory::setUndefinedDescriptionsEnabled(false).
(#838) @oojacoboowithAddedDescriptionItem(). QueryFieldDescriptor::withAddedDescriptionLines() is deprecated in favor of
it.
(#838) @oojacoboophpdocumentor/reflection-docblock 6 and phpdocumentor/type-resolver 2 alongside 5 and 1, so GraphQLite
installs next to packages that already require them. Generic iterables such as \ArrayObject<int, User> map to
lists with both type-resolver versions. @timtheisingernull sent for an argument or input field typed T|Undefined (without null) is now
refused with a client error naming it, instead of failing with a TypeError.
(#838) @oojacoboo@param descriptions no longer
reach the schema when SchemaFactory::setDocblockDescriptionsEnabled(false) is set.
(#838) @oojacobooPsr15GraphQLMiddlewareBuilder::limitQueryComplexity() no longer turns invalid variables into a single joined
error without locations. GraphQLite now requires webonyx/graphql-php 15.38.3, whose QueryComplexity rule
reports each invalid variable with its own located error.
(#839) @oojacoboo#[Prefetch] field selected twice on the same object with different arguments (two aliases) no longer
returns the first alias's prefetch result for both. PrefetchBuffer stores results per source and argument
set; its result methods take the arguments and ResolveInfo as optional trailing parameters. @oojacoboochore: remove package-versions-deprecated dependency by @reydajp in #810
Full Changelog: v8.3.0...v8.3.1
Introduce Undefined::VALUE by @oprypkhantc in #764
Full Changelog: v8.2.0...v8.3.0
[doc] Fix typo in old Doctrine Annotation syntax by @cvergne in #787
description attribute (+ #[EnumValue]) + SchemaFactory docblock toggle by @oojacoboo in #793Full Changelog: v8.1.3...v8.2.0
fix: allow adding properties starting with 'set' by @supresys in #779
Full Changelog: v8.1.2...v8.1.3
Bump actions/setup-node from 4 to 5 by @dependabot [bot] in #759
Full Changelog: v8.1.1...v8.1.2
Allow callable() as field deferring mechanism by @oprypkhantc in #739
Full Changelog: v8.1.0...v8.1.1
Fix issue with kept deprecation reason by @jaapio in #735
While there shouldn't be any BC issues in this release, I've bumped to 8.1 since there is improved/full PHP 8.4 support included in this release.
Full Changelog: v8.0.0...v8.1.0
@sudevva made their first contribution in #702
devMode()) @oprypkhantc]Full Changelog: v7.0.0...v8.0.0
For all future changelog details, refer to the Releases. This CHANGELOG.md will no longer be independently maintained.
Thanks to @shish , @cvergne and @mshapovalov for updating the docs!
SchemaFactory::setClassNameMapper being renamed to SchemaFactory::setFinder. This now expects an instance of Kcs\ClassFinder\Finder\FinderInterface instead of Mouf\Composer\ClassNameMapper. @fogryesubscription operations. @oojacoboo@param annotations for generics support on field annotated constructor arguments. @oojacobooAdds support for Psr\Container 1.1 with #601
Adds support for Psr\Container 1.1 with #601
This is a very simple release. We support Doctrine annotation 1.x and we've deprecated SchemaFactory::setDoctrineAnnotationReader in favor of native P…
This is a very simple release. We support Doctrine annotation 1.x and we've deprecated SchemaFactory::setDoctrineAnnotationReader in favor of native PHP attributes.
Added support for new Void return types, allowing use of void from operation resolvers. #574
Void return types, allowing use of void from operation resolvers. #574Lots of little nuggets in this release! We're now targeting PHP ^8.1 and have testing on 8.2.
Lots of little nuggets in this release! We're now targeting PHP ^8.1 and have testing on 8.2.
A special thanks to @rusted-love and @oprypkhantc for their contributions.
A shoutout to @bladl for his work on this release, improving the code for better typing and PHP 8.0 syntax updates!
A shoutout to @bladl for his work on this release, improving the code for better typing and PHP 8.0 syntax updates!
https://github.com/thecodingmachine/graphqlite/pull/518 PSR-11 support now requires version 2
https://github.com/thecodingmachine/graphqlite/pull/508 Due to some of the code improvements, additional typing has been added to some interfaces/classes. For instance, RootTypeMapperInterface::toGraphQLOutputType and RootTypeMapperInterface::toGraphQLInputType now have the following signatures:
/**
* @param (OutputType&GraphQLType)|null $subType
*
* @return OutputType&GraphQLType
*/
public function toGraphQLOutputType(
Type $type,
OutputType|null $subType,
ReflectionMethod|ReflectionProperty $reflector,
DocBlock $docBlockObj
): OutputType;
/**
* @param (InputType&GraphQLType)|null $subType
*
* @return InputType&GraphQLType
*/
public function toGraphQLInputType(
Type $type,
InputType|null $subType,
string $argumentName,
ReflectionMethod|ReflectionProperty $reflector,
DocBlock $docBlockObj
): InputType;
https://github.com/thecodingmachine/graphqlite/pull/510 https://github.com/thecodingmachine/graphqlite/pull/508
Hurrah version 6 landing! There is a lot in this one and it's long overdue, but we finally hit a great spot, so without further adieu.
Hurrah version 6 landing! There is a lot in this one and it's long overdue, but we finally hit a great spot, so without further adieu.
Version 6 brings #[Input] defined InputTypes way forward and solidifies their overall functionality. #[Input] attribute defined InputTypes are becoming my preferred way of defining these types. One single DTO or even Doctrine entity (if you so dare!) can be used to define both input and output types, with virtually no side-effects or missing feature functionality. Prior to version 6, #[Input] defined types were rather limited. This is no longer the case! If you haven't had a chance yet, now is the time to give them a spin! 👍 A special thanks to @Lappihuan for all his teamwork on the InputType improvements. This wouldn't have happened without him!
In addition to the huge improvements made on InputTypes, we now have support for native Enums (shoutout to @dsavina), union return typing, and generics support!
https://github.com/thecodingmachine/graphqlite/pull/458 With Input annotated InputTypes, if you're using the same class for multiple types, like an update type and create type (also now a possibility), if you provide a name, you must also provide the default parameter if you want the InputType to be the "default".
#[Input] // Is default
#[Input(default: false)] // Not default
#[Input(name: 'SomethingInput', default: true] // Is default
#[Input(name: 'UpdateSomethingInput'] // Not default
#[Input] attributes.#[Field] defined functionality from output #[Type] objects to InputType annotated fields, via setters.This minor update adds support for Symfony 6 components
This minor update adds support for Symfony 6 components
Minor release to support missing properties for MagicFields with #402 and #405. Thanks @michael-vostrikov.
Minor release to support missing properties for MagicFields with #402 and #405. Thanks @michael-vostrikov.
https://github.com/thecodingmachine/graphqlite/pull/406 Updated doc regarding changing namespace in the Symfony Bundle
https://github.com/thecodingmachine/graphqlite/pull/406 Updated doc regarding changing namespace in the Symfony Bundle
- #283 Migrate to webonyx/graphql-php version 14.9 (@xyng and others) - #397 Fixed various broken docs links
This included a very large amount of documentation updates with a new website running on React
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.Bugfix: - #320 Missing PHP 8 Attribute on some annotations (@devmaslov)
Bugfix:
Bugfix release: - #318 Allowing installation of ocramius/package-versions ^2. This is needed to gain PHP 8 compatibility.
Bugfix release:
ocramius/package-versions ^2. This is needed to gain PHP 8 compatibility.There is one breaking change introduced in the minor version (this was important to allow PHP 8 compatibility).
A huge thanks to the many new contributors for this 4.1.0 release! @fezfez @MattBred @Kharhamel @flow-control @iganev @jensdenies @ezprit @ThibBal @gpupo @DanAtFh @mailopl @gulien @marhub This release is possible because of you all!
Breaking change:
There is one breaking change introduced in the minor version (this was important to allow PHP 8 compatibility).
ecodev/graphql-upload to your composer.json.New features:
@deprecated annotation in your PHP code translates into deprecated fields in your GraphQL schemaMinor changes:
zend/diactoros to laminas/diactorosMiscellaneous:
Update phpdocumentor/reflection-docblock requirement to also support ^5.0 (for Symfony compatibility) #262 https://github.com/thecodingmachine/graphql
Dependencies widening:
My bet is noone will be impacted. If you are impacted by this breaking change, please fill an issue to let me know.
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.
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.
Fixing "a class declared with a bad namespace causes a crash" #216 #217 @moufmouf In particular this fixes problems with the Symfony bundle if the mig
Bugfix release
Improvements:
This is a complete refactoring from 3.x. While existing annotations are kept compatible, the internals have completely changed.
This is a complete refactoring from 3.x. While existing annotations are kept compatible, the internals have completely changed.
New features:
@Type to make it a GraphQL interface@Autowire annotation@Assertion annotation@Security annotation. 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 type BlogPost only for post that the current user wrote.@InjectUser annotationTheCodingMachine\GraphQLite\Exceptions\GraphQLExceptionTheCodingMachine\GraphQLite\Exceptions\GraphQLAggregateException@Factory annotations)@UseInputType(for="$id", inputType="ID!")@Decorate annotationMany extension points have been added
New framework specific features:
Symfony:
Laravel:
Internals:
FieldsBuilder class has been split in many different services (FieldsBuilder, TypeHandler, and a
chain of root type mappers)FieldsBuilderFactory class has been completely removed.Improvements: - #294 Forward default value to Graphql Schema (@flow-control )
Improvements:
Upgrade dependencies: - #275 Allow for wider dependencies on phpdocumentor/reflection-docblock (@flow-control )
Upgrade dependencies:
Upgrade dependencies - #273 Allow for wider dependencies on php-documentor/type-resolver (@flow-control )
Upgrade dependencies
Making GraphQLite compatible with PHP 7.4 with no deprecations #147 #150 #153 . Thanks @JensArctiq
Improvements:
The ClassNameMapper can now be injected #149 @flow-control
New feature:
ClassNameMapper can now be injected #149 @flow-controlLooking for annotations only in public methods #128
Improvement:
GraphQLite is PHP library that allows you to write your GraphQL queries in simple-to-write controllers.
GraphQLite is PHP library that allows you to write your GraphQL queries in simple-to-write controllers.
After several months of work, we are very happy to announce the availability of GraphQLite v3.0.
If you are wondering where are v1 and v2... yeah... GraphQLite is a fork of "thecodingmachine/graphql-controllers" that already had a v1 and a v2. But so much has changed that it deserved a new name!
First, declare a query in your controller:
class ProductController
{
/**
* @Query()
*/
public function product(string $id): Product
{
// Some code that looks for a product and returns it.
}
}
Then, annotate the Product class to declare what fields are exposed to the GraphQL API:
/**
* @Type()
*/
class Product
{
/**
* @Field()
*/
public function getName(): string
{
return $this->name;
}
// ...
}
That's it, you're good to go :tada:! Query and enjoy!
{
product(id: 42) {
name
}
}
One column per quarter.