Skip to content

Commit

Permalink
Add query
Browse files Browse the repository at this point in the history
  • Loading branch information
Atralupus committed Apr 14, 2024
1 parent 2981ef5 commit 48e56e8
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions backend/app/Savor22b/GraphTypes/Query/Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,46 @@ swarm is null
}
);

Field<NonNullGraphType<StringGraphType>>(
"createAction_UpdateTradeGoodAction",
description: "무역상점 상품 가격 수정",
arguments: new QueryArguments(
new QueryArgument<NonNullGraphType<StringGraphType>>
{
Name = "publicKey",
Description = "The base64-encoded public key for Transaction.",
},
new QueryArgument<NonNullGraphType<GuidGraphType>>
{
Name = "productId",
Description = "상품 고유 Id",
},
new QueryArgument<NonNullGraphType<IntGraphType>>
{
Name = "price",
Description = "가격",
}
),
resolve: context =>
{
var publicKey = new PublicKey(
ByteUtil.ParseHex(context.GetArgument<string>("publicKey"))
);
var price = FungibleAssetValue.Parse(Currencies.KeyCurrency, context.GetArgument<int>("price").ToString());
var action = new UpdateTradeGoodAction(
context.GetArgument<Guid>("productId"),
price);
return new GetUnsignedTransactionHex(
action,
publicKey,
_blockChain,
_swarm
).UnsignedTransactionHex;
}
);

Field<NonNullGraphType<StringGraphType>>(
"createAction_BuyTradeGoodAction",
description: "무역상점 구매",
Expand Down

0 comments on commit 48e56e8

Please sign in to comment.