在本例中为https://graphql.org/graphql-js/constructing-types/
我们有没有可能实现类型引用回到它的根|父类型?(manager字段类型回指userType)
var userType = new graphql.GraphQLObjectType({
name: 'User',
fields: {
id: { type: graphql.GraphQLString },
name: { type: graphql.GraphQLString },
manager: { type: userType },
}
});发布于 2019-01-22 01:59:33
返回字段,因为Thunk解决了我的问题。
var userType = new graphql.GraphQLObjectType({
name: 'User',
fields: ()=> {
return {
id: { type: graphql.GraphQLString },
name: { type: graphql.GraphQLString },
manager: { type: userType }
}
}
});https://stackoverflow.com/questions/54294928
复制相似问题