Skip to content

@andimarek andimarek released this Mar 12, 2019 · 14 commits to master since this release

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 #1335 (comment) 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

Assets 2
You can’t perform that action at this time.