0
我認爲這個問題是,在我的schema.js文件中的字段被稱爲比「ID」以外的東西,因爲該領域被稱爲別的東西在數據庫。relayjs和graphql錯誤:錯誤:「節點」期望場「ID」
var classroomType = new GraphQLObjectType({
name: 'Classroom',
description: 'A classroom in a school',
fields:() => ({
clid: globalIdField('Classroom'),
course: {
type: GraphQLString,
description: 'The course assigned to this classroom.'
},
enrollments: {
type: enrollmentConnection,
description: 'The students in a classroom',
args: connectionArgs,
resolve: (classroom, args) => connectionFromArray(classroom.enrollments.map(getEnrollment), args)
}
}),
interfaces: [nodeInterface],
});
gloablIdField是否被稱爲id
?這似乎很奇怪。如果是這樣,我怎麼從沒有叫id
數據庫映射,爲一個id字段?