This repository was archived by the owner on Feb 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add dungeon key count Subscription field
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace Savor22b.GraphTypes.Types; | ||
|
||
using GraphQL.Types; | ||
using Libplanet.Blockchain; | ||
using Libplanet.Net; | ||
using Libplanet.Store; | ||
using Savor22b.States; | ||
|
||
public class DungeonStateType : ObjectGraphType<DungeonState> | ||
{ | ||
public DungeonStateType( | ||
BlockChain blockChain, | ||
BlockRenderer blockRenderer, | ||
IStore store, | ||
Swarm? swarm = null | ||
) | ||
{ | ||
Field<NonNullGraphType<IntGraphType>>( | ||
name: "DungeonKeyCount", | ||
description: "The number of dungeon keys the user has.", | ||
resolve: context => context.Source.GetDungeonKeyCount(blockChain.Count) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters