strawberry-graphql/strawberry-django

Enable atomic nested mutations

Aberta

#628 aberto em 13 de set. de 2024

 (3 comentários) (4 reações) (0 responsável)Python (152 forks)auto 404
enhancementhelp wantedproposal

Métricas do repositório

Stars
 (496 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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

Guia do colaborador