strawberry-graphql/strawberry-django

Enable atomic nested mutations

オープン

#628 opened on 2024/09/13

 (3 件のコメント) (4 件のリアクション) (0 人の担当者)Python (152 件のフォーク)auto 404
enhancementhelp wantedproposal

Repository metrics

Stars
 (496 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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
    }
  }
}

コントリビューターガイド