java 在配置的位置- SpringBoot、GraphQL下找不到任何GraphQL架构文件

beq87vna  于 2023-01-07  发布在  Java
关注(0)|答案(2)|浏览(171)

我尝试在Spring-boot上使用GraphQL运行空项目,但我遇到以下错误。

2022-01-03 12:33:11.440 ERROR 12944 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Could not find any GraphQL schema file under configured locations.

Action:

Check that the following locations contain schema files: 
- '' (classpath:graphql/**/)

依赖关系:

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-graphql</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

方案:/资源/方案。图形:

type Query {
  bookById(id: ID): Book
}

type Book {
  id: ID
  name: String
  pageCount: Int
  author: Author
}

type Author {
  id: ID
  firstName: String
  lastName: String
}

是否存在配置错误?

5lwkijsr

5lwkijsr1#

看起来你应该将位置路径更改为

classpath:/**/
46scxncf

46scxncf2#

将文件重命名为schema.graphql将文件重命名为schema.graphqls

相关问题