Skip to content

Commit 737e53b

Browse files
committed
fixes
1 parent 77628ab commit 737e53b

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

graph/src/data/query/error.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use graphql_parser::Pos;
2-
use graphql_tools::validation::utils::ValidationError;
32
use hex::FromHexError;
43
use num_bigint;
54
use serde::ser::*;
@@ -292,12 +291,6 @@ impl fmt::Display for QueryExecutionError {
292291
}
293292
}
294293

295-
impl From<ValidationError> for QueryExecutionError {
296-
fn from(e: ValidationError) -> Self {
297-
QueryExecutionError::ValidationError(e.locations.clone().into_iter().nth(0), e.message)
298-
}
299-
}
300-
301294
impl From<QueryExecutionError> for Vec<QueryExecutionError> {
302295
fn from(e: QueryExecutionError) -> Self {
303296
vec![e]

graphql/src/execution/query.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ use graph::data::graphql::{
1010
ext::{DocumentExt, TypeExt},
1111
ObjectOrInterface,
1212
};
13+
use graph::data::query::QueryExecutionError;
1314
use graph::data::query::{Query as GraphDataQuery, QueryVariables};
1415
use graph::data::schema::ApiSchema;
15-
use graph::prelude::{
16-
info, o, q, r, s, BlockNumber, CheapClone, Logger, QueryExecutionError, TryFromValue,
17-
};
16+
use graph::prelude::{info, o, q, r, s, BlockNumber, CheapClone, Logger, TryFromValue};
1817

1918
use crate::introspection::introspection_schema;
2019
use crate::query::{ast as qast, ext::BlockConstraint};
@@ -122,7 +121,12 @@ impl Query {
122121
if validation_errors.len() > 0 {
123122
return Err(validation_errors
124123
.into_iter()
125-
.map(|e| QueryExecutionError::from(e))
124+
.map(|e| {
125+
QueryExecutionError::ValidationError(
126+
e.locations.clone().into_iter().nth(0),
127+
e.message,
128+
)
129+
})
126130
.collect());
127131
}
128132

graphql/src/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ where
213213
let state = store.deployment_state().await?;
214214
let network = Some(store.network_name().to_string());
215215
let schema = store.api_schema()?;
216-
216+
217217
// Test only, see c435c25decbc4ad7bbbadf8e0ced0ff2
218218
#[cfg(debug_assertions)]
219219
let state = INITIAL_DEPLOYMENT_STATE_FOR_TESTS

0 commit comments

Comments
 (0)