Prisma: using set on relationship


#1

According to the docs, set should override an existing list with an entirely new list. Does this work on relationships, as well? It doesn’t seem to be working for me:

ctx.db.mutation.updateRequest(
  {
    where: { id },
    data: {
      title,
      description,
      fields: {
        set: [...fields]
      }
    }
  },
  info
);

Field "set" is not defined by type FieldUpdateManyInput at value.fields; did you mean upsert? (edited)


#2

No, this is currently not supported for relations.

I created a feature request for this, would love to hear your input :slight_smile:


#3

The set method is generated in the type?