title: How can I delete items with relations?
body: <p>I'm using prisma2, and I don't know how to delete items having relations with other models.</p>
  
  <p>This is my models.</p>
  
  <pre><code>model User {
    id       String @default(cuid()) @id
    email    String @unique
    password String
    name     String
  
    teams       Team[]
    memberships Membership[]
  }
  
  model Team {
    id        String   @default(cuid()) @id
  
    name        String
    founder     User?
    memberships Membership[]
  }
  
  model Membership {
    id        String   @default(cuid()) @id
  
    class    String
  
    owner User
    team  Team
  }
  </code></pre>
  
  <p>User-Team is 1:n relationship.
  Team-Membership is 1:n relationship.</p>
  
  <p>And I wanna delete a Team.</p>
  
  <p>I've tried this.</p>
  
  <pre><code>t.list.field("deleteTeam", {
    type: "Team",
    args: {
      teamid: idArg()
    },
    resolve: (_, { teamid }, ctx) =&gt; {
      return ctx.photon.teams.deleteMany({
        where: { id: teamid }
      });
    }
  });
  </code></pre>
  
  <p>But it doensn't work because it violates relation.</p>
  
  <p>How can I delete team with disconnecting all the relations at the same time?</p>