graphql-java-kickstart / graphql-spring-boot

GraphQL and GraphiQL Spring Framework Boot Starters - Forked from oembedler/graphql-spring-boot due to inactivity.
https://www.graphql-java-kickstart.com/spring-boot/
MIT License
1.5k stars 325 forks source link

fix(deps): update dependency com.graphql-java:graphql-java to v20 #902

Closed renovate[bot] closed 1 year ago

renovate[bot] commented 1 year ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
com.graphql-java:graphql-java 19.3 -> 20.0 age adoption passing confidence

Release Notes

graphql-java/graphql-java ### [`v20.0`](https://togithub.com/graphql-java/graphql-java/releases/tag/v20.0): 20.0 We are pleased to announce the release of graphql-java 20.0. Special thanks to each of the 200+ contributors over the years, who have made this milestone possible. ### Breaking changes #### Aligning `parseValue` coercion with JS reference implementation We have made changes to String, Boolean, Float, and Int `parseValue` coercion, to be consistent with the reference JS implementation. The key change is `parseValue` is now stricter on accepted inputs. - String `parseValue` now requires input is of type `String`. For example, a Number input `123` or a Boolean input `true` will no longer be accepted. - Boolean `parseValue` now requires input is of type `Boolean`. For example, a String input `"true"` will no longer be accepted. - Float `parseValue` now requires input is of type `Number`. For example, a String input `"3.14"` will no longer be accepted. - Int `parseValue` now requires input is of type `Number`. For example, a String input `"42"` will no longer be accepted. String `parseValue` changes: [https://github.com/graphql-java/graphql-java/pull/3030](https://togithub.com/graphql-java/graphql-java/pull/3030) Boolean, Float, and Int `parseValue` changes: [https://github.com/graphql-java/graphql-java/pull/3042](https://togithub.com/graphql-java/graphql-java/pull/3042) JS reference implementation: https://github.com/graphql/graphql-js/blob/main/src/type/scalars.ts ### Notable Changes #### Record Like Property Fetching Support We have now added the ability to find properties via "Record like" naming. We call it "Record like" based on Java 14 `record` classes but in fact any class with a method named directly as the graphql field is named will work. If you had this graphql object type declared ```graphql type Person { name : String address : String } ``` then this Java `record` would be supported for fetching values via the method names `name()` and `address()` ```java public record Person (String name, String address) ``` and equally a non record class like this would also work ```java public class Person { public String name() { return "Harry Potter"; } public String address() { return "4 Privet Drive, Little Whinging"; } } ``` We still have Java Bean (aka POJO) getter naming support like `public String getName()` however now the "record like" `name()` method will be used in preference and then the `getName()` methods will be used if that's not present. This means there is a new behavior if you had weird POJOs likes this ```java public class WeirdPerson { public String name() { return "Harry Potter"; } public String getName() { return "Tom Riddle"; } } ``` A property fetch for `name` will now return `Harry Potter` and not `Tom Riddle` as it previously would have. This is a **behavioral breaking change** but on balance we think this behavior is the most correct going forward. [https://github.com/graphql-java/graphql-java/pull/2994](https://togithub.com/graphql-java/graphql-java/pull/2994) #### Improved Data Fetching The `PropertyDataFetcher` class is the most common data fetcher used in graphql-java. It uses Java reflection to get field values from objects based on field name. This was logically the following ```java Method method = findMethod(fieldname); method.invoke(object); ``` with the method lookup cached for performance reasons. However there is mechanism in the JVM that provides even faster object reflective access. See https://wttech.blog/blog/2020/method-handles-and-lambda-metafactory/ https://www.optaplanner.org/blog/2018/01/09/JavaReflectionButMuchFaster.html `java.lang.invoke.LambdaMetafactory#metafactory` is an arcane mechanism that can be used to create virtual method lambdas that give fast access to call object methods. It turns out to be significantly faster that Java reflection and only marginally slower that directly invoking a method. If you use `PropertyDataFetcher` a lot (and chances are you do) then this should give improved performance. The raw benchmarks are as follows Java 8 Benchmark Mode Cnt Score Error Units GetterAccessBenchmark.measureDirectAccess thrpt 15 81199548.105 ± 2717206.756 ops/s 0% slower (baseline) GetterAccessBenchmark.measureLambdaAccess thrpt 15 79622345.446 ± 1183553.379 ops/s 2% slower GetterAccessBenchmark.measureReflectionAccess thrpt 15 46102664.133 ± 4091595.318 ops/s 50% slower Java 17 Benchmark Mode Cnt Score Error Units GetterAccessBenchmark.measureDirectAccess thrpt 15 458411420.717 ± 34329506.990 ops/s 0% GetterAccessBenchmark.measureLambdaAccess thrpt 15 334158880.091 ± 10666070.698 ops/s 27% slower GetterAccessBenchmark.measureReflectionAccess thrpt 15 63181868.566 ± 3887367.970 ops/s 86% slower It's worth noting that while the headline numbers here look impressive, the property fetching represents a smaller portion of what happens during graphql engine execution. It probably won't be enough to keep Elon Musk happy but all performance improvements help and at scale they help the most. #### Lightweight Data Fetchers A `DataFetcher` gets invoked with a calling environment context object called `graphql.schema.DataFetchingEnvironment`. This is quite a rich object that contains all sorts of useful information. However simple (aka trivial) data fetchers like `PropertyDataFetcher` they don't need access to such a rich object. They just need the source object, the field name and the field type To marginally help performance, we have introduced a `graphql.schema.LightDataFetcher` for this use case ```java public interface LightDataFetcher extends TrivialDataFetcher { T get(GraphQLFieldDefinition fieldDefinition, Object sourceObject, Supplier environmentSupplier) throws Exception; } ``` `PropertyDataFetcher` implements this and hence this lowers the object allocation at scale (which reduces memory pressure) and will make the system marginally faster to fetch data. [https://github.com/graphql-java/graphql-java/pull/2953](https://togithub.com/graphql-java/graphql-java/pull/2953) #### Performance Improvements by avoid object allocations We are always trying to wring out the most performance we can in graphql-java and so we reviewed our object allocations and found places where we can make savings. These won't make dramatic performance savings but at scale all these things add up, reducing memory pressure and improving throughput marginally. [https://github.com/graphql-java/graphql-java/pull/2981](https://togithub.com/graphql-java/graphql-java/pull/2981) [https://github.com/graphql-java/graphql-java/pull/2980](https://togithub.com/graphql-java/graphql-java/pull/2980) [https://github.com/graphql-java/graphql-java/pull/2979](https://togithub.com/graphql-java/graphql-java/pull/2979) #### Locale is now available in Coercing and Parsing The `graphql.schema.Coercing` interface used by scalars can now receive a `Locale` object that indicates the calling `Locale`. The same is true for the parsing code via `graphql.parser.ParserEnvironment#getLocale` A custom scalar implementation could use the locale to decide how to coerce values. [https://github.com/graphql-java/graphql-java/pull/2912](https://togithub.com/graphql-java/graphql-java/pull/2912) [https://github.com/graphql-java/graphql-java/pull/2921](https://togithub.com/graphql-java/graphql-java/pull/2921) #### Easier ways to build common objects We have added extra builders on the `GraphQLError`, `ErrorClassification` and `ExecutionResult` interfaces that make it easier to build instances of these common classes. [https://github.com/graphql-java/graphql-java/pull/2939](https://togithub.com/graphql-java/graphql-java/pull/2939) [https://github.com/graphql-java/graphql-java/pull/3011](https://togithub.com/graphql-java/graphql-java/pull/3011) #### The deprecated NextGen engine has been removed The NextGen engine was an experimental feature that explored what it might take to build a new graphql engine. In many ways it was a success as it taught us a bunch of about graph algorithms and what works and what does not. While it had some value, on balance it was not going to become production ready and so we deprecated it a while back and it has finally been removed. [https://github.com/graphql-java/graphql-java/pull/2923](https://togithub.com/graphql-java/graphql-java/pull/2923) #### What's Changed - docs: update latest release badge to 19 by [@​setchy](https://togithub.com/setchy) in [https://github.com/graphql-java/graphql-java/pull/2918](https://togithub.com/graphql-java/graphql-java/pull/2918) - Fix printing directives when they contain something like a formatting… by [@​jmartisk](https://togithub.com/jmartisk) in [https://github.com/graphql-java/graphql-java/pull/2920](https://togithub.com/graphql-java/graphql-java/pull/2920) - Implement pretty printer by [@​felipe-gdr](https://togithub.com/felipe-gdr) in [https://github.com/graphql-java/graphql-java/pull/2894](https://togithub.com/graphql-java/graphql-java/pull/2894) - Fix snapshot badge by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2924](https://togithub.com/graphql-java/graphql-java/pull/2924) - Remove [@​fetch](https://togithub.com/fetch) and nextgen engine by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2923](https://togithub.com/graphql-java/graphql-java/pull/2923) - Fix up field visibility doco example by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2927](https://togithub.com/graphql-java/graphql-java/pull/2927) - We can rename scalar types by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2928](https://togithub.com/graphql-java/graphql-java/pull/2928) - Add deprecation date to all deprecated methods and fields by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2929](https://togithub.com/graphql-java/graphql-java/pull/2929) - Fix field visibility bug with enum with enum args by [@​felipe-gdr](https://togithub.com/felipe-gdr) in [https://github.com/graphql-java/graphql-java/pull/2926](https://togithub.com/graphql-java/graphql-java/pull/2926) - Adding Locale to Coercing and hence ValueResolver by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2912](https://togithub.com/graphql-java/graphql-java/pull/2912) - Removes the deprecated execute methods from GraphQL by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2932](https://togithub.com/graphql-java/graphql-java/pull/2932) - Removing deprecated methods from tests - part 1 by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2930](https://togithub.com/graphql-java/graphql-java/pull/2930) - Reproduction of renaming scalars and applied directives bug by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2934](https://togithub.com/graphql-java/graphql-java/pull/2934) - Remove redundant NaN check, already handled in GraphqlFloatCoercing by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2936](https://togithub.com/graphql-java/graphql-java/pull/2936) - Diff counts are the same by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2935](https://togithub.com/graphql-java/graphql-java/pull/2935) - Change Instrumentation production implementations to use non deprecated methods by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2931](https://togithub.com/graphql-java/graphql-java/pull/2931) - Make parseValue nullable and update Coercing javadoc by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2938](https://togithub.com/graphql-java/graphql-java/pull/2938) - Cleaning up tests with deprecated usage: Part 2 by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2941](https://togithub.com/graphql-java/graphql-java/pull/2941) - Deprecation test cleanup: GraphQLFieldDefinition datafetcher builder by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2942](https://togithub.com/graphql-java/graphql-java/pull/2942) - Fix [@​skip](https://togithub.com/skip) definition is added twice to the GraphQLSchema when defined in sdl by [@​tinnou](https://togithub.com/tinnou) in [https://github.com/graphql-java/graphql-java/pull/2940](https://togithub.com/graphql-java/graphql-java/pull/2940) - Added new builder to ExecutionResult by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2939](https://togithub.com/graphql-java/graphql-java/pull/2939) - Test cleanup: typeResolver builder on unions and interfaces, applied directive tests, and more by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2954](https://togithub.com/graphql-java/graphql-java/pull/2954) - Update GraphQL Instrospection Spec Link by [@​cookieMr](https://togithub.com/cookieMr) in [https://github.com/graphql-java/graphql-java/pull/2977](https://togithub.com/graphql-java/graphql-java/pull/2977) - Deprecation cleanout - programmatic schemas by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2974](https://togithub.com/graphql-java/graphql-java/pull/2974) - Avoid allocating a type resolve env if the type is already an object type by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2980](https://togithub.com/graphql-java/graphql-java/pull/2980) - Avoids allocating a copy of the field names set inside the ES by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2981](https://togithub.com/graphql-java/graphql-java/pull/2981) - Patch SchemaDiff to apply respective nullability change validation for input vs. output types by [@​bspeth](https://togithub.com/bspeth) in [https://github.com/graphql-java/graphql-java/pull/2971](https://togithub.com/graphql-java/graphql-java/pull/2971) - Adding Locale to Parser by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2921](https://togithub.com/graphql-java/graphql-java/pull/2921) - Added workflow and gcp JS client library script with package json by [@​DiegoManzanarezx](https://togithub.com/DiegoManzanarezx) in [https://github.com/graphql-java/graphql-java/pull/2889](https://togithub.com/graphql-java/graphql-java/pull/2889) - Add missing equals/hashcode methods to relay classes by [@​pgr0ss](https://togithub.com/pgr0ss) in [https://github.com/graphql-java/graphql-java/pull/2988](https://togithub.com/graphql-java/graphql-java/pull/2988) - Float coercion tidy up by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/2982](https://togithub.com/graphql-java/graphql-java/pull/2982) - Only run GCP tests on main graphql-java repo (skip on forks). by [@​folone](https://togithub.com/folone) in [https://github.com/graphql-java/graphql-java/pull/2997](https://togithub.com/graphql-java/graphql-java/pull/2997) - Parameterized introspection queries by [@​MayCXC](https://togithub.com/MayCXC) in [https://github.com/graphql-java/graphql-java/pull/2993](https://togithub.com/graphql-java/graphql-java/pull/2993) - Update aQute builder version by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/3002](https://togithub.com/graphql-java/graphql-java/pull/3002) - Avoid an allocation of a chained context in the most common case by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2979](https://togithub.com/graphql-java/graphql-java/pull/2979) - Polishing by [@​dfa1](https://togithub.com/dfa1) in [https://github.com/graphql-java/graphql-java/pull/3001](https://togithub.com/graphql-java/graphql-java/pull/3001) - Document the new IntrospectionQueryBuilder and tweaked it a little by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/3003](https://togithub.com/graphql-java/graphql-java/pull/3003) - LambdaMetafactory support for property fetches by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2985](https://togithub.com/graphql-java/graphql-java/pull/2985) - SchemaGeneratorPostProcessing should be deprecated by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2999](https://togithub.com/graphql-java/graphql-java/pull/2999) - Fixes in TwitterBenchmark by [@​dfa1](https://togithub.com/dfa1) in [https://github.com/graphql-java/graphql-java/pull/3006](https://togithub.com/graphql-java/graphql-java/pull/3006) - Bugfix for SDL check if an Interface is implemented correctly by [@​andimarek](https://togithub.com/andimarek) in [https://github.com/graphql-java/graphql-java/pull/3014](https://togithub.com/graphql-java/graphql-java/pull/3014) - Adds an error builder on GraphQLError by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/3011](https://togithub.com/graphql-java/graphql-java/pull/3011) - TypeResolutionEnvironment#getLocalContext seems accidentally non-public by [@​kaqqao](https://togithub.com/kaqqao) in [https://github.com/graphql-java/graphql-java/pull/3021](https://togithub.com/graphql-java/graphql-java/pull/3021) - centralizing resource loading in BenchmarkUtils by [@​dfa1](https://togithub.com/dfa1) in [https://github.com/graphql-java/graphql-java/pull/3022](https://togithub.com/graphql-java/graphql-java/pull/3022) - Helper for getting fields based on object type name by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/3016](https://togithub.com/graphql-java/graphql-java/pull/3016) - Avoiding some duplicated work in Async by [@​dfa1](https://togithub.com/dfa1) in [https://github.com/graphql-java/graphql-java/pull/3023](https://togithub.com/graphql-java/graphql-java/pull/3023) - Record like property access support by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2994](https://togithub.com/graphql-java/graphql-java/pull/2994) - Lightweight data fetchers by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/2953](https://togithub.com/graphql-java/graphql-java/pull/2953) - Update ValidationError#toString to print the extentions field by [@​federicorispo](https://togithub.com/federicorispo) in [https://github.com/graphql-java/graphql-java/pull/3024](https://togithub.com/graphql-java/graphql-java/pull/3024) - Minor fixes by [@​dfa1](https://togithub.com/dfa1) in [https://github.com/graphql-java/graphql-java/pull/3029](https://togithub.com/graphql-java/graphql-java/pull/3029) - This makes sure every introspection type actually has a concrete data fetcher by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/3004](https://togithub.com/graphql-java/graphql-java/pull/3004) - Make String parseValue coercion consistent with JS implementation & Gradle JCenter fix by [@​dondonz](https://togithub.com/dondonz) in [https://github.com/graphql-java/graphql-java/pull/3030](https://togithub.com/graphql-java/graphql-java/pull/3030) - Adding new schema diffing capability (First step) by [@​andimarek](https://togithub.com/andimarek) in [https://github.com/graphql-java/graphql-java/pull/2983](https://togithub.com/graphql-java/graphql-java/pull/2983) - chore: Remove unused imports and local variables by [@​federicorispo](https://togithub.com/federicorispo) in [https://github.com/graphql-java/graphql-java/pull/3034](https://togithub.com/graphql-java/graphql-java/pull/3034) - Testing I18n lookup by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/3036](https://togithub.com/graphql-java/graphql-java/pull/3036) - Consider union containers when checking if type is referenced by [@​felipe-gdr](https://togithub.com/felipe-gdr) in [https://github.com/graphql-java/graphql-java/pull/3037](https://togithub.com/graphql-java/graphql-java/pull/3037) - master fix - use class loader on i18n by [@​bbakerman](https://togithub.com/bbakerman) in [https://github.com/graphql-java/graphql-java/pull/3039](https://togithub.com/graphql-java/graphql-java/pull/3039) #### New Contributors - [@​cookieMr](https://togithub.com/cookieMr) made their first contribution in [https://github.com/graphql-java/graphql-java/pull/2977](https://togithub.com/graphql-java/graphql-java/pull/2977) - [@​bspeth](https://togithub.com/bspeth) made their first contribution in [https://github.com/graphql-java/graphql-java/pull/2971](https://togithub.com/graphql-java/graphql-java/pull/2971) - [@​DiegoManzanarezx](https://togithub.com/DiegoManzanarezx) made their first contribution in [https://github.com/graphql-java/graphql-java/pull/2889](https://togithub.com/graphql-java/graphql-java/pull/2889) - [@​pgr0ss](https://togithub.com/pgr0ss) made their first contribution in [https://github.com/graphql-java/graphql-java/pull/2988](https://togithub.com/graphql-java/graphql-java/pull/2988) - [@​MayCXC](https://togithub.com/MayCXC) made their first contribution in [https://github.com/graphql-java/graphql-java/pull/2993](https://togithub.com/graphql-java/graphql-java/pull/2993) - [@​federicorispo](https://togithub.com/federicorispo) made their first contribution in [https://github.com/graphql-java/graphql-java/pull/3024](https://togithub.com/graphql-java/graphql-java/pull/3024) **Full Changelog**: https://github.com/graphql-java/graphql-java/compare/v19.1...v20.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.

github-actions[bot] commented 1 year ago

Test Results

  93 files    93 suites   46s :stopwatch: 263 tests 263 :heavy_check_mark: 0 :zzz: 0 :x: 268 runs  268 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 11c60674.

:recycle: This comment has been updated with latest results.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information