我正在使用 GraphQL 和 Spring Boot,但我现在在这个问题上停留了一段时间。
首先,这是我的 build.gradle:
...
compile 'com.graphql-java-kickstart:graphql-spring-boot-starter:5.10.0'
compile group: 'com.graphql-java', name: 'graphql-java-tools', version: '5.2.4'
runtime 'com.graphql-java-kickstart:graphiql-spring-boot-starter:5.10.0'
...
我有一个实体,比方说 - Dog、存储库、服务、Mutator 和它的查询。在/resources 中,我有 dogs.graphqls
,其中包含架构。
但由于某种原因,我无法启动该应用程序。错误消息显示:在类路径上找不到位置模式为“**/*.graphqls”的 graphql 架构文件
。当我删除对 com.graphql-java-kickstart:graphql-spring-boot-starter 的依赖项时,它会启动,但找不到架构。
有什么想法吗?
最佳答案
在 pom.xml 中包含以下代码:
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.graphqls</include>
</includes>
</resource>
关于java - Spring Boot 与 GraphQL - 架构问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58571479/