-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
3 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,38 @@ | ||
using GraphQL.Types; | ||
using Libplanet.Crypto; | ||
using Libplanet.Explorer.GraphTypes; | ||
using Nekoyume.Model.Guild; | ||
|
||
namespace NineChronicles.Headless.GraphTypes; | ||
|
||
public class GuildType : ObjectGraphType<GuildType> | ||
{ | ||
public Address Address { get; set; } | ||
|
||
public Address ValidatorAddress { get; set; } | ||
|
||
public Address GuildMasterAddress { get; set; } | ||
|
||
public GuildType() | ||
{ | ||
Field<NonNullGraphType<AddressType>>( | ||
nameof(Address), | ||
description: "Address of the guild", | ||
resolve: context => context.Source.Address); | ||
Field<NonNullGraphType<AddressType>>( | ||
nameof(ValidatorAddress), | ||
description: "Validator address of the guild", | ||
resolve: context => context.Source.ValidatorAddress); | ||
Field<NonNullGraphType<AddressType>>( | ||
nameof(GuildMasterAddress), | ||
description: "Guild master address of the guild", | ||
resolve: context => context.Source.GuildMasterAddress); | ||
} | ||
|
||
public static GuildType FromDelegatee(Guild guild) => new GuildType | ||
{ | ||
Address = guild.Address, | ||
ValidatorAddress = guild.ValidatorAddress, | ||
GuildMasterAddress = guild.GuildMasterAddress, | ||
}; | ||
} |
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