【发布时间】:2022-10-25 19:01:47
【问题描述】:
我有一个带有 Spring for GraphQL 库的 Spring Boot 应用程序,我需要修改返回的对象。所以我创建并注册了一个引用我的 bean 方法的投影类:
public interface MyEntityProjection {
@Value("#{@myBean.getName()}")
public String getName();
}
但这会在运行查询时产生org.springframework.expression.spel.SpelEvaluationException: EL1057E: No bean resolver registered in the context to resolve access to bean 'myBean'。可能需要以某种方式注册 bean 解析器,但文档中没有信息 https://docs.spring.io/spring-graphql/docs/1.0.0-SNAPSHOT/reference/html/
说明我的问题的简单应用程序:https://github.com/omichal/spring-graphq-no-bean-resolver
【问题讨论】:
标签: spring-graphql