這是我的EventAttendee對象。graphQL中的對象突變
const EventAttendee = new GraphQLInputObjectType({
name: 'EventAttendee',
fields:() => ({
attendeeName: {type: GraphQLString},
personalizedDateSelection: {type: new GraphQLInputObjectType()}
})
});
的personalizedDateSelection屬性是一個動態的和它的性質不會現在已知的。所以,在這種情況下,我已經給出了GraphQLInputObjectType()。
但它給出了一個錯誤,說明EventAttendee.personalizedDateSelection字段類型必須是輸出類型。
如何定義其屬性未知的ObjectType?