-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When I use the plugin and define id as a relayGlobalId field, it results in a type error stating that "id" is not found on the object. If I use the model ID instead of relay (uncomment line below), there is no type error, but the id is obviously not relay-compliant. I'm not sure if this is related to graphql-nexus/nexus#36 (see comment), but is there any way to get nexus to realize the id does exist on the root type?
const Task = objectType({
name: TaskModel.$name,
definition: (t) => {
t.implements('Node')
t.relayGlobalId('id', {})
// t.field(TaskModel.id.name, TaskModel.id)
t.connectionField('comments', {
type: 'Comment',
resolve: async (src, args, ctx, info) => {
const comments = db.comment.find({
where: {
taskId: src.id, // <==== TypeError Here
},
})
},
})
},
})Metadata
Metadata
Assignees
Labels
No labels