Coder Social home page Coder Social logo

Comments (2)

EmperorRXF avatar EmperorRXF commented on May 31, 2024 1

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.

kaushalyap avatar kaushalyap commented on May 31, 2024

@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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.