Prisma1: Also return relational data in delete mutations

Created on 4 May 2018  路  9Comments  路  Source: prisma/prisma1

Current behavior

Delete mutations don't return relation data.

Reproduction

type A {
  id: ID! @unique
  title: String
  b: B
}

type B {
  id: ID! @unique
  title: String
  a: A
}
mutation a {
  createA(data: {
    title: "A"
    b: {
      create: {
        title: "B"
      }
    }
  }) {
    id
  }
}

mutation b {
  deleteA(where: { id: "ID" } ) {
    id
    # b is null
    b { 
      id 
    }
  }
}

Expected behavior?

The node b is returned, instead of null, in the previous example.

Workaround

In your GraphQL Server, you can follow this pattern as a workaround for now:

  1. query node + related data
  2. delete node
kinfeature

Most helpful comment

Can this be reopened?

All 9 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Can this be reopened?

Is there any progress on this?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

Issue seems to be still unsolved.

Still seems to be problem

Still unsolved.

Experiencing the same. I cannot get relational data during a delete with SET_NULL relations.

It's still there

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sedubois picture sedubois  路  3Comments

schickling picture schickling  路  3Comments

schickling picture schickling  路  3Comments

AlessandroAnnini picture AlessandroAnnini  路  3Comments

hoodsy picture hoodsy  路  3Comments