This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
fix(deps): update dependency com.graphql-java:graphql-java to v21 #958
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
20.4
->21.0
Release Notes
graphql-java/graphql-java (com.graphql-java:graphql-java)
v21.0
: 21.0We are pleased to announce the release of graphql-java v21.0. This is a breaking change release.
Thanks to everyone in the community who contributed to the release, whether that was code, helping to report issues, or participating in discussions.
And Happy 8th Birthday to graphql-java, who celebrated their birthday last week!
Breaking Changes
Upgraded to Java 11
graphql-java now requires Java 11 as a minimum version. See the blog announcing the change.
For those who need time to upgrade to Java 11, keep in mind we will support graphql-java 20.x (with Java 8) for a short period as per our release policy.
If you are wondering why we are not on a later version, graphql-java has always been conservative on its base JVM version to allow the widest possible set of consumers.
Reverted stricter scalar
parseValue
coercion, added monitoring and interceptor callbackv20.0 introduced a stricter set of scalar
parseValue
coercions - for example previously anInteger
would accept a string if it parsed into a number but that was removed and a more strict system was put in place.While technically more correct, and consistent with the graphql-js reference implementation, in practice this proved problematic for some consumers. So this more stricter
parseValue
coercion was reverted in v20.3.We would like to re-introduce this more strict scalar
parseValue
conversion in the future and to that end we have introduced agraphql.execution.values.InputInterceptor
callback that allows you to observe what values you are receiving and potentially do special tweaking of those values.A
graphql.execution.values.legacycoercing.LegacyCoercingInputInterceptor
implementation will convert old less strict values into then more strict values for example.If you had problems with scalar values we urge you to use the new
InputInterceptor
to learn what less strict values are coming into your systems and fix them up. That way, when a future version re-introduces the more strict (and more correct) coercion then you will be prepared.Static recordLike() methods no longer supported
In v20, the
PropertyDataFetcher
would read property values fromrecordLike()
methods on objects even if they were static methods. This caused problems for some users and after considering how to fix it and talking to some our major consumers like the Spring team, we decided to remove this behavior. On balance we think this will lead to a better outcome over the long term.This is a breaking change for those who might have relied on a static
recordLike()
method being called for a property.Removal of old deprecated methods and classes
The following PRs removed old deprecated methods and class. The changes are breaking ones but these have been deprecated for a long time.
Other small breaking changes
A very minor breaking change is that
graphql.execution.ExecutionStrategy
had a protected methodprotected Iterable<Object> toIterable(Object result)
which really is a utility method and not designed for overriding.graphql.util.FpKit#toIterable
is the preferred replacement.What's new in v21
ExecutableNormalisedXXX is now public API
The
graphql.normalized.ExecutableNormalizedOperation
andgraphql.normalized.ExecutableNormalizedField
code is now public API.This API allows you to represent what MAY be executed given a schema and a valid GraphQL query.
This code is not intended for general consumption but perhaps you are writing a framework based on graphql-java and need to have a powerful representation of what would be executed, then these classes are for you.
This allows you to write specialized code (such as a new execution engine or perhaps a federated GraphQL engine like say Nadel) based on these tree like representations of a normalized and executable query.
Building extensions in data fetchers
There is a new
graphql.extensions.ExtensionsBuilder
that allows data fetcher callbacks to add extension values into the final result. Since extensions are a map and there could be merge conflicts on values, agraphql.extensions.ExtensionsMerger
interface is provided to handle these conflicts and a defaultgraphql.extensions.DefaultExtensionsMerger
is provided.This is available via the
graphql.GraphQLContext
and is put in there by default so data fetchers can rely on it being present. At the end of the request theExtensionsBuilder
is called to build out a final map of extensions which is placed in thegraphql.ExecutionResult
.A smarter schema visitor API
A new
graphql.schema.visitor.GraphQLSchemaVisitor
has been created that is more domain specific around visiting GraphQL schemas. The oldgraphql.schema.GraphQLTypeVisitor
worked however it is very generic in nature and is not domain specific to schemas.The new API improves how you can visit schemas and the callbacks have better schema domain information provided on them. Also the
graphql.schema.visitor.GraphQLSchemaVisitorEnvironment
is better than older alternative with clearer return methods likechangeNode()
ordeleteNode()
and so on for controlling how the visitor works.This is an adaptor to
GraphQLTypeVisitor
and hence can be used by the existinggraphql.schema.SchemaTraverser
andgraphql.schema.SchemaTransformer
classes (which expect aGraphQLTypeVisitor
) via a small call tographql.schema.visitor.GraphQLSchemaVisitor#toTypeVisitor
.Performance improvements
As always, we have tried to include some performance improvements in the release. One area of note is avoiding unnecessary CompletableFuture allocations when they are not needed.
Other things
The QueryComplexity calculator has been broken out into its own class and can be used outside the original
graphql.analysis.MaxQueryComplexityInstrumentation
context.The
graphql.execution.DataFetcherResult#map
method was added to allow better functional mapping of results.All Changes
New Contributors
Full Changelog: graphql-java/graphql-java@v20.2...v21.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.