Lobo
11/21/2018, 9:40 AMtype Video {
id: ID! @unique
title: String!
tags: [Tag!]!
}
with the mutation:
createVideo(
title: String!,
tagsIds: [ID!],
): Video!
and this is what I have right now in the resolver... I've tried several things
createVideo: (root, args, context, info) => {
return context.db.mutation.createVideo({
data: {
title: args.title,
tags: {
connect: {
id: args.tagsIds
}
},
},
}, info)
},
},
This is what I'm sending, the two IDs I'm sending are tags that exist on database:
mutation {
createVideo(
title: "Neehar Venugopal - A Beginner's Guide to Code Splitting Your React App - React Conf 2017"
tagsIds: ["cjoopece2000a0899n8jsjkr4", "cjoo9e0eq004d0824nibmtzl2"],
) {
id
}
}
probably missing something basic... but I haven't found much information about how to send a group of IDs related to another table
any help will be appreciated 🙂
and this is the error I'm getting, by the way...
Expected type ID at value.id; ID cannot represent value: ["cjoopece2000a0899n8jsjkr4", "cjoo9e0eq004d0824nibmtzl2"]
nikolasburk
nikolasburk
Lobo
11/21/2018, 9:44 AMLobo
11/21/2018, 9:45 AMnikolasburk
prisma.createVideo({
title: "Neehar Venugopal - A Beginner's Guide to Code Splitting Your React App - React Conf 2017",
tags: {
connect: [{
id: "cjoopece2000a0899n8jsjkr4",
id: "cjoo9e0eq004d0824nibmtzl2"
}]
}
})
Lobo
11/21/2018, 9:53 AMnikolasburk
Lobo
11/21/2018, 9:54 AMLobo
11/21/2018, 9:54 AMnikolasburk
args.tagsIds
to the structure that I showed in the code snippet 🙂Lobo
11/21/2018, 9:55 AMLobo
11/21/2018, 9:55 AM