Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions graph-gateway/src/client_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ use crate::{
block_constraints::{resolve_block_requirements, rewrite_query, BlockRequirements},
indexer_client::{check_block_error, IndexerClient, ResponsePayload},
reports::{self, serialize_attestation},
sql_constraints::{validate_query, SqlFieldBehavior},
unattestable_errors::{miscategorized_attestable, miscategorized_unattestable},
};

Expand Down Expand Up @@ -283,6 +284,9 @@ async fn handle_client_query_inner(
.unwrap_or_default();
let mut context = AgoraContext::new(&payload.query, &variables)
.map_err(|err| Error::BadQuery(anyhow!("{err}")))?;

validate_query(&context, SqlFieldBehavior::RejectSql)?;

tracing::info!(
target: CLIENT_REQUEST_TARGET,
query = %payload.query,
Expand Down
1 change: 1 addition & 0 deletions graph-gateway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ pub mod indexer_client;
pub mod indexers;
pub mod indexings_blocklist;
pub mod reports;
pub mod sql_constraints;
pub mod subgraph_studio;
pub mod unattestable_errors;
Loading