Releases: graphql-java/graphql-java
Release 4.0
Note: 4.2 is the newest 4.x version
Thanks a lot to all contributors for reporting bugs, giving feedback, fixing bugs, adding new features and more!
Major New features:
#590
This is the biggest enhancement to come to graphql-java in a long time. Query execution is now performed in a fully asynchronous manner. A DataFetcher
is now able to return a CompletionStage<Object>
background promise to data and the graphql-java engine will ensure that when it completes it will be placed into the correct place in the query results.
This allows you to use facilities like java 8's CompletableFuture.supplyAsync()
to run many data fetchers in parallel, which should improve the speed of your system by fully utilizing all your available CPUs.
All of the provided ExecutionStrategy
implementations now support fully asynchronous results. Note if you have your own derived ExecutionStrategy
then the method signatures have been modified and are described below in the breaking changes section.
#577
New TracingInstrumentation
has been added that tracks how long each field takes to execute. This is reported back on the ExecutionResult
extensions field and gives you insight into how you graphql-java server is performing.
This tracing support follows the proposed Apollo Tracing specification https://github.com/apollographql/apollo-tracing which can then be viewed via their Optics performance monitoring tooling : https://www.apollodata.com/optics/
#641
You can now control the visibility of selected fields in the schema. A GraphqlFieldVisibility
implementation can be attached to a schema that decide on what fields will be made visible to queries and introspection. This allows you to say restrict the view of the schema for different classes of users say.
#625
java.util.Optional
is now supported as a return value from data fetchers and will be collapsed into either an object or the null value in graphql terms.
#618 #575 #560
Instrumentation
was enhanced significantly to with an extra method when an ExecutionStrategy
is entered and exited. It also allows you to intercept DataFetcher
s and results and hence inject new behaviour into the running system.
#616
The error messages for argument validation have been improved and better tells you went wrong and in more detail.
#650
You can now store extra meta data on GraphqlError
objects that can be sent back to your client code
#552
The ExecutionResult
object now has a toSpecification()
method that gives you back and object that 100% complies with the graphql specification.
#449
There is now "path" support when running queries. Errors contain the path to which field was in error in a structured specified by the graphql specification and DataFetcher
s also get this path information.
#467 #470 #468
Schema IDL has been improved. Any additional types defined in schema IDL are now included into the build GraphqSchema
object as expected, deprecation is now supported via IDL files and the build runtime type objects contain the original AST definitions.
List of breaking changes:
#593:
- The
Instrumentation
callback is now one method (with two parameters) instead of two methods.
ExecutionStrategy
has been refactored by several PRs but it affects only custom strategies.
Main changes are cleaned up parameters and support ofCompletableFuture
.
#550:
ExecutionStrategy.handleDataFetchingException
is removed: Instead a delegateDataFetcherExceptionHandler
is used to handle Exceptions.
-
An explicit
root
Object is added which is available to DataFetchers and is thesource
for the first levelDataFetcher
. Before thatcontext
was used for that purpose. Note:GraphQL.execute(String query, Object context)
is still compatible to avoid unexpected bugs. -
The arguments objects for the
Instrumentation
are renamed to make them more clear: E.g.DataFetchParameters
->InstrumentationDataFetchParameters
#455:
- The overall scalar error logic was changed a bit. See this PR for details.
#427:
- By supporting the
null
literal the result of not providing an argument to a field was changed: not providing an arguments results in a arguments Map (for theDataFetcher
) with no key in it and providing thenull
literal results in a Javanull
values.
#660:
- removes the deprecated methods for the Relay support.
Full List of changes:
See here for the full list of all changes.
Release 3.0.0
This is our biggest release yet, with exciting new features, but also with breaking changes.
A big thanks to all contributors! A lot of them are not directly mentioned here, but every comment or Issue makes this project better.
The most fundamental change is that graphql-java
requires now Java 8. Java 6 or Java 7 is no longer supported. (#359)
The biggest new feature is that we now offer a second way to define a schema (#386).
Breaking Changes
-
#395: TypeResolver:
TheTypeResolver
Interface was changed fromgetType(Object object)
togetType(TypeResolutionEnvironment environment)
. The object previously directly passed is now available asTypeResolutionEnvironment.getObject()
. -
#398: GraphQLSchema:
GraphQLSchema.getDictionary()
was renamed togetAdditonalTypes()
-
#400: Type References:
GraphQLObject.reference()
,GraphQLInterfaceType.reference()
andGraphQLInputObjectType.reference()
has been removed: Instead instantiate anew GraphQLTypeReference()
. -
#401 FieldCollector:
TheFieldCollector
class is now clearly marked as an internal class and was changed. It is very unlikely that you used this class. If you did: please open an Issue to adress your use case.
Changes:
- #353 fix null error handling (by @bbakerman)
- #359 Change to Java 8
- #358 Support for user defined subscription type (by @vaant)
- #360 type param and misc. for relay types (by @jimexist)
- #368 TypeReferences resolved for interfaces and unions (by @kaqqao)
- #361 use java 8 base64 features (by @jimexist)
- #370 retain comments in the parsed document (by @bbakerman)
- #371 link a runtime object back to its possible definition (by @bbakerman)
- #378 too many tokens are allowed as valid (by @bbakerman)
- #386 Adds the ability to compile and build executable schemas (by @bbakerman)
- #387 Allow ExecutionStrategy to specify dataFetchingExceptionHandler (by @corydolphin)
- #388 ast printer support (by @bbakerman)
- #391 Fix handling of UnknownFragment (by @corydolphin )
- #392 Add fragment definitions and execution id to DataFetchingEnvironment (by @apottere)
- #395 Improved TypeResolver (by @kaqqao)
- #401 have the ability to know and capture all fields in a data fetcher (by @bbakerman)
- #411 make it more clear what internal vs public API is
- #418 do not overwrite top level schema definition during type registry merge (by @kaseyreed)
- #422 Add environment to field instrumentation. (by @apottere)
- #429 Improve wrong type exception (by @dh94)
Release 2.4.0
Changes:
- #149 PropertyDataFetcher supports AutoValue style classes by @iancw
- #249 Passing input object as a resolved class doesn't work by @yrashk
- #261 GraphQL Java should use generics where possible by @bbakerman
- #266 Allow customized Relay cursor prefix by @jimexist
- #267 Extract relay classes to interfaces and implementations by @jimexist
- #270 Add instrumentation to the execution of the graphql query by @bbakerman
- #273 GraphQL object should use Builder pattern like the schema objects by @bbakerman
- #276 Use builder pattern in GraphQL top level object by @bbakerman
- #279 Add unique query idenitifer by @bbakerman
- #287 Spec allows for 'extensions' map in result but graphql-java does not by @sean-brandt
- #293 Allows an ExecutionProvider to be provided by the caller by @bbakerman
- #301 DataFetchingEnvironment as an interface by @bbakerman
- #311 More fluent description of the schema by @bbakerman
- #315 Lenient numerical scalars by @bbakerman
- #318 Coercing should be Coercing<I, O> by @dminkovsky
- #322 Validation for lone anonymous operation by @exbe
- #323 Validate name field matches current spec's conventions by @deruf
- #326, #327 Increasing test coverage by @delki8
- #341 PropertyDataFetcherTest throwing exception by @goodav
- #347 Make property and field data fetcher generic by @bbakerman
- #349 Mutations are optional and errors should come back if they are missing by @bbakerman
- #354 Get message returns the error's message rather then toString() by @guy120494
Big thanks to all contributors!
Info: This is last release supporting Java 6. The next release will require Java 8 and will probably contain other breaking changes. (Version 3)
Release 2.3.0
Release highlights
- #172 Allow TypeReference as InputType with check for non-circular references by @kaqqao
- #225 Removed ANTLR compile dependency from POM by @IamCornholio (with help from @foragerr)
- #238 4. parses as FloatValue by @pcarrier
- #156 ValuesResolver fixes for input object literals and variable values by @trevor-morris
- #244 Support for integer-valued ID fields @dminkovsky (reported by @Warbit)
- #190 Directive argument name check against directive instead of field by @p-guldbaek-elsevier
- #263 Make execution context thread safe by @bbakerman
- #243 Initial take on adding GraphQL Schema parsing by @brimworks
- #274 Fixed directive introspection by @trevor-morris
- #275 Fixed type conditionals in grammar by @trevor-morris
- #277 Ensure that keywords can be used as names by @dminkovsky
- #240 Allow specification of mutation strategy
This release also includes a test improvement (#196) and documentation fix (#246).
Big thanks to all contributors!
Release 2.2.0
Release highlights
- #159 Simplify schema definition interface by @IamCornholio
- #213 Fix bug in grammar by @dminkovsky
- #222 Fix stack overflow during validation by @herojan
- #217 Allow serialization of any Iterable as a GraphQLList by @iancw and @adw45
This release also includes code cleanup (#201, #234, #216) and documentation (#228).
Release 2.1.0
Release highlights
- #123 "Recursive types not being resolved" from alexkrebiehl
- #187 "Added introspection query to codebase" from aschrijver
- #164 "Adds support for Boolean property accessors with 'get' prefix in PropertyDataFetcher" from ayhanap
- #168 "Parse escaped characters in strings" from ntkoopman
- #161 "Remove generated antlr code. Add build task dependency" from IamCornholio
- #178 "Add overload of GraphQLEnumType.Builder.value() with deprecationReason" from aschrijver
- #151 "Make BatchedExecutionStrategy return values in consistent order" from arlampin
- #145 "Ensure build with Java 6 runtime" from andimarek
- #140 "Adding scalars for BigInteger, BigDecimal, Byte, Short, Char" from danielkwinsor
- #136 "Support for directive.locations in introspection query" from aschrijver
- #127 "ExecutionContextBuilder bug fix" from dminkovsky
- #129 "Union types must have at least 1 member, and members can be only of Object types, not scalars" from danielkwinsor
- #99 "Throwable instead of Exception" from okorz001
- #103 "PropertyDataFetcher can fetch fields" from tuukka
- #113 "Support parsing IntValue literals into GraphQLFloat" from Macroz
- #102 "Fail on redefinitions" from tuukka
This release also includes code cleanup (#191, #185, #141, #121, #117, #120), documentation (#119, #158, #131) and test improvements (#133).
Release 2.0.0
This is version 2.0.0 of graphql-java:
- Beginning with this version (2.0.0) graphql-java follows Semantic Versioning
- It is Java 1.6. compatible instead Java 1.7 (thanks @pt-achang)
- There is a Batched Execution Strategy for better performance (thanks @cardinalraven)
GraphQLFloat
was changed to return Java double values instead of Java float values in order to comply with the spec.- Smaller bugfixes, improvements and refactorings
Thanks a lot to all contributors, who created a PR/Issue!
Release 1.3
mainly bugfixes and a first very basic relay support
Full Implementation of the current GraphQL spec
This release contains:
- Som minor breaking changes to comply with the spec (for example some renaming in the
ExecutionResults
) - the groupId is now
com.graphql-java
to comply with maven-central requirements - Bugfixes
- Improved Error Messages and more validations
- a lot of internal improvements and refactorings