0

启动与 graphql 相关的 Spring Boot 应用程序时出现异常。我是 graphql 的新手并且已经实现了一个示例,并且在尝试测试和启动服务器时出现以下错误。我很困惑,因为我已经实现了所有东西,包括我的 gradle 中的依赖项,但仍然看到这个问题并且不确定是什么原因造成的?

private final GraphQL graphQL;

private final GraphQLValidator graphQLValidator;



@Autowired
public GraphQLServiceImpl(GraphQLProviderResolver graphQLProviderResolver, GraphQLValidator graphQLValidator) {


    SchemaParserBuilder schemaParserBuilder = SchemaParser.newParser().scalars(new GraphQLDate()).file("myschema.graphql").
            resolvers(graphQLProviderResolver);
    SchemaParser schemaParser = schemaParserBuilder.build();

    GraphQLSchema schema = schemaParser.makeExecutableSchema();

    GraphQL.Builder graphQLBuilder = GraphQL.newGraphQL(schema);


    this.graphQL = graphQLBuilder.build();
    this.graphQLValidator = graphQLValidator;

}

   //BELOW HOW I EXECUTE THE QUERY FROM THE SCHEMA (THIS IS IN ANOTHER METHOD)
    ExecutionInput executionInput = new ExecutionInput(graphQLRequest.getQuery(), graphQLRequest.getOperationName(),
            null, null,
            graphQLRequest.getVariablesMap());

    ExecutionResult result = graphQL.execute(executionInput);

//graphql GRADLE DEPENDENCY
compile ('com.graphql-java:graphql-spring-boot-starter:5.0.2')
compile ('com.graphql-java:graphql-java-tools:5.2.4')    

错误失败","logger_name":"org.springframework.boot.SpringApplication","thread_name":"main","level":"ERROR","level_value":40000,"stack_trace":"java.lang.IllegalStateException : com.oembedler.moon.graphql.boot.GraphQLWebAutoConfiguration.graphQLSchemaProvider 上的错误处理条件\n\tat org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64)\n\tat org.springframework。 context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102)\n\tat org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:178)\n\tat org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader。loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140)\n\tat org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)\n\tat org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:第333章org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)\n\tat org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)\n\tat org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebA pplicationContext.java:118)\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)\n\tat org.springframework.boot .SpringApplication.createAndRefreshContext(SpringApplication.java:361)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:307)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1191 )\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)\n\tat com.mycom。link.app.Application.main(Application.java:42)\n原因:java.lang.IllegalArgumentException:@ConditionalOnMissingBean 注解必须指定至少一个 bean(类型、名称或注解)\n\tat org.springframework.util。 Assert.isTrue(Assert.java:68)\n\tat org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:279)\n\tat org.springframework.boot.autoconfigure.condition。 OnBeanCondition$BeanSearchSpec.(OnBeanCondition.java:275)\n\tat org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:111)\n\tat org.springframework.boot.autoconfigure.condition.SpringBootCondition .matches(SpringBootCondition.java:47)\n\t... 17个常用帧省略@ConditionalOnMissingBean 注解必须指定至少一个 bean(类型、名称或注解)\n\tat org.springframework.util.Assert.isTrue(Assert.java:68)\n\tat org.springframework.boot.autoconfigure.condition。 OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:279)\n\tat org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.(OnBeanCondition.java:275)\n\tat org.springframework.boot.autoconfigure.condition .OnBeanCondition.getMatchOutcome(OnBeanCondition.java:111)\n\tat org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)\n\t... 17 常见帧省略@ConditionalOnMissingBean 注解必须指定至少一个 bean(类型、名称或注解)\n\tat org.springframework.util.Assert.isTrue(Assert.java:68)\n\tat org.springframework.boot.autoconfigure.condition。 OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:279)\n\tat org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.(OnBeanCondition.java:275)\n\tat org.springframework.boot.autoconfigure.condition .OnBeanCondition.getMatchOutcome(OnBeanCondition.java:111)\n\tat org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)\n\t... 17 常见帧省略OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:279)\n\tat org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.(OnBeanCondition.java:275)\n\tat org.springframework.boot.autoconfigure.condition .OnBeanCondition.getMatchOutcome(OnBeanCondition.java:111)\n\tat org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)\n\t... 17 常见帧省略OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:279)\n\tat org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.(OnBeanCondition.java:275)\n\tat org.springframework.boot.autoconfigure.condition .OnBeanCondition.getMatchOutcome(OnBeanCondition.java:111)\n\tat org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)\n\t... 17 常见帧省略

4

0 回答 0