我正在努力寻找清楚这一点的文档:我可以在定义类型时在同一个模式文档中扩展类型吗?我不断收到如下错误:
Error: Cannot extend type "Healthcheck" because it is not defined.
at assertValidSDL (/Users/rhys.evans/Projects/or/biz-ops-api/node_modules/graphql/validation/validate.js:80:11)
at Object.buildASTSchema (/Users/rhys.evans/Projects/or/biz-ops-api/node_modules/graphql/utilities/buildASTSchema.js:69:34)
at Object.buildSchemaFromTypeDefinitions (/Users/rhys.evans/Projects/or/biz-ops-api/node_modules/graphql-tools/dist/generate/buildSchemaFromTypeDefinitions.js:23:28)
at makeExecutableSchema (/Users/rhys.evans/Projects/or/biz-ops-api/node_modules/graphql-tools/dist/makeExecutableSchema.js:26:29)
at makeAugmentedExecutableSchema (/Users/rhys.evans/Projects/or/biz-ops-api/node_modules/neo4j-graphql-js/dist/augment.js:75:49)
at makeAugmentedSchema (/Users/rhys.evans/Projects/or/biz-ops-api/node_modules/neo4j-graphql-js/dist/index.js:232:53)
at createSchema (/Users/rhys.evans/Projects/or/biz-ops-api/server/data/graphql-schema.js:36:17)
at EventEmitter.constructAPI (/Users/rhys.evans/Projects/or/biz-ops-api/server/routes/graphql.js:19:21)
at emitOne (events.js:121:20)
at EventEmitter.emit (events.js:211:7)
架构文档:
directive @deprecated(
reason: String = "No longer supported"
) on FIELD_DEFINITION | ENUM_VALUE | ARGUMENT_DEFINITION
type Healthcheck {
code: String
}
type Check {
name: String
}
extend type Healthcheck {
checks: [Check]
}
我想这是不允许的,但任何人都可以指出规范/其他文档明确说明的地方吗?