type User {
id: ID! @unique
email: String! @unique
# a list of people the user follows
follows: [User!]! @relation(name: "Follows")
# a list of people following this user
followers: [User!]! @relation(name: "Following")
}
So a user can follow other users and can have users follow them. Pretty simple. Our starting state for 3 users is:
Now, suppose my user (top one) follows the other two using the following code:
As you can see, unfollowing one user has resulted in the other user's followers connection to also be removed, while the follows connection of the user who initiated the action remains correct resulting in an invalid state.
Expected behavior
I'd expect the followers connection of the unrelated user in this transaction (John) to be unchanged.
Versions (please complete the following information):
Prisma version: 1.14.1
Prisma-binding version: 2.1.4
GraphQL version: 0.13.2
GraphQL Yoga version: 1.15.1
Suppose my data model is such:
So a user can follow other users and can have users follow them. Pretty simple. Our starting state for 3 users is:
Now, suppose my user (top one) follows the other two using the following code:
The result would be as you'd expect:
Now, here is where it goes wrong. I unfollow user Jane using the following code:
And the output is:
As you can see, unfollowing one user has resulted in the other user's
followers
connection to also be removed, while thefollows
connection of the user who initiated the action remains correct resulting in an invalid state.Expected behavior I'd expect the
followers
connection of the unrelated user in this transaction (John) to be unchanged.Versions (please complete the following information): Prisma version: 1.14.1 Prisma-binding version: 2.1.4 GraphQL version: 0.13.2 GraphQL Yoga version: 1.15.1
Additional information This bug looks like https://github.com/prisma/prisma/issues/2810 but I should be on a version of Prisma that's already fixed it.