Skip to content

Commit

Permalink
Upgrade async-graphql deps (#4128)
Browse files Browse the repository at this point in the history
* refactor: Update to async-graphql = "=7.0.11"

* refactor: Update schema_sdl_export.snap test snapshot
  • Loading branch information
samuel-rufi authored Jan 29, 2025
1 parent bfca1eb commit fca46b1
Show file tree
Hide file tree
Showing 15 changed files with 139 additions and 148 deletions.
254 changes: 122 additions & 132 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ anemo-build = { git = "https://github.com/mystenlabs/anemo.git", rev = "e609f769
anemo-tower = { git = "https://github.com/mystenlabs/anemo.git", rev = "e609f7697ed6169bf0760882a0b6c032a57e4f3b" }
anyhow = "1.0.71"
arc-swap = { version = "1.5.1", features = ["serde"] }
async-graphql = "=7.0.1"
async-graphql = "=7.0.11"
async-recursion = "1.0.4"
async-trait = "0.1.61"
aws-config = "0.56"
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-graphql-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ publish = false
# external dependencies
anyhow.workspace = true
async-graphql = { workspace = true, features = ["dataloader", "apollo_tracing", "tracing", "opentelemetry"] }
async-graphql-axum = "=7.0.1"
async-graphql-value = "=7.0.1"
async-graphql-axum = "=7.0.11"
async-graphql-value = "=7.0.11"
async-trait.workspace = true
axum.workspace = true
axum-extra.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/iota-graphql-rpc/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4591,6 +4591,7 @@ type ZkLoginVerifyResult {
errors: [String!]!
}

directive @deprecated(reason: String = "No longer supported") on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE
directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
schema {
Expand Down
1 change: 0 additions & 1 deletion crates/iota-graphql-rpc/src/data/package_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ impl PackageStore for DbPackageStore {
}
}

#[async_trait::async_trait]
impl Loader<PackageKey> for Db {
type Value = Arc<Package>;
type Error = PackageResolverError;
Expand Down
2 changes: 0 additions & 2 deletions crates/iota-graphql-rpc/src/types/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ impl Checkpointed for Cursor {

impl ScanLimited for Cursor {}

#[async_trait::async_trait]
impl Loader<SeqNumKey> for Db {
type Value = Checkpoint;
type Error = Error;
Expand Down Expand Up @@ -439,7 +438,6 @@ impl Loader<SeqNumKey> for Db {
}
}

#[async_trait::async_trait]
impl Loader<DigestKey> for Db {
type Value = Checkpoint;
type Error = Error;
Expand Down
1 change: 0 additions & 1 deletion crates/iota-graphql-rpc/src/types/epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ impl Epoch {
}
}

#[async_trait::async_trait]
impl Loader<EpochKey> for Db {
type Value = Epoch;
type Error = Error;
Expand Down
2 changes: 0 additions & 2 deletions crates/iota-graphql-rpc/src/types/move_package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,6 @@ impl Target<Cursor> for StoredHistoryPackage {

impl ScanLimited for BcsCursor<PackageCursor> {}

#[async_trait::async_trait]
impl Loader<PackageVersionKey> for Db {
type Value = IotaAddress;
type Error = Error;
Expand Down Expand Up @@ -949,7 +948,6 @@ impl Loader<PackageVersionKey> for Db {
}
}

#[async_trait::async_trait]
impl Loader<LatestKey> for Db {
type Value = IotaAddress;
type Error = Error;
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-graphql-rpc/src/types/move_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ mod tests {
.unwrap();

let expect = expect![[
r#"{baz: null,qux: [{quy: 44,quz: "Hello, world!",frob: "0x0000000000000000000000000000000000000000000000000000000000000045"},{quy: 46,quz: null,frob: "0x0000000000000000000000000000000000000000000000000000000000000047"}]}"#
r#"{baz: null, qux: [{quy: 44, quz: "Hello, world!", frob: "0x0000000000000000000000000000000000000000000000000000000000000045"}, {quy: 46, quz: null, frob: "0x0000000000000000000000000000000000000000000000000000000000000047"}]}"#
]];
expect.assert_eq(&format!("{v}"));
}
Expand Down
3 changes: 0 additions & 3 deletions crates/iota-graphql-rpc/src/types/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,6 @@ impl Target<Cursor> for StoredHistoryObject {
}
}

#[async_trait::async_trait]
impl Loader<HistoricalKey> for Db {
type Value = Object;
type Error = Error;
Expand Down Expand Up @@ -1315,7 +1314,6 @@ impl Loader<HistoricalKey> for Db {
}
}

#[async_trait::async_trait]
impl Loader<ParentVersionKey> for Db {
type Value = Object;
type Error = Error;
Expand Down Expand Up @@ -1415,7 +1413,6 @@ impl Loader<ParentVersionKey> for Db {
}
}

#[async_trait::async_trait]
impl Loader<LatestAtKey> for Db {
type Value = Object;
type Error = Error;
Expand Down
1 change: 0 additions & 1 deletion crates/iota-graphql-rpc/src/types/transaction_block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ impl TransactionBlock {
}
}

#[async_trait::async_trait]
impl Loader<DigestKey> for Db {
type Value = TransactionBlock;
type Error = Error;
Expand Down
1 change: 0 additions & 1 deletion crates/iota-graphql-rpc/src/types/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ pub(crate) struct Validator {
///
/// It automatically filters the exchange rate table to only include data for
/// the epochs that are less than or equal to the requested epoch.
#[async_trait::async_trait]
impl Loader<u64> for Db {
type Value = BTreeMap<NativeIotaAddress, Vec<(EpochId, PoolTokenExchangeRate)>>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4595,6 +4595,7 @@ type ZkLoginVerifyResult {
errors: [String!]!
}
directive @deprecated(reason: String = "No longer supported") on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE
directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
schema {
Expand Down
1 change: 1 addition & 0 deletions crates/iota-transactional-test-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true
# external dependencies
anyhow.workspace = true
async-trait.workspace = true
base64.workspace = true
bcs.workspace = true
bimap = "0.6"
clap.workspace = true
Expand Down
11 changes: 10 additions & 1 deletion crates/iota-transactional-test-runner/src/test_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,16 @@ impl IotaTestAdapter {

variables.insert(format!("cursor_{idx}"), base64d);
} else {
variables.insert(format!("cursor_{idx}"), Base64::encode(s));
use base64::Engine;

// To comply with how `iota-graphql-rpc` decodes the json cursor
// (see `iota_graphql_rpc::types::cursor::JsonCursor`).
//
// This traces back to `async_graphql = 7.0.7` that uses no padding for
// encoding/decoding.
let base64d = base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(s);

variables.insert(format!("cursor_{idx}"), base64d);
}
}

Expand Down

0 comments on commit fca46b1

Please sign in to comment.