Comments (2)
Postgres does have a concept of transactions yes. I guess you're questioning why we need such a Plugin if Postgres has already atomicity built-in?
In Postgraphile v4, the default behavior when your client makes a single GQL request which contains more than one mutation (i.e. like this) is, each mutation there will run on it's own Postgres transaction. The outcome of each mutation will be isolated.
This might not be the preferred behavior for some clients. Maybe someone would want to consider the mutations enclosed within the GQL request to be treated in a single Postgres transaction.
This plugin attempts to address this particular issue by starting a Postgres SAVEPOINT before everything starts, and by either commiting everything if all mutations succeed or rollback everything if at least one mutation would fail.
from postgraphile-plugin-atomic-mutations.
@EmperorRXF Thanks for the quick and clear response, I did not thought about this earlier. As I understood this plugin is useful for automatically generated mutations, since if you write custom function it is not necessary since all mutations inside the function belong to an one transaction AFAIK.
from postgraphile-plugin-atomic-mutations.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postgraphile-plugin-atomic-mutations.