我是graphql的新手。我的API中有以下架构和Runtimewiring。下面的Runtimewiring中的模式定义和数据获取程序映射工作正常,我能够从API接收响应。
工作模式:
Schema {
query:Query
}
type Query{
prepaid(mobilenumbers:[String!]:[Prepaid]
postpaid(mobilenumbers:[String!]:[Postpaid]
}
type Prepaid{
customername:String
databalance:String
datavalidity:String
}
type Postpaid {
customername:String
databalance:String
amountdue:String
}
RunTime Wiring in my Java Code for DataFetchers Mapping :
return RuntimeWiring
.newRuntimeWiring()
.type("Query",
.typeWiring -> typeWiring
.dataFetcher("prepaid", getPrepaidDetails)
.dataFetcher("postpaid", getPostpaidDetails)
)
.build()
;
我想按如下所示修改架构结构,并且我也不想为“ ServiceType”使用任何datafetcher实现。我只希望“ ServiceType”更多地单独分组,并且仍然希望实现此架构结构。 但是上面给出的RuntimeWiring不适用于这种情况。
Modified Schema :
Schema {
query:Query
}
type Query{
ServiceType{
prepaid(mobilenumbers:[String!]:[Prepaid]
postpaid(mobilenumbers:[String!]:[Postpaid]
}
}
type Prepaid{
customername:String
databalance:String
datavalidity:String
}
type Postpaid {
customername:String
databalance:String
amountdue:String
}
您能否建议我如何为新架构构架运行时布线,在上述示例中,我将没有针对“ ServiceType”的数据提取程序实现。
谢谢