首页 > 解决方案 > 带有弹簧靴而不是标准方案的 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] 作为最后一个参数),按优先级顺序:

标签: javaspringgraphql

解决方案


推荐阅读