我正在尝试使用与Relay兼容的GraphQL架构设置node.js服务器.
尝试验证或加载架构时,我收到以下错误:
EventEdge.node field type must be Output Type but got: undefined.
这是由于在其他类型定义之一中为Event类型提供了连接类型.
我不会发布整个架构,因为它非常详细,但是当连接字段被注释掉时,架构被正确加载并且不会抛出任何错误.
我已经包含了导致相同问题的简化模式的示例:
const graphql = require('graphql')
const relay = require('graphql-relay')
const GraphQLID = graphql.GraphQLID,
GraphQLInt = graphql.GraphQLInt,
GraphQLString = graphql.GraphQLString,
GraphQLList = graphql.GraphQLList,
GraphQLObjectType = graphql.GraphQLObjectType,
GraphQLSchema = graphql.GraphQLSchema,
GraphQLNonNull = graphql.GraphQLNonNull
const connectionArgs = relay.connectionArgs,
connectionDefinitions = relay.connectionDefinitions,
connectionFromArray = relay.connectionFromArray,
cursorForObjectInConnection = relay.cursorForObjectInConnection,
fromGlobalId = relay.fromGlobalId,
globalIdField = relay.globalIdField,
mutationWithClientMutationId = relay.mutationWithClientMutationId,
nodeDefinitions = relay.nodeDefinitions,
toGlobalId = relay.toGlobalId
// Models (ORM Mappings)
const models = …Run Code Online (Sandbox Code Playgroud)