From 7561025c99589d9c7fafd40ff32a3fa2e0928e42 Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Thu, 21 Sep 2023 16:11:00 +0200 Subject: [PATCH] next try of graphql mutation --- .../client/1_0/model/SendCoinsResult.ts | 4 +-- .../client/1_0/query/voteForSendCoins.ts | 30 +++++++++++++------ .../api/1_0/resolver/SendCoinsResolver.ts | 12 -------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/backend/src/federation/client/1_0/model/SendCoinsResult.ts b/backend/src/federation/client/1_0/model/SendCoinsResult.ts index d3ce76392..1258db4cb 100644 --- a/backend/src/federation/client/1_0/model/SendCoinsResult.ts +++ b/backend/src/federation/client/1_0/model/SendCoinsResult.ts @@ -1,6 +1,6 @@ -import { ArgsType, Field } from 'type-graphql' +import { Field, ObjectType } from 'type-graphql' -@ArgsType() +@ObjectType() export class SendCoinsResult { constructor() { this.vote = false diff --git a/backend/src/federation/client/1_0/query/voteForSendCoins.ts b/backend/src/federation/client/1_0/query/voteForSendCoins.ts index 9658cecfd..a5456bec7 100644 --- a/backend/src/federation/client/1_0/query/voteForSendCoins.ts +++ b/backend/src/federation/client/1_0/query/voteForSendCoins.ts @@ -1,6 +1,16 @@ import { gql } from 'graphql-request' export const voteForSendCoins = gql` + mutation ($args: SendCoinsArgs!) { + voteForSendCoins(data: $args) { + vote + recipGradidoID + recipName + } + } +` + +/* mutation ( $recipientCommunityUuid: String! $recipientUserIdentifier: String! @@ -12,18 +22,20 @@ export const voteForSendCoins = gql` $senderUserName: String! ) { voteForSendCoins( - recipientCommunityUuid: $recipientCommunityUuid - recipientUserIdentifier: $recipientUserIdentifier - creationDate: $creationDate - amount: $amount - memo: $memo - senderCommunityUuid: $senderCommunityUuid - senderUserUuid: $senderUserUuid - senderUserName: $senderUserName + data: { + recipientCommunityUuid: $recipientCommunityUuid + recipientUserIdentifier: $recipientUserIdentifier + creationDate: $creationDate + amount: $amount + memo: $memo + senderCommunityUuid: $senderCommunityUuid + senderUserUuid: $senderUserUuid + senderUserName: $senderUserName + } ) { vote recipGradidoID recipName } } -` +*/ diff --git a/federation/src/graphql/api/1_0/resolver/SendCoinsResolver.ts b/federation/src/graphql/api/1_0/resolver/SendCoinsResolver.ts index 054bdfdd3..4a31b0bbb 100644 --- a/federation/src/graphql/api/1_0/resolver/SendCoinsResolver.ts +++ b/federation/src/graphql/api/1_0/resolver/SendCoinsResolver.ts @@ -23,18 +23,6 @@ export class SendCoinsResolver { async voteForSendCoins( @Arg('data') args: SendCoinsArgs, - /* - { - recipientCommunityUuid, - recipientUserIdentifier, - creationDate, - amount, - memo, - senderCommunityUuid, - senderUserUuid, - senderUserName, - } - */ ): Promise { logger.debug( `voteForSendCoins() via apiVersion=1_0 ...`,