Hook to signal when execution exhausted synchronous processing #2715
Replies: 4 comments 11 replies
-
We dont have a hook callback method for this. This is a really trick problem because as you have shown, your need to track the completion state of each field in a multi level way We kinda do this in We literally track when things have been dispatched (but not cmopleted). When all fields on a level are dispatched we call now this is not exactly what you have asked for. You asked about field completion. The above is very much like that except it would need to track a field being completed. In short we dont have what you have asked for. Can I ask a reverse question - what would you do if you know if a certain set of fields (or tree branches) as complete? |
Beta Was this translation helpful? Give feedback.
-
Hello @bbakerman, just circling back here, good news, at ExpediaGroup we were able to build a custom instrumentation that applies the we didn't stoped there and we tried to solve the problem that originated this discussion which is keeping track of the state of each execution strategy associated with an execution input, and we were able to dispatch the DataLoaderRegistry when all paths of the AST where synchronously exhausted, this means executed everything up to leafs or fields which dataFetchers return a completable future. ExpediaGroup/graphql-kotlin#1419 So far we have tested plenty of use cases and all of there are working, we were wondering if this code could actually be part of |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I'm interested in what is required to change in Our team has run into the same issue where given CompleteableFuture<Invoice> cf1 = invoiceDL.loadKey(invoiceId)
CompleteableFuture<User> cf2 = cf1.thenApply( invoice -> userDL.loadKey(invoice.approverId));
return cf2.thenApply( user -> combineIvoiceAndUser(invoice,user));
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i was wondering, if there is a way using the existing instrumentation hooks, to signal when an execution of a GraphQL operation exhausted all synchronous procedures ?
i mean, when an operation have been resolved up to scalars and dispatched completableFutures.
Example:

in the above query
nasa
field is an object that resolves synchronously, then a new execution strategy is used to descend, it findsastronaut
which data fetcher returns a completable future (i control when to complete it), concurrently the fieldsaddress
andphoneNumber
will try to be resolved,address
being complex object andphoneNumber
being an scalar. Then a new execution strategy will be applied toaddress
which will resolvestreet
andzipCode
both scalars.At this point all "sync" procedures were exhausted, and completable future of
astronaut
is still pending.wondering if there is as way to signal this moment using existing hooks ?
Beta Was this translation helpful? Give feedback.
All reactions