MyGit

v12.0

graphql-java/graphql-java

版本发布时间: 2019-03-12 08:30:31

graphql-java/graphql-java最新发布版本:v22.3(2024-09-05 11:15:52)

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

相关地址:原始地址 下载(tar) 下载(zip)

查看:2019-03-12发行的版本