我在玩GraphQL和Spring,但是我在这个问题上被困了一段时间。
首先,这是我的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,一个仓库,服务,变形器和一个对它的查询。在/resources中,我有一个带有模式的dogs.graphqls。
但出于某种原因,我无法启动这个应用程序。错误消息是:No graphql schema files found on classpath with location pattern '**/*.graphqls'。当我将依赖项移除到com.graphql-java-kickstart:graphql-spring-boot-starter时,它将启动,但找不到模式。
有什么想法吗?
发布于 2019-10-26 15:24:14
我用以下方法改变了kickstarter的依赖关系:
compile group: 'com.graphql-java', name: 'graphql-spring-boot-starter', version: '5.0.2'
compile group: 'com.graphql-java', name: 'graphql-java-tools', version: '5.2.4'
compile group: 'com.graphql-java', name: 'graphiql-spring-boot-starter', version: '3.0.3':
发布于 2020-08-09 18:48:38
在pom.xml中包括以下代码:
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.graphqls</include>
</includes>
</resource>发布于 2019-10-26 14:25:59
我有一个GraphQL spring引导项目,我看到了两个不同之处:
resources/graphql中--可能与类似的问题。
查看一下- https://github.com/xShadov/code-hellven/blob/master/core/api/pom.xml -尝试使用类似的依赖项(不确定它是如何转换为gradle的):
<graphql.version>5.4.1</graphql.version>
<graphql-datetime-spring-boot-starter.version>1.4.0</graphql-datetime-spring-boot-starter.version>
<dependency>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphql-spring-boot-starter</artifactId>
<version>${graphql.version}</version>
</dependency>
<dependency>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphiql-spring-boot-starter</artifactId>
<version>${graphql.version}</version>
</dependency>
<dependency>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>voyager-spring-boot-starter</artifactId>
<version>${graphql.version}</version>
</dependency>
<dependency>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphql-java-tools</artifactId>
<version>${graphql.version}</version>
</dependency>
<dependency>
<groupId>com.zhokhov.graphql</groupId>
<artifactId>graphql-datetime-spring-boot-starter</artifactId>
<version>${graphql-datetime-spring-boot-starter.version}</version>
</dependency>https://stackoverflow.com/questions/58571479
复制相似问题