Open
Description
Since update to 3.1.0 version (previous was 13.0.2)
Description
There is class, that union Mutation and Subscription resolver interfaces
@Component
public class UserAttributeMutation implements GraphQLMutationResolver, GraphQLSubscriptionResolver {
Expected behavior
FieldResolverScanner can find all methods
Actual behavior
FieldResolverScanner resolves only subscription method
Steps to reproduce the bug
It happens because there in following method
private fun getAllMethods(search: Search): List<Method> {
val type = search.type.unwrap()
val declaredMethods = type.declaredNonProxyMethods
val superClassesMethods = ClassUtils.getAllSuperclasses(type).flatMap { it.methods.toList() }
val interfacesMethods = ClassUtils.getAllInterfaces(type).flatMap { it.methods.toList() }
return (declaredMethods + superClassesMethods + interfacesMethods)
.asSequence()
.filter { !it.isSynthetic }
.filter { !Modifier.isPrivate(it.modifiers) }
// discard any methods that are coming off the root of the class hierarchy
// to avoid issues with duplicate method declarations
.filter { it.declaringClass != Object::class.java }
// subscription resolvers must return a publisher
.filter { search.source !is GraphQLSubscriptionResolver || resolverMethodReturnsPublisher(it) }
.toList()
}
was added new filter
.filter { search.source !is GraphQLSubscriptionResolver || resolverMethodReturnsPublisher(it) }
So, all methods, that not return Publisher are ignored
Activity
oryan-block commentedon Nov 9, 2023
Related to: #756
bostandyksoft commentedon Mar 19, 2024
Hi. What about this bug?
oryan-block commentedon Mar 19, 2024
No updates yet.