Skip to content

Commit 9e5ad24

Browse files
committed
graphql: Remove QueryResponse alias
1 parent 8cd47ba commit 9e5ad24

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

graphql/src/execution/execution.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use super::cache::QueryCache;
2+
use crossbeam::atomic::AtomicCell;
23
use graph::prelude::CheapClone;
34
use graphql_parser::query as q;
45
use graphql_parser::schema as s;
@@ -8,11 +9,10 @@ use stable_hash::crypto::SetHasher;
89
use stable_hash::prelude::*;
910
use stable_hash::utils::stable_hash;
1011
use std::collections::{BTreeMap, HashMap, HashSet, VecDeque};
12+
use std::fmt;
1113
use std::iter;
1214
use std::sync::RwLock;
1315
use std::time::Instant;
14-
use std::fmt;
15-
use crossbeam::atomic::AtomicCell;
1616

1717
use graph::prelude::*;
1818

@@ -26,8 +26,6 @@ use crate::values::coercion;
2626

2727
type QueryHash = <SetHasher as StableHasher>::Out;
2828

29-
pub(crate) type QueryResponse = Result<BTreeMap<String, q::Value>, Vec<QueryExecutionError>>;
30-
3129
#[derive(Debug)]
3230
struct CacheByBlock {
3331
block: EthereumBlockPointer,
@@ -199,7 +197,7 @@ impl fmt::Display for CacheStatus {
199197
CacheStatus::Hit => f.write_str("hit"),
200198
CacheStatus::Shared => f.write_str("shared"),
201199
CacheStatus::Insert => f.write_str("insert"),
202-
CacheStatus::Miss => f.write_str("miss")
200+
CacheStatus::Miss => f.write_str("miss"),
203201
}
204202
}
205203
}
@@ -271,7 +269,7 @@ pub fn execute_root_selection_set_uncached(
271269
ctx: &ExecutionContext<impl Resolver>,
272270
selection_set: &q::SelectionSet,
273271
root_type: &s::ObjectType,
274-
) -> QueryResponse {
272+
) -> Result<BTreeMap<String, q::Value>, Vec<QueryExecutionError>> {
275273
// Split the top-level fields into introspection fields and
276274
// regular data fields
277275
let mut data_set = q::SelectionSet {
@@ -442,7 +440,7 @@ fn execute_selection_set_to_map<'a>(
442440
selection_sets: impl Iterator<Item = &'a q::SelectionSet>,
443441
object_type: &s::ObjectType,
444442
prefetched_value: Option<q::Value>,
445-
) -> QueryResponse {
443+
) -> Result<BTreeMap<String, q::Value>, Vec<QueryExecutionError>> {
446444
let mut prefetched_object = match prefetched_value {
447445
Some(q::Value::Object(object)) => Some(object),
448446
Some(_) => unreachable!(),

graphql/src/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ where
6262
query: query.clone(),
6363
deadline: options.deadline,
6464
max_first: options.max_first,
65-
cache_status: Default::default()
65+
cache_status: Default::default(),
6666
};
6767

6868
if !query.is_query() {

graphql/src/subscription/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ where
8181
query: query.clone(),
8282
deadline: None,
8383
max_first: options.max_first,
84-
cache_status: Default::default()
84+
cache_status: Default::default(),
8585
};
8686

8787
if !query.is_subscription() {
@@ -198,7 +198,7 @@ async fn execute_subscription_event(
198198
query,
199199
deadline: timeout.map(|t| Instant::now() + t),
200200
max_first,
201-
cache_status: Default::default()
201+
cache_status: Default::default(),
202202
};
203203

204204
// We have established that this exists earlier in the subscription execution

0 commit comments

Comments
 (0)