Skip to content

Commit 79eb8f3

Browse files
authored
upgrade async-graphql and related api changes (#4092)
1 parent 790178f commit 79eb8f3

File tree

3 files changed

+68
-65
lines changed

3 files changed

+68
-65
lines changed

Cargo.lock

Lines changed: 51 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

explorer/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ version = "0.9.1"
1313
futures = "0.3.5"
1414
futures-channel = "0.3.5"
1515
futures-util = "0.3.5"
16-
async-graphql = "3"
17-
async-graphql-warp = "3"
16+
async-graphql = "4.0.13"
17+
async-graphql-warp = "4.0.13"
1818
serde = {version = "1.0.114", features = ["derive"]}
1919
serde_json = "1.0.81"
2020
serde_yaml = "0.8.13"

explorer/src/api/graphql/mod.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,14 @@ impl Branch {
126126
}
127127
};
128128

129-
connection.append(edges.iter().map(|(h, chain_length)| {
130-
Edge::new(
131-
IndexCursor::from(u32::from(*chain_length)),
132-
Block::from_valid_hash(*h),
133-
)
134-
}));
129+
connection
130+
.edges
131+
.extend(edges.iter().map(|(h, chain_length)| {
132+
Edge::new(
133+
IndexCursor::from(u32::from(*chain_length)),
134+
Block::from_valid_hash(*h),
135+
)
136+
}));
135137

136138
Ok::<_, async_graphql::Error>(connection)
137139
},
@@ -201,7 +203,7 @@ impl Branch {
201203
.collect(),
202204
};
203205

204-
connection.append(edges.iter().map(|(h, i)| {
206+
connection.edges.extend(edges.iter().map(|(h, i)| {
205207
Edge::new(IndexCursor::from(*i), Transaction::from_valid_id(*h))
206208
}));
207209

@@ -279,7 +281,7 @@ impl Branch {
279281
}
280282
};
281283

282-
connection.append(
284+
connection.edges.extend(
283285
edges
284286
.iter()
285287
.map(|(vps, cursor)| Edge::new(IndexCursor::from(*cursor), vps.clone())),
@@ -365,7 +367,7 @@ impl Branch {
365367
}
366368
};
367369

368-
connection.append(
370+
connection.edges.extend(
369371
edges
370372
.iter()
371373
.map(|(pool, cursor)| Edge::new(IndexCursor::from(*cursor), pool.clone())),
@@ -456,7 +458,7 @@ impl Branch {
456458
.collect::<Vec<_>>(),
457459
};
458460

459-
connection.append(edges.iter().map(|(id, cursor)| {
461+
connection.edges.extend(edges.iter().map(|(id, cursor)| {
460462
Edge::new(IndexCursor::from(*cursor), Block::from_valid_hash(*id))
461463
}));
462464

@@ -623,7 +625,7 @@ impl Block {
623625
}
624626
};
625627

626-
connection.append(
628+
connection.edges.extend(
627629
edges
628630
.iter()
629631
.map(|(tx, cursor)| Edge::new(IndexCursor::from(*cursor), tx.clone())),
@@ -1103,7 +1105,7 @@ impl Pool {
11031105
},
11041106
);
11051107

1106-
connection.append(
1108+
connection.edges.extend(
11071109
edges
11081110
.iter()
11091111
.map(|(h, i)| Edge::new(IndexCursor::from(*i), Block::from_valid_hash(*h))),
@@ -1468,7 +1470,7 @@ impl VoteProposalStatus {
14681470
}
14691471
};
14701472

1471-
connection.append(
1473+
connection.edges.extend(
14721474
edges
14731475
.iter()
14741476
.map(|(vs, cursor)| Edge::new(IndexCursor::from(*cursor), vs.clone())),

0 commit comments

Comments
 (0)