String schemaBeanName = "graphQLSchema";
try {
if (defaultListableBeanFactory.containsBean(schemaBeanName)) {
defaultListableBeanFactory.destroySingleton(schemaBeanName);
}
} catch (NoSuchBeanDefinitionException e) {
log.warn("NoSuchBeanDefinitionException,beanName={}", schemaBeanName);
}
try {
graphQLSchema = this.buildSchemaByConfig();
defaultListableBeanFactory.registerSingleton(schemaBeanName, graphQLSchema);
} catch (IllegalStateException e) {
log.error("buildGraphQLSchema fail,error={}", e);
}
@Autowired
private GraphQLSchema graphQLSchema;