Tag: graphql graphql js

graphQL – types必须是输出types

我正在尝试使用express和mongoose graffiti来设置graphQL路由。 但是,我得到以下错误: Error: myColl.myField field type must be Output Type but got: undefined. at invariant (/Users/nha/…/node_modules/graphql/jsutils/invariant.js:20:11) at /Users/nha/…/node_modules/graphql/type/definition.js:299:39 在type : Schema.Types.ObjectId模式中,types是: type : Schema.Types.ObjectId 。 是否应该改变其他的东西? 我应该注意的版本是: "@risingstack/graffiti": "^1.0.2" "@risingstack/graffiti-mongoose": "^3.1.1" "mongoose": "~3.6.20"