Graphql输入扩展了一个类型
我必须在模式中声明几个对象模型作为类型和输入Graphql输入扩展了一个类型,graphql,apollo,Graphql,Apollo,我必须在模式中声明几个对象模型作为类型和输入 type Agreement { id: Int agmtCategCd: String agmtSubcategyCd: String } input AgreementInput { id: Int agmtCategCd: String agmtSubcategyCd: String } 正如您所看到的,AgreementInput和Agreement的主体完全相同 我想避免重复代码。有没有办
type Agreement {
id: Int
agmtCategCd: String
agmtSubcategyCd: String
}
input AgreementInput {
id: Int
agmtCategCd: String
agmtSubcategyCd: String
}
正如您所看到的,AgreementInput和Agreement的主体完全相同
我想避免重复代码。有没有办法避免这种情况?比如说
AgreementInput extends Agreement
或
这个问题可能重复的问题以前已经被问过很多次了。归根结底,GraphQL本身并不支持任何类型的继承。不过,还有一些库可以添加该功能(请参见上面的链接)
input AgreementInput = Agreement