在配置的位置下找不到任何 GraphQL 模式文件 - SpringBoot 、 GraphQL

tor*_*don 1 spring-boot graphql

我正在尝试使用 GraphQL 在 spring-boot 上运行空项目,但出现以下错误。

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/**/)
Run Code Online (Sandbox Code Playgroud)

依赖项:

  • spring-boot-starter-graphql
  • spring-boot-启动器-web

方案 - /resources/schema.graphqls

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

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

type Author {
  id: ID
  firstName: String
  lastName: String
}
Run Code Online (Sandbox Code Playgroud)

是否有配置错误?

小智 7

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