Jarand
01/17/2018, 4:19 PMpush
a new node on a to-many relation? For example i want to add a relation from a -> b, butI still want the a->c connection. Now it overwrites the existing relations.Jarand
01/17/2018, 4:21 PMmutation {
updatePost(id: "1", lastReaction: "17:32",
reactions: [{text: "new reation"}]) {
id
}
}
Jarand
01/17/2018, 4:22 PMreactions
Jonathan Romano
01/17/2018, 9:03 PMconnect
might do that, but I'm sureJonathan Romano
01/17/2018, 9:07 PMmutation {
updatePost(id: "1", lastReaction: "17:32",
reactions: {
# If you want to use an existing reaction
connect: [{id: "reactionid"}]
# If you want to create a new reaction
create: [{text: "text"}]
}) {
id
}
}
Just suggesting this based on what I see here: https://www.prismagraphql.com/docs/reference/prisma-api/mutations-ol0yuoz6go#examplesJarand
01/17/2018, 10:10 PMJonathan Romano
01/17/2018, 10:23 PMJonathan Romano
01/17/2018, 10:23 PMJarand
01/17/2018, 10:33 PMJonathan Romano
01/17/2018, 10:33 PMJonathan Romano
01/17/2018, 10:34 PMJonathan Romano
01/17/2018, 10:35 PMreactions
is a many to many field, so specifically this: https://www.graph.cool/docs/reference/graphql-api/mutation-api-ol0yuoz6go#modifying-edges-for-many-to-many-relationsJarand
01/17/2018, 10:36 PM