-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sui-graphql-client: add suins queries (#48)
- Loading branch information
1 parent
7712ef4
commit 12a24f9
Showing
3 changed files
with
96 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// =========================================================================== | ||
// Suins Queries | ||
// =========================================================================== | ||
|
||
use crate::query_types::schema; | ||
use crate::query_types::Address as SdkAddress; | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic( | ||
schema = "rpc", | ||
graphql_type = "Query", | ||
variables = "ResolveSuinsQueryArgs" | ||
)] | ||
pub struct ResolveSuinsQuery { | ||
#[arguments(domain: $name)] | ||
pub resolve_suins_address: Option<DomainAddress>, | ||
} | ||
|
||
#[derive(cynic::QueryVariables, Debug)] | ||
pub struct ResolveSuinsQueryArgs<'a> { | ||
pub name: &'a str, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic(schema = "rpc", graphql_type = "Address")] | ||
pub struct DomainAddress { | ||
pub address: SdkAddress, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic( | ||
schema = "rpc", | ||
graphql_type = "Query", | ||
variables = "DefaultSuinsNameQueryArgs" | ||
)] | ||
pub struct DefaultSuinsNameQuery { | ||
#[arguments(address: $address)] | ||
pub address: Option<AddressDefaultSuins>, | ||
} | ||
|
||
#[derive(cynic::QueryVariables, Debug)] | ||
pub struct DefaultSuinsNameQueryArgs { | ||
pub address: SdkAddress, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic(schema = "rpc", graphql_type = "Address")] | ||
pub struct AddressDefaultSuins { | ||
pub default_suins_name: Option<String>, | ||
} |