What kind of Object will be passed to the InstrumentationContext returned by beginFieldExecution/beginFieldCompletion/beginFieldListCompletion? #3703
-
We're migrating from graphql-java 21.5 to 22.1. The Instrumentation interface has changed quite a bit, and I'm having some trouble figuring out the correct way to migrate some of the methods. I looked at #3609, which primarily talks about The three methods I'm trying to figure out, along with what I think are their replacements, are:
In all three of these cases, aside from the name changing, the (only) other change was the return type switching from In my implementations of these methods I was using implementations of Now that the new methods return an |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We made this breaking change for performance reasons. We looked at the code and if we fetched some value (say a scalar like a String or an object or list say) we would wrap it into an The engine would then "unwrap" that Needless to say this was not efficient and in 22 we decided to bite the bullet and break the Instrumentation contract as well as other places in the engine. So the object you get back is the object fetched for that field. A scalar, or object or list. This is the same object if before you did
So where you called |
Beta Was this translation helpful? Give feedback.
We made this breaking change for performance reasons. We looked at the code and if we fetched some value (say a scalar like a String or an object or list say) we would wrap it into an
ExecutionResult
and pass it back into the engine.The engine would then "unwrap" that
ExecutionResult
to get the data value. We would do this for all values in all objects and lists.Needless to say this was not efficient and in 22 we decided to bite the bullet and break the Instrumentation contract as well as other places in the engine.
So the object you get back is the object fetched for that field. A scalar, or object or list. This is the same object if before you did
graphql.ExecutionResult#getData