Skip to content

What kind of Object will be passed to the InstrumentationContext returned by beginFieldExecution/beginFieldCompletion/beginFieldListCompletion? #3703

Answered by bbakerman
xenomachina asked this question in Q&A
Discussion options

You must be logged in to vote

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

In m…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@xenomachina
Comment options

Answer selected by xenomachina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants