When executing a transaction the current implementation queries for returned edges after the entire transaction has finished. This means that any intermediate edges queried will represent only the final state.
For example, assume the DB schema below:
type Blog {
text: String!
author: Blogger!
}
type Blogger {
name: String!
}
We create a Blog post using:
mutation {
createBlog(data: { text: "This is a blog post", author: { create: { name: "John Doe" } } }){
id
author {
id
name
}
}
}
which returns:
{
createBlog: {
id: "Blog/123",
author: {
id: "Blogger/123",
name: "John Doe"
}
}
}
Let's say we now update the Blog and Blogger in the same mutation request:
mutation {
updateBlog(id:"Blog/123", data: { text: "This blog has been updated!" }){
text
author: {
name
}
}
m1: updateBlogger(id:"Blogger/123", data: { name: "Alice" }){
name
}
m2: updateBlogger(id:"Blogger/123", data: { name: "Bob" }){
name
}
m3: updateBlogger(id:"Blogger/123", data: { name: "Charlie" }){
name
}
}
This will return:
{
updateBlog: {
text: "This blog has been updated!",
author: {
name: "Charlie" // should still be "John Doe"!
}
}
m1: { name: "Alice" },
m2: { name: "Bob" },
m3: { name: "Charlie" }
}
When executing a transaction the current implementation queries for returned edges after the entire transaction has finished. This means that any intermediate edges queried will represent only the final state.
For example, assume the DB schema below:
We create a
Blogpost using:which returns:
Let's say we now update the
BlogandBloggerin the same mutation request:This will return: