我尝试在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
}
是否存在配置错误?
2条答案
按热度按时间5lwkijsr1#
看起来你应该将位置路径更改为
46scxncf2#
将文件重命名为schema.graphql将文件重命名为schema.graphqls