Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
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
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:
QueryVisitorFieldEnvironment.getParentType() returns now the possible modified type and not the unmodified type.
TypeDefinitionRegistry.add now accepts only
#1145: A small change around
additonalTypes if you use the
GraphqlSchema constructor directly
PropertyDataFetcher methods can receive an DataFetchingEnvironment object
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/*");
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
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.