strawberry-graphql/strawberry-django

Enable atomic nested mutations

開放

#628 建立於 2024年9月13日

 (3 則留言) (4 個反應) (0 位負責人)Python (152 個分叉)auto 404
enhancementhelp wantedproposal

倉庫指標

星標
 (496 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Strawberry supports serialization for nested mutations but Strawberry-Django doesn't seem to be able do it in an atomic way

Feature Request Type

  • New behavior

Description

In the below example, I expect these things to happen in an atomic way so that if a credit card charge fails we do have to go back out previous transactions.

I've seen similar offers from other libraries such as Prisma.

mutation (
  $createInvoice: CreateInvoiceInput!
  $chargeCreditCard: ChargeCreditCardInput!
  atomic: true
) {
  createInvoice: invoice {
    createInvoice(input: $createInvoice) {
      id
    }
  }

  chargeCreditCard: invoice {
    chargeCreditCard(input: $chargeCreditCard) {
      id
    }
  }
}

貢獻者指南