and this is my nodejs code ``` async addProduct(...
# orm-help
w
and this is my nodejs code
Copy code
async addProduct(parent, args, context) {
    const productExists = await context.prisma.$exists.product({
      id: args.productId
    });
    const siteExists = await context.prisma.$<http://exists.site|exists.site>({
      id: args.siteId
    });
    console.log(productExists, siteExists);
    return context.prisma.updateProduct({
      data: {
        sites: {
          connect: {
            id: args.siteId
          }
        }
      },
      where: {
        id: args.productId
      }
    });
  },
j
return context.prisma.updateProduct({
Should this be
return context.prisma.createProduct({
?
w
the product is already created
im trying to link a created product to a created site within a many to many relation
h
You will require to resolve sites on the produce field
add this to your resolvers
Copy code
const resolvers = {
  Products: {
    sites: (parent, args, ctx) => ctx.prisma.product({ id: parent.id }).sites()
  }
};
w
@Harshit thank you so much!! its working now!!
h
Let me know if you have any other questions 🙂, you can also DM me anytime
w
thanks!!!