dependabot[bot] opened a new pull request, #14004:
URL: https://github.com/apache/camel/pull/14004

   Bumps 
[com.graphql-java:graphql-java](https://github.com/graphql-java/graphql-java) 
from 21.5 to 22.0.
   <details>
   <summary>Release notes</summary>
   <p><em>Sourced from <a 
href="https://github.com/graphql-java/graphql-java/releases";>com.graphql-java:graphql-java's
 releases</a>.</em></p>
   <blockquote>
   <h2>22.0</h2>
   <p>We are pleased to announce the release of graphql-java v22.0.</p>
   <p>Thanks to everyone in the community who contributed to the release, 
whether that was code, helping to report issues, or participating in 
discussions.</p>
   <p>This is a <strong>breaking change</strong> release.</p>
   <p>The graphql-java team takes breaking changes very seriously but in the 
name of performance we have made some significant breaking changes in this 
release.</p>
   <h1>Major Performance Changes</h1>
   <p>Past releases have been very much performance focused and this one is no 
different. However, this release is aiming to reduce memory pressure more than 
reduce pure CPU usage. When the graphql-java engine is running, if it produces 
less objects it will ultimately run faster because of reduced memory pressure 
and less garbage to collect.</p>
   <p>The engine has been changed in two major ways that reduce memory 
pressure.</p>
   <h2>ExecutionResult wrapping</h2>
   <p>The first was that all values that come back got wrapped internally into 
a <code>ExecutionResult</code> object where the <code>data</code> attribute was 
the value.  This was a carry over from some very early GraphQL code but was 
unnecessary and hence has been removed.  The follow on effect of this is that 
some <code>graphql.execution.ExecutionStrategy</code> protected methods and 
<code>graphql.execution.instrumentation.Instrumentation</code> methods used to 
receive and return <code>ExecutionResult</code> values and no longer do, which 
is an API breaking change. We have made this breaking changes in the name of 
memory pressure performance.</p>
   <h2>CompletableFuture wrapping</h2>
   <p>The second major change is that the engine no longer exclusively uses 
<code>java.util.concurrent.CompletableFuture</code>s when composing together 
results. Let us explain the past code first so we can discuss the new code.</p>
   <p><code>CompletableFuture</code> is a fantastic construct because it 
represents a promise to a value and it can also hold an exceptional state 
inside itself.  Async programming with <code>CompletableFuture</code> is viral. 
 If stage 1 of some compute process returns a <code>CompletableFuture</code> 
then stage 2 and 3 and 4 are likely to as well to ensure everything is 
asynchronous.</p>
   <p>We use to take values that were not asynchronous (such as DataFetcher 
that returned a simple in memory object) and wrap them in a 
<code>CompletableFuture</code> so that all of the other code composed together 
using <code>CompletableFuture</code> methods like <code>.thenApply()</code> and 
<code>.thenCompose</code> and so on. The code is cleaner if you use all 
<code>CompletableFuture</code> code patterns.</p>
   <p>However many objects in a GraphQL request are not asynchronous but rather 
materialised objects in memory.  Scalars, enums and list are often just values 
immediately available to be used and allocating a 
<code>CompletableFuture</code> makes the code easier to write but it has a 
memory pressure cost.</p>
   <p>So we have sacrificed cleaner code for more memory performant code.</p>
   <p>graphql-java engine <code>graphql.execution.ExecutionStrategy</code> 
methods now just return <code>Object</code> where that object might be either a 
<code>CompletableFuture</code> or a materialised value.</p>
   <pre lang="java"><code>    private Object 
/*CompletableFuture&lt;FetchedValue&gt; | FetchedValue&gt;*/
          fetchField(GraphQLFieldDefinition fieldDef, ExecutionContext 
executionContext, ExecutionStrategyParameters parameters) {
   <p></code></pre></p>
   <p>Notice we have lost type safety here.  In the past this would have only 
been <code>CompletableFuture&lt;FetchedValue&gt;</code> and hence been both 
type safe and async composable.</p>
   <p>Now the caller of that method has to handle the async case where it might 
be a <code>CompletableFuture&lt;FetchedValue&gt;</code> AND the materialised 
value case where it might be a <code>FetchedValue</code> but as most simple 
fields in GraphQL are in fact materialised values, this is worth the less clean 
code.</p>
   <p><code>DataFetchers</code> can of course continue to return 
<code>CompletableFuture</code> values and they will be handled in a polymorphic 
manner.</p>
   <p>The upshot of all this work is that the graphql-java engine allocated way 
less <code>CompletableFuture</code> values and hence reduces the amount of 
memory used.</p>
   <h2>Instrumentation Changes</h2>
   <!-- raw HTML omitted -->
   </blockquote>
   <p>... (truncated)</p>
   </details>
   <details>
   <summary>Commits</summary>
   <ul>
   <li><a 
href="https://github.com/graphql-java/graphql-java/commit/0eec91ea4b40a25a407efaf32d4fa9cfac9e4c93";><code>0eec91e</code></a>
 Merge pull request <a 
href="https://redirect.github.com/graphql-java/graphql-java/issues/3551";>#3551</a>
 from jbellenger/jbellenger-validate-dir-args</li>
   <li><a 
href="https://github.com/graphql-java/graphql-java/commit/c4df085442c1c5b43995ad41cb7e1f271aef0994";><code>c4df085</code></a>
 Merge pull request <a 
href="https://redirect.github.com/graphql-java/graphql-java/issues/3567";>#3567</a>
 from graphql-java/dependabot/github_actions/gradle/w...</li>
   <li><a 
href="https://github.com/graphql-java/graphql-java/commit/2cf3cc091913ec3689b543e2019b37e0d9e8ba10";><code>2cf3cc0</code></a>
 Merge pull request <a 
href="https://redirect.github.com/graphql-java/graphql-java/issues/3566";>#3566</a>
 from graphql-java/dependabot/gradle/org.testng-testn...</li>
   <li><a 
href="https://github.com/graphql-java/graphql-java/commit/1d783266ddbef861ed133f0410da19f51e9a279b";><code>1d78326</code></a>
 Merge pull request <a 
href="https://redirect.github.com/graphql-java/graphql-java/issues/3565";>#3565</a>
 from graphql-java/strict-mode-runtime-wiring</li>
   <li><a 
href="https://github.com/graphql-java/graphql-java/commit/207bb83b543c8134633d800450eabbc6a0edf391";><code>207bb83</code></a>
 Bump gradle/wrapper-validation-action from 2 to 3</li>
   <li><a 
href="https://github.com/graphql-java/graphql-java/commit/9f613a6f3f45c3f659b55caab95678ab3a9b3331";><code>9f613a6</code></a>
 Bump org.testng:testng from 7.10.0 to 7.10.1</li>
   <li><a 
href="https://github.com/graphql-java/graphql-java/commit/bb82efb811aec223448f312ef706b7c7856c35a2";><code>bb82efb</code></a>
 Better testing</li>
   <li><a 
href="https://github.com/graphql-java/graphql-java/commit/5a53ec4d339c206ce1ea1ec1f5b62ce6d131af6d";><code>5a53ec4</code></a>
 strictMode for RuntimeWiring and TypeRuntimeWiring</li>
   <li><a 
href="https://github.com/graphql-java/graphql-java/commit/7f13678fc68d8001c044568551d2ac2c90c9e848";><code>7f13678</code></a>
 Merge pull request <a 
href="https://redirect.github.com/graphql-java/graphql-java/issues/3564";>#3564</a>
 from graphql-java/add-dataloader-3.3.0</li>
   <li><a 
href="https://github.com/graphql-java/graphql-java/commit/b2dc5107d61f31d85f7ac8922e3ac38f88c1158a";><code>b2dc510</code></a>
 Dataloader 3.3.0</li>
   <li>Additional commits viewable in <a 
href="https://github.com/graphql-java/graphql-java/compare/v21.5...v22.0";>compare
 view</a></li>
   </ul>
   </details>
   <br />
   
   
   [![Dependabot compatibility 
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.graphql-java:graphql-java&package-manager=maven&previous-version=21.5&new-version=22.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-automerge-start)
   [//]: # (dependabot-automerge-end)
   
   ---
   
   <details>
   <summary>Dependabot commands and options</summary>
   <br />
   
   You can trigger Dependabot actions by commenting on this PR:
   - `@dependabot rebase` will rebase this PR
   - `@dependabot recreate` will recreate this PR, overwriting any edits that 
have been made to it
   - `@dependabot merge` will merge this PR after your CI passes on it
   - `@dependabot squash and merge` will squash and merge this PR after your CI 
passes on it
   - `@dependabot cancel merge` will cancel a previously requested merge and 
block automerging
   - `@dependabot reopen` will reopen this PR if it is closed
   - `@dependabot close` will close this PR and stop Dependabot recreating it. 
You can achieve the same result by closing it manually
   - `@dependabot show <dependency name> ignore conditions` will show all of 
the ignore conditions of the specified dependency
   - `@dependabot ignore this major version` will close this PR and stop 
Dependabot creating any more for this major version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this minor version` will close this PR and stop 
Dependabot creating any more for this minor version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this dependency` will close this PR and stop 
Dependabot creating any more for this dependency (unless you reopen the PR or 
upgrade to it yourself)
   
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to