java - 带有弹簧靴而不是标准方案的 Graphql
问题描述
我有很好的 graphql + spring boot 指南... https://github.com/swathisprasad/graphql-with-spring-boot
和 web 有很多这样的模板。
告诉我如何正确编写解析器,如果标准方案如下所示
schema {
query: QueryTest
mutation: Mutation
}
type QueryTest {
vehicleQuery: VehicleQuery
}
type VehicleQuery{
vehicles(count: Int):[Vehicle]
vehicle(id: ID):Vehicle
}
type Vehicle {
id: ID!,
type: String,
modelCode: String,
brandName: String,
launchDate: String
}
type Query {
vehicles(count: Int):[Vehicle]
vehicle(id: ID):Vehicle
}
type Mutation {
createVehicle(type: String!, modelCode: String!, brandName: String, launchDate: String):Vehicle
}
我的回购https://github.com/knizamiev/graphql-example
现在我有错误
造成的:
com.coxautodev.graphql.tools.FieldResolverError:未找到具有以下任何签名的方法或字段(有或没有 [interface graphql.schema.DataFetchingEnvironment] 作为最后一个参数),按优先级顺序:
解决方案
推荐阅读
- c# - 带有 Angular 12 的 .NET Core 2.2 - 在我重新编译之前不会加载站点
- google-cloud-platform - 在 terraform 中向 GCP 进行身份验证
- kotlin - 将具有列表的对象映射到具有列表的另一个对象
- python - 并非所有参数都在 SQL 语句中使用 - Python MySQL
- java - 使用 Flux 从服务中无限拉取
- javascript - 让按钮从关闭状态变为开启状态
- python - Python - 网络抓取中的列表超出范围错误
- scala - 多单元文件应该用小驼峰命名吗?
- python - 如何在传递给函数/方法的参数中记录可接受的字典键?
- elasticsearch - Confluent Platform 中的 Elastic-sink 连接器是否适用于弹性云?