From a8a09bb2ecfffdb129e6dc4e42561601025ccf80 Mon Sep 17 00:00:00 2001 From: Felipe Torres Date: Wed, 3 Apr 2024 09:47:36 -0700 Subject: [PATCH] New mutation examples --- app/(transition)/graphiql/page.tsx | 170 +++++++++++++++++++++-------- 1 file changed, 127 insertions(+), 43 deletions(-) diff --git a/app/(transition)/graphiql/page.tsx b/app/(transition)/graphiql/page.tsx index 814db77..cc03fe6 100644 --- a/app/(transition)/graphiql/page.tsx +++ b/app/(transition)/graphiql/page.tsx @@ -99,6 +99,47 @@ mutation CrearEvento($input: EventCreateInput!) { endDateTime } }`; + +const mutacionCrearTicket = `# Esta mutaciĆ³n requiere que seas Admin de una Comunidad. +# Puedes permirle permisos al Admin de alguna comunidad +# para que te haga admin +mutation CrearTicket($input: TicketCreateInput!) { + createTicket(input: $input) { + id + description + startDateTime + endDateTime + } +}`; + +const mutacionDeCreatePurchaseOrder = `mutation claimUserTicket($input: TicketClaimInput!) { + claimUserTicket(input: $input) { + __typename + ... on PurchaseOrder { + __typename + id + currency { + id + } + finalPrice + paymentLink + status + tickets { + id + approvalStatus + status + redemptionStatus + paymentStatus + } + } + ... on RedeemUserTicketError { + __typename + error + errorMessage + } + } +}`; + export default function Pregunta() { const [isLoaded, setIsLoaded] = useState(false); const [isLoggedIn, setIsLoggedIn] = useState(false); @@ -148,51 +189,94 @@ export default function Pregunta() { ); } return ( - + + null, + 2, + ), + }, + { + query: mutacionDeCreatePurchaseOrder, + variables: JSON.stringify( + { + input: { + idempotencyUUIDKey: "13a5143e-74b3-4f2a-b1ee-4780ae1086da", + purchaseOrder: [ + { + quantity: 2, + ticketId: "f7a0f051-b739-4d44-b4b1-1f14e7cf33bd", + }, + ], + }, + }, + null, + 2, + ), + }, + ]} + /> + ); }