【发布时间】:2021-01-09 22:49:10
【问题描述】:
我正在尝试获取以下简单查询:
{duel{id, players}}
我收到以下错误:
Field "players" of type "[User]" must have a selection of subfields. Did you mean "players { ... }
我的决斗类型结构:
const DuelType = new ObjectType({
name: 'Duel',
fields: () => ({
id: { type: new NonNull(ID) },
round_id: { type: IntType },
status: { type: StringType },
turn_of_user_id: { type: IntType },
winner: { type: StringType },
players: { type: new GraphQLList(UserType) },
}),
});
知道我错过了什么吗?
谢谢。
【问题讨论】:
标签: javascript node.js graphql graphql-js