Skip to content

Releases: graphql-java/graphql-java

Release 4.0

29 Aug 07:10
Compare
Choose a tag to compare

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 DataFetchers 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 DataFetchers 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.

#590 #380 #542 #487:

  • ExecutionStrategy has been refactored by several PRs but it affects only custom strategies.
    Main changes are cleaned up parameters and support of CompletableFuture.

#550:

  • ExecutionStrategy.handleDataFetchingException is removed: Instead a delegate DataFetcherExceptionHandler is used to handle Exceptions.

#211 #456 :

  • An explicit root Object is added which is available to DataFetchers and is the source for the first level DataFetcher. Before that context 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 the DataFetcher) with no key in it and providing the null literal results in a Java null 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

19 May 19:23
Compare
Choose a tag to compare

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:
    The TypeResolver Interface was changed from getType(Object object) to getType(TypeResolutionEnvironment environment). The object previously directly passed is now available as TypeResolutionEnvironment.getObject().

  • #398: GraphQLSchema:
    GraphQLSchema.getDictionary() was renamed to getAdditonalTypes()

  • #400: Type References:
    GraphQLObject.reference(), GraphQLInterfaceType.reference() and GraphQLInputObjectType.reference() has been removed: Instead instantiate a new GraphQLTypeReference().

  • #401 FieldCollector:
    The FieldCollector 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

06 Apr 07:53
Compare
Choose a tag to compare

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

23 Dec 16:22
Compare
Choose a tag to compare

Release highlights

This release also includes a test improvement (#196) and documentation fix (#246).

Big thanks to all contributors!

Release 2.2.0

28 Oct 16:47
Compare
Choose a tag to compare

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

06 Sep 16:38
Compare
Choose a tag to compare

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

21 Feb 06:33
Compare
Choose a tag to compare

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

24 Oct 08:45
Compare
Choose a tag to compare

mainly bugfixes and a first very basic relay support

Full Implementation of the current GraphQL spec

29 Jul 18:19
Compare
Choose a tag to compare

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

v1.0

18 Jul 15:52
Compare
Choose a tag to compare

This is the first release of graphql-java.