smallrye-graphql icon indicating copy to clipboard operation
smallrye-graphql copied to clipboard

EventingService.afterDataFetch called with wrong context on multi field query

Open computerlove opened this issue 2 years ago • 1 comments

For a query

query q135 {
  operation1
  operation3
  operation5
}

The execution order in a EventingService seems to look like this(ExecutionId=145725331828):

LoggingEventservice beforeExecute 145725331828
LoggingEventservice beforeDataFetch operation1 145725331828
Resource operation1
LoggingEventservice beforeDataFetch operation3 145725331828
Resource operation3
LoggingEventservice beforeDataFetch operation5 145725331828
Resource operation5
Resource Done operation3
LoggingEventservice afterDataFetch operation5 145725331828
Resource Done operation1
LoggingEventservice afterDataFetch operation5 145725331828
Resource Done operation5
LoggingEventservice afterDataFetch operation5 145725331828
LoggingEventservice afterExecute 145725331828

Changing the order of operations in the query changes the context fieldname called first, it looks like the context of the last operation in the query always is the context used in afterDataFetch.

I have updated the reproducer for issue 1455, the log above is from a run of the reproducer.

computerlove avatar Dec 21 '23 10:12 computerlove

This does look wrong. I can try to have a look into it after the Christmas break.

jmartisk avatar Dec 22 '23 12:12 jmartisk

https://github.com/smallrye/smallrye-graphql/pull/2085 should fix this

jmartisk avatar Apr 15 '24 05:04 jmartisk