You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 197edbd
Browse filesBrowse the repository at this point in the historyBrowse files
Fix suspend resolver context and Kotlin extension resolvers
A suspend resolver taking GraphQLContext or the custom context class as
its last argument failed at runtime with "argument type mismatch".
MethodFieldResolver picked the type of the last JVM parameter to decide
what to pass, but for a suspend function that is the Continuation, so it
fell through to passing the DataFetchingEnvironment. It now looks at the
last counted parameter instead.
Kotlin extension functions in a GraphQLResolver could not be used as
resolver methods because parameters were counted with
kotlinFunction.valueParameters, which leaves out the extension receiver.
They were either skipped or matched with the wrong arity and failed at
runtime. FieldResolverScanner and MethodFieldResolver now count every
parameter except the instance, which matches the JVM parameters minus
the Continuation, so the receiver takes the source object.
An extension receiver is only accepted in that source position.
Extension helpers on root resolvers and data classes used to be matched
when their arity happened to fit, and then either collided with the
real resolver method at build time or failed with the wrong number of
arguments at query time. They are now skipped during matching.
Fixes#318Fixes#272
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0 commit comments