graphql-java

GraphQL Java implementation

MIT License

Stars
6K
Committers
258

Bot releases are visible (Hide)

graphql-java - 17.2

Published by andimarek about 3 years ago

This is a bugfix release which contains the following changes:

https://github.com/graphql-java/graphql-java/milestone/36?closed=1

graphql-java - 17.1

Published by bbakerman about 3 years ago

Upgrade to DataLoader 3.1.0

This release upgrade the DataLoader library to 3.1.0 which adds the ability to have an external value cache in place during data loader batch calls.

You can use it to model access to external caches like REDIS amd even do batch "cache gets".

graphql-java - 17.0

Published by bbakerman about 3 years ago

We are happy to announce v17.0 of graphql-java

https://github.com/graphql-java/graphql-java/milestone/31?closed=1

@deprecated supported on input fields

In line with coming graphql spec changes, the @deprecated annotation can now be placed on input fields and not just output fields as before.

https://github.com/graphql-java/graphql-java/pull/2186

Dramatic performance improvements in GraphQLSchema building

The GraphQLSchema is a graph of types and as such has to be built according to strict rules. The previous code would repeated visit and rebuilt the schema and this meant that large schemes could be slow to build.

This code has been extensively benchmarked and improved. For example on a very large and complex schema, total build time went from 3.5 seconds to 1.2 seconds.

Thank you to teams out there that used https://github.com/graphql-java/graphql-anonymizer to submit in real life schemas that we can test with.

Dramatic performance improvements in DataFetchingFieldSelectionSet

The classes that underlie the DataFetchingFieldSelectionSet code have been been remodelled to be dramatically more performant. Before interfaces could create an exponential explosion in objects created. This has been fixed which in turn improves the performance of this code as scale.

Dramatic performance improvements in large query validation

The graphql spec calls for overlapping fields in fragments to be validated in a certain way. The previous code followed the specs psudeo-algorithm correctly but it leads to asymptotic performance problems.

This has been rewritten via https://github.com/graphql-java/graphql-java/pull/2495 based on this article https://tech.xing.com/graphql-overlapping-fields-can-be-merged-fast-ea6e92e0a01 which dramatically improves how fast large queries can validated.

Support of directives on fields and types during introspection

#2221 this is a non spec feature which lets you expose directives through Introspection

Reworked default value validation and improved Scalar coercion

#2325 This is a relatively big change which fixed up how default values are processed. Before that default values were never validated and custom Scalars could cause invalid values printed in SDL or Introspection. This PR includes a new Scalar coercion function valueToLiteral which is needed to implement this correct behaviour.

Better Unicode support in documents

https://github.com/graphql-java/graphql-java/pull/2404 allows for better Unicode expression in queries and SDL documents

GraphQLContext is now the approved context mechanism

https://github.com/graphql-java/graphql-java/pull/2368 allows for a well known API for context within a graphql request. Previously any opaque object could be used and framework could was not able to make any assumptions about adding their own context properties

The old mechanism has been deprecated and a singleton (buy mutable) context object is now how context is passed around.

Ignored characters are no longer help in memory by default

Characters in a graphql document that are not significant to the syntax, such as spaces, new lines and comms, used to be captured in memory against AST nodes.

This is no longer the case and it saves memory from parsed documents. There is a switch to turn on the old behavior intended for tooling code.

https://github.com/graphql-java/graphql-java/pull/2394

Exception handlers can now be asynchronous

graphql-java operates in a asynchronous world and hence the code that handles exceptions in data fetchers should itself allow asynchronous handling.

https://github.com/graphql-java/graphql-java/pull/2371

Non standard scalars have been removed

graphql-java used to have non standard scalars like Byte, Short and Long etc... These deprecated scalars have finally been removed and now reside in the https://github.com/graphql-java/graphql-java-extended-scalars library

Breaking changes

https://github.com/graphql-java/graphql-java/pulls?q=is%3Apr+label%3A%22breaking+change%22++milestone%3A%2217.0%22

  • The boolean values acceptable as variable input the Boolean scalar have been tightened to true and false - see https://github.com/graphql-java/graphql-java/pull/2419

  • The non standard @Fetch directive support has been removed by default and deprecated. This was done for performance reasons because very few people used it but it slowed down schema creation a lot

  • The long deprecated BatchedExecutionStrategy and ExecutorServiceExecutionStrategy have finally been removed

  • The non standard scalars like Long and Short have been removed and moved to https://github.com/graphql-java/graphql-java-extended-scalars

graphql-java - 17.0-beta1

Published by bbakerman about 3 years ago

An initial beta 1 release of 17.0.

We consider this production ready, but we are seeking feedback from early adopters, therefor the beta1 release.

https://github.com/graphql-java/graphql-java/milestone/31?closed=1

@deprecated supported on input fields

In line with coming graphql spec changes, the @deprecated annotation can now be placed on input fields and not just output fields as before.

https://github.com/graphql-java/graphql-java/pull/2186

Dramatic performance improvements in GraphQLSchema building

The GraphQLSchema is a graph of types and as such has to be built according to strict rules. The previous code would repeated visit and rebuilt the schema and this meant that large schemes could be slow to build.

This code has been extensively benchmarked and improved. For example on a very large and complex schema, total build time went from 3.5 seconds to 1.2 seconds.

Thank you to teams out there that used https://github.com/graphql-java/graphql-anonymizer to submit in real life schemas that we can test with.

Dramatic performance improvements in DataFetchingFieldSelectionSet

The classes that underlie the DataFetchingFieldSelectionSet code have been been remodelled to be dramatically more performant. Before interfaces could create an exponential explosion in objects created. This has been fixed which in turn improves the performance of this code as scale.

Upgrade to DataLoader 3.x

https://github.com/graphql-java/java-dataloader has been upgraded to the new 3.0.1 version which adds new capabilities on external value caching.

Support of directives on fields and types during introspection

#2221 this is a non spec feature which lets you expose directives through Introspection

Reworked default value validation and improved Scalar coercion

#2325 This is a relatively big change which fixed up how default values are processed. Before that default values were never validated and custom Scalars could cause invalid values printed in SDL or Introspection. This PR includes a new Scalar coercion function valueToLiteral which is needed to implement this correct behaviour.

Better Unicode support in documents

https://github.com/graphql-java/graphql-java/pull/2404 allows for better Unicode expression in queries and SDL documents

GraphQLContext is now the approved context mechanism

https://github.com/graphql-java/graphql-java/pull/2368 allows for a well known API for context within a graphql request. Previously any opaque object could be used and framework could was not able to make any assumptions about adding their own context properties

The old mechanism has been deprecated and a singleton (buy mutable) context object is now how context is passed around.

Ignored characters are no longer help in memory by default

Characters in a graphql document that are not significant to the syntax, such as spaces, new lines and comms, used to be captured in memory against AST nodes.

This is no longer the case and it saves memory from parsed documents. There is a switch to turn on the old behavior intended for tooling code.

https://github.com/graphql-java/graphql-java/pull/2394

Exception handlers can now be asychronous

graphql-java operates in a asynchronous world and hence the code that handles exceptions in data fetchers should itself allow asynchronous handling.

https://github.com/graphql-java/graphql-java/pull/2371

Breaking changes

https://github.com/graphql-java/graphql-java/pulls?q=is%3Apr+label%3A%22breaking+change%22++milestone%3A%2217.0%22

  • The boolean values acceptable as variable input the Boolean scalar have been tightened to true and false - see https://github.com/graphql-java/graphql-java/pull/2419

  • The non standard @Fetch directive support has been removed by default and deprecated. This was done for performance reasons because very few people used it but it slowed down schema creation a lot

  • The new DataLoader upgrade has changed the signature of the future cache to be more correct.

  • The long deprecated BatchedExecutionStrategy and ExecutorServiceExecutionStrategy have finally been removed

graphql-java - Version 16.2

Published by andimarek over 3 years ago

This is a bugfix release containing the following fixes and improvements:

https://github.com/graphql-java/graphql-java/milestone/33?closed=1

The most important ones are

#2168 Bugfix: caching of visited fragments in Normalized tree
#2173 Ensure NormalizedQueryTreeFactory handles mutations and subscriptions

graphql-java - 16.1

Published by bbakerman almost 4 years ago

This is a bugfix release for the 16.0 version: Checkout the full 16.0 release notes

graphql-java shades in the Google immutable collections.

However we missed a package that was required and https://github.com/graphql-java/graphql-java/issues/2107 was the result.

This has been fixed in this 16.1 release.

Additionally it contains two other PRs:

#2113 Introspection for repeatable directive

#2111 Fixes module name

graphql-java - 16.0

Published by bbakerman almost 4 years ago

Please don't use 16.0, but rather 16.2

After a very lengthy time between releases, we are happy to announce that v16.0 of graphql-java is now available.

It adds new capabilities based on updated graphql specification and as usual a mix of bug fixes and performance improvements.

#2015 Repeatable directives support

The graphql specification now allows repeated directives on an element. This adds support for this. The is a breaking change because now there can be more than 1 directives for a given name and this was not true prior to this release.

#2079 Support in DataFetchingFieldSelectionSet for Unions and Interfaces

We have revamped the DataFetchingFieldSelectionSet so that it can handle non concrete types such as Unions. This is a breaking change but it significantly increases the ability to look ahead at all "possible" field selections and hence allow you to
do your own data retrieval optimisations even better.

#2093 Makes a default data fetcher exception handler possible

It is now easier to customise the data fetcher exception handler, without requiring you to instantiate your own execution strategies.

More schema validation

The validation code that ensures the schema conforms to specification has been improved. We have more SDL based validation and also we have post schema building validation to ensure types are specification compliant.

#2013 Persistent query support

We have added more code to help better support persistent queries. This includes basic implementations of the Apollo pattern for nominating persistent queries via query input extensions.

#2086 Use Immutable collections to avoid memory copying

As we worked towards releasing v16.0 we decided to attack the immutability of the objects
used in the code base. We reasoned that Immutable data structures would be more reliable
and they MAY be faster as less list / map copying needs to happen in order to pass
data around.

One thing that graphql-java does a lot of is pass a lot of lists and maps around. A graphql
engine is by specification a giant list and map generator.

We reasoned that because Immutable collections can do tricks when copying data (if its already immutable it can just no-op the copy)
then this may favour our code base.

   List<Foo> fooList = ImmutableList.of("a","b","c");
   //
   // no actual copying takes place in this classes because
   // the list is an immutable collection already
   //
   List<Foo> copiedFooList = ImmutableList.copyOf(fooList);

Benchmarks of the code confirmed this to be faster and also reduce memory pressure..

Performance improvements and memory pressure improvements

We have a lot of performance improvements in this release. Some of them are significant improvements for systems at high scale.

#2008 changed the error holder class
#2019 Faster Property fetching with derived classes
#2020 pre-sizing internal data structures
#2067 Support for Streams and Iterators
#2074 avoiding allocations in FieldCollectorParameters and MergedField
#2086 Use Immutable collections to avoid memory copying
#2023 ExecutionStepInfo optimisations to make it more performant

All breaking changes

All PRs for 16.0

graphql-java - Version 14.1

Published by andimarek over 4 years ago

This is the first bugfix release for the current LTS 14.x.

List of all Bugfixes

graphql-java - Version 15.0

Published by andimarek over 4 years ago

This is an important release which comes with two new major features and a bunch of performance improvements:

#1764 New Feature: Interfaces can implement other interfaces

This change allows interfaces to be implement by other interfaces instead of just objects.

This post explains the motivation and the background for it

#1772 New Feature: Custom Scalar specification URL

This lets you define a specification URL for a custom Scalar, which documents how this Scalar works.

This talk explains some background.

Performance improvements

We have a lot of performance improvements in this release. Some of them are significant improvements for systems at high scale.

#1815 More efficient DataFetcher
#1891 Improve ExecutionPath performance
#1792 Reduce NonNullable Exception overhead

Directives on variable declaration

It is now allowed to use directives on variable declaration.

Subscription improvements

#1804 DataFethcerResult can now be returned from subscription fetchers

#1801 Fixes the Subscription publisher so that it does not drop values at scale.

Non standard Scalar handling (Breaking change)

Any special handling for non standard Scalars got removed. This means you have to declare any Long, Char, etc Scalar explicitly in your SDL and provide an implementation.

The implementation for these non standard Scalars are still available in GraphQL Java itself (in the Scalars class) but they will be removed in the next release. The extended scalars project is the recommend way to migrate.

All breaking changes

All PRs for 15.0

graphql-java - Version 9.7

Published by andimarek almost 5 years ago

Version 9.7 is a bugfix release for our LTS Version 9.x.

It contains the following bugfixes:

#1753 multiple GraphQL sub types printing

#1752 additional optional arguments fields defined by interfaces

#1751 capture directive definition when building Schema

#1750 description of directives arguments are captured

#1749 Strategy update didn't take effect

#1748 Print directive argument only when it has a value

#1747 Non-null input object fields with default values should be valid

https://github.com/graphql-java/graphql-java/pulls?q=is%3Apr+milestone%3A9.7

graphql-java - Version 14.0

Published by andimarek almost 5 years ago

Overview

This is a big release after more than 6 months without a new major version. It consists of over 70 PRs which is mainly smaller bugfixes and improvements from all over the place.

The "biggest" feature in terms of work was the new SchemaTransformer and FieldVisibilitySchemaTransformation: it allows you to transform a GraphQLSchema and more specifically to remove one or more fields from a GraphQLSchema. While implementing this we refactored the GraphQLType hierarchy. If you are doing advanced GraphQLSchema processing you might be affected by it.

The most impactful changes for normal users are probably:

  • The ID scalar was changed to serialize all objects (#1693)
  • There is a new java.util.Locale available on the DataFetcherEnvironment set when you start executing a query (#1576)
  • Support of all unicode characters (#1603)
  • add getArgumentOrDefault to DataFetcherEnvironment (#1659)
  • Correctly support additional optional arguments in fields defined by interfaces (#1694)
  • add hook to allow for custom value unboxing (#1684)

But the impact really depends on your specific use, so please have a look at the complete list below.

List of all Features and Bugfixes

#1576: New java.util.Locale on DataFetcherEnvironment

#1589: Bugfix: Non-null input object fields with default values should be valid

#1589: Allow "special" names like true or fragment to be used as names

#1585: Introduce privacy safe logger prefix

#1601 and #1602: Improve Lexer errors

#1603: Allow full range of unicode characters

#1607: Add unique fragment names validation

#1609: Schema printing now prints description by default

#1610: Improved schema diff

#1637: Bugfix: SchemaPrinter print directive arguments only when there is a value

#1638: Bugfix: QueryTraverser can visit fields when the scalar value is an AST object

#1643: Parse a inputStream of schema definitions

#1645: Capture extend ast definitions in the GraphQLSchema

#1648: Fix if strategy is updated during instrumenting execution context

#1651: Upgrade DataLoader and fix lazy date loader support

#1659: add getArgumentOrDefault to DataFetcherEnvironment

#1668: Enhanced execution input (and hence data loader registry) is now captured before use

#1676: Will not override error classification extensions if they are already present

#1684: add hook to allow for custom value unboxing

#1685: local context is now null by default on top level fields

#1689: add support for extend schema notation

#1691: Add negative cache for PropertyDataFetcher

#1692: Improve Introspection performance

#1693: ID scalar now serialize all objects via String.valueOf

#1694: Bugfix: Correctly support additional optional arguments in fields defined by interfaces

#1702: Add FieldVisibilitySchemaTransformation which allows you to remove specific fields from a schema

#1720: Bugfix: QueryTraverser: fix NPE for directive arguments

#1721: Fine grained directive filtering in printing

#1722: Bugfix: description of directives arguments are captured correctly from SDL

#1723: Bugfix: capture directive definition when building a GraphQLSchema from SDL

#1725: Allows the messages from a scalar validation to be sent back to the user

#1735: Bugfix: comments on interface arguments cause wrong error for schema validation

#1737: Improve PropertyDataFetcher: search private getter up the class hierarchy

Breaking changes

#1685: We changed the default behaviour for the local context property: It is now null by default on top
level fields.

#1605 and other: We refined the type system for GraphQLSchema objects (classes implementing GraphQLType) and introduced a general SchemaTransformer class which lets you transform a GraphQLSchema object.

#1734: The SDL PostProcessor hook was renamed from SchemaTransformer to SchemaGeneratorPostProcessing to make the purpose more clear but also to make the name SchemaTransformer available.

Details

All PRs merged for 14.0:
https://github.com/graphql-java/graphql-java/pulls?utf8=%E2%9C%93&q=is%3Apr+milestone%3A14.0+

All PRs with breaking changes:
https://github.com/graphql-java/graphql-java/pulls?utf8=%E2%9C%93&q=is%3Apr+milestone%3A14.0+label%3A%22breaking+change%22

graphql-java - Version 13.0

Published by bbakerman over 5 years ago

Breaking changes

#1221 @deferred behavior now includes field path

This is breaking in the sense that data that was not there before is now present and hence the behaviour has changed.

Some would argue that this is not a breaking change but we are being conservative here.

#1460 @defer is no longer a default directive

You now have to opt in to getting @defer behavior whereas before it as the default

#1483 PreparsedDocumentProvider now has full input

Previously only the query string was passed to the PreparsedDocumentProvider but now it receives the full execution input

#1495 ErrorClassification can now contribute to the extensions map of the error

This is breaking in the sense that new data will arrive on error object that was not present before.

Some would argue that this is not a breaking change but we are being conservative here.

#1536 Directive Wiring will be called for all directives

Previously a directive schema wiring would only be called back if the element had the named directive on it. This has been changed to that there is not a class of registration where a directive schema wiring can be called back for all elements regardless of whether they have a directive or not

The breaking change is now that the arguments passed into a SchemaDirectiveWiring can now be null at certain times whereas before it could never be null

#1540 DirectivesContainer no longer inherits from NamedNode

Not all AST elements that can have directives are actually NamedNodes so this has been changed

#1546 Pluggable type comparators

SchemaPrinterComparatorRegistry has been renamed as GraphqlTypeComparatorRegistry and applies to a wider aspect than just in schema printing.

You can now have one on at the schema level and decide how types get sorted in all contexts including Introspection and Schema printing.

All breaking changes

https://github.com/graphql-java/graphql-java/pulls?utf8=%E2%9C%93&q=is%3Apr+milestone%3A13.0+is%3Aclosed+label%3A%22breaking+change%22

Other changes

#1567 A list of DataFetcherResult can now be returned

Previously one could return a DataFetcherResult (with data, local context and possible errors) from a field fetch call

Now you return a List of DataFetcherResult objects (for list types) so that each item in the list gets its own data, local context and possible errors.

#1513 Line numbers are off by one

Previously syntax errors ;line numbers might be off by one. This was due to confusion between zero based offsets and ones based offsets in ANTLR - this has been fixed

#1493 A CacheControl instance is always seeded into ExecutionInput

#1487 containsAllOf and containsAnyOf has been added to DataFetcherSeletionSet

This makes it a bit easier to decide if sub selected fields are present

#1491 ExecutionResult can now programmatically tell you if a data element is present

#1393 You can get the runtime directives that are present on a query field

We now generate filled outgraphql.schema.GraphQLDirective objects for the directives on a field at fetch time.

All changes

https://github.com/graphql-java/graphql-java/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+milestone%3A13.0+

graphql-java - Version 9.6

Published by bbakerman over 5 years ago

This is the next stable release of graphql-java

There are two fixes applied

https://github.com/graphql-java/graphql-java/pulls?utf8=%E2%9C%93&q=is%3Apr+milestone%3A9.6+is%3Aclosed

graphql-java - Version 12.0

Published by andimarek over 5 years ago

Breaking changes

#1335 Immutable Ast

This is a change we actually started a few months ago with making nearly all Nodes immutable.
This PR makes now all Nodes immutable and also provides a convenient way of changing Nodes in a Tree.
See https://github.com/graphql-java/graphql-java/pull/1335#issuecomment-443476271 for more details how to do that.

It contains also a change for the general tree TraverserContext: the result per Context is gone in favour of a accumulate property which lets you implement a general tree reduce logic.

Special thanks to @felipe-gdr for this PR.

#1308 GraphQLCodeRegistry

A new CodeRegistry was introduced which separates "code" (DataFetcher and TypeResolver) from the actual GraphQLSchema.

As a consequence you can't read the DataFetcher or TypeResolver anymore from a GraphQL object. (Adding a DataFetcher and TypeResolver when creating a GraphQLSchema is deprecated but still works as before. This was done for backwards compatibility but will be removed in a future version and hence the only way t associate data fetcher code with fields will be via the CodeRegistry)

#1313 Default Context object

GraphQL Java now offers a default context object if nothing was set.
The small breaking change is that the default context value is not null any more. We dont expect this to be a problem in practice.

#1387 removed ExecutionContext from DataFetcherEnvironment

ExecutionContext was removed from DataFetcherEnvironment in favour of adding more properties to the DataFetcherEnvironment directly.

#1415 General Purpose Error Builder

The breaking change is regarding mapping or errors returned from a DataFetcher. DataFetcherResult has a new property isMapRelativeErrors which is false by default. Previously it was like it was true by default . When it is true, the data fetching code will map this error as being a relative error from the existing field. If it is false then any errors returned will be passed on unchanged.

All breaking changes PRs

https://github.com/graphql-java/graphql-java/issues?utf8=%E2%9C%93&q=+label%3A%22breaking+change%22+milestone%3A%2212.0%22

Other changes

#1416 SchemaDirectiveWiring is now done after the full set of graphql elements are built

This makes the schema directive wiring occur after the type has been built and hence the callback gets full access to the type hierarchy

#1376 Passing local context objects from data fetchers to child fields

This uses DataFetcherResult as the mechanism for a DataFetcher to pass local context objects down to child fetchers. This allows parent fields to pass down information to lower layers. If a field does not pass any local context down, then the local context from the previous parent is used.

#1355 Added the ability to instrument document and variables

#1285 PropertyDataFetcher: Added the ability to not use setAccessible for non public access

All changes:

https://github.com/graphql-java/graphql-java/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Amerged+milestone%3A12.0

graphql-java - Version 9.5

Published by andimarek over 5 years ago

Maintenance release for the stable branch 9.x with:

  • Update antlr4 from 4.7.1 to 4.7.2
  • Fix NPE in AstPrinter for inline fragments without type condition
  • ClassCastException when using a fragment with wrong input type condition and overlapping fields are being merged.
  • Floats can have positive exponents

Full list of PRS:

https://github.com/graphql-java/graphql-java/pulls?utf8=%E2%9C%93&q=milestone%3A%229.5%22

graphql-java - 11.0

Published by bbakerman almost 6 years ago

Breaking changes

#1263 - DataLoader Scope changes

The dataloader support in graphql-java has been changed to encourage the right behavior. The DataLoaderRegistry and its contained DataLoaders need to be per execution instance based. However the previous setup made them tied to schema which is typically shared across executions.

Instead now the DataLoaderRegistry is specified as a property of the ExecutionInput and hence definitely per execution. This ensure thats the behaviour of data loader is scope to one execution and only one execution.

#1269 #1275 #1276 #1277 - ExecutionTypeInfo changed

These PRs are all somehow related.
The main change is that we renamed ExecutionTypeInfo to a more semantically correct ExecutionStepInfo since it contains much more information than just type information and it is actually focused around the current step of the execution.
We also changed the meaning of ExecutionStepInfo.type for non nullable types: previously it has been automatically unwrapped so that type was never NonNull.
If you used .getType() please change it to .getUnwrappedNonNullType() to avoid any logic changes.

Also castType was removed (just do the cast yourself if needed) and treatAs was renamed to changeTypeWithPreservedNonNull.

Other changes

#1269 - data fetchers can get their parents arguments

Sometimes a child data fetcher wants to lookup upwards and know what arguments are passed to its parents. This is now supported via the ExecutionStepInfo class. You can get the parent ExecutionStepInfo from the current field ExecutionStepInfo and also gets its arguments.

#1213

Directives are now considered children of graphql types and will be visited like other children. This allows you to write Traversals that find directives on graphql type objects and apply certain behaviours.

#1264 default methods on interfaces can now supply values to the property data fetcher

#1255 a possible deadlock in the data loader instrumentation tracking was fixed when DataLoader is not per execution

#1243 all the older BatchedExecutionStrategy code is deprecated. Use the DataLoader pattern instead

#1222 The handling of __typename was fixed that caused problems in max query complexity

#1203 the field paths now using the field alias of defined as the path name. This is more correct and specific.

All PRs can be seen here : https://github.com/graphql-java/graphql-java/pulls?q=is%3Apr+milestone%3A11.0

graphql-java - 9.4

Published by bbakerman about 6 years ago

This release consists of a series of fixes on the 9.x stable branch of graphql-java

#1260
#1259
#1258
#1225

https://github.com/graphql-java/graphql-java/pulls?utf8=%E2%9C%93&q=+is%3Apr+milestone%3A9.4+

graphql-java - 10.0

Published by bbakerman about 6 years ago

Breaking Change: Ast Nodes

The biggest breaking is the mutability and the general design of Ast Nodes:

  • Every Node has now a Builder and aims to be immutable
  • Nearly every getter for a collection returns now a copy instead of the real collection

Background:

Ast Nodes have never really been part of the public Api, but they "sneaked" into it again and again over time (for example you can get the Field from the DataFetchingEnvironment). So it was time to really support it: we refactored them and made them immutable. Unfortunately because of some external dependencies on the mutability we didn't go all the way: some Nodes are still mutable. We aim for making it fully immutable in the future.

WARNING: If you rely on the mutability of the Ast you have to refactor your code! Especially getter returning now a copy of collections and modifications of it doesn't have any effect!

Other breaking changes:

#1130: QueryVisitorFieldEnvironment.getParentType() returns now the possible modified type and not the unmodified type.

#1133: TypeDefinitionRegistry.add now accepts only SDLDefintion

#1145: A small change around additonalTypes if you use the GraphqlSchema constructor directly

PropertyDataFetcher methods can receive an DataFetchingEnvironment object

See #1169

The invoked POJO method can now take the DataFetchingEnvironment as an argument which helps to make ever more light weight data fetching code.

DataLoader has been bumped to 2.1.1

The new DataLoader version allows new types of batch loading functions to be written and includes return a Map of results instead of an ordered list. They also allow context to be passed to help wire in things like user credentials and so on.

Ability to get field sub selections more easily

DataFetchingFieldSelectionSet has been improved making it easier to look at field sub selection and therefore optimise your data fetching queries.

For example a Relay system might have code like the following to help find out what data they want.

List<SelectedField> nodeFields = selectionSet.getFields("edges/nodes/*");

See #1176

ExecutorServiceExecutionStrategy has been depreacted

There is no need to use ExecutorServiceExecutionStrategy anymore since all its functionality can be replicated in data fetchers by calling CompletableFuture.supplyAsync(() -> someValues(), executor)

This will be removed in a future version

You now have the ability to navigate up the execution tree in terms of fields

Previously ExecutionTypeInfo created an execution tree of types but not the AST fields. This has been added, allowing a data fetcher to look upwards towards parent fields.

See #1176

Tons of other fixes

https://github.com/graphql-java/graphql-java/pulls?utf8=%E2%9C%93&q=+is%3Apr+milestone%3A10.0+

graphql-java - 9.3

Published by bbakerman about 6 years ago

This is a bugfix release to address mainly the following things:

#1191 race conditions in data loader dispatching
#1182 fix null element
#1150 class cast exception in schema generation
#1142 validate input variables
#1113 npe in field tracking during dispatch
#1159 fix json encoding of values

See https://github.com/graphql-java/graphql-java/pulls?q=is%3Apr+milestone%3A9.3

graphql-java - Release 9.2

Published by andimarek over 6 years ago

This releases fixes a single regression from 9.1:
https://github.com/graphql-java/graphql-java/pull/1118