Skip to content

Commit b31dbda

Browse files
committed
PR feedback, move to a string to be able to support other operation loading techniques
1 parent 9638199 commit b31dbda

File tree

6 files changed

+83
-81
lines changed

6 files changed

+83
-81
lines changed

crates/apollo-mcp-registry/src/uplink/persisted_queries/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::fmt::Formatter;
44
/// Persisted Query events
55
pub enum Event {
66
/// The persisted query manifest was updated
7-
UpdateManifest(Vec<(String, String)>),
7+
UpdateManifest(Vec<(String, String, String)>),
88
}
99

1010
impl Debug for Event {

crates/apollo-mcp-registry/src/uplink/persisted_queries/manifest_poller.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ impl ManifestSource {
3838
Ok(manifest) => Event::UpdateManifest(
3939
manifest
4040
.iter()
41-
.map(|(k, v)| (k.operation_id.clone(), v.clone()))
41+
.map(|(k, v)| {
42+
(
43+
k.operation_id.clone(),
44+
v.clone(),
45+
"PersistedQuery".to_string(),
46+
)
47+
})
4248
.collect(),
4349
),
4450
Err(e) => {

crates/apollo-mcp-server/src/errors.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::path::PathBuf;
2-
31
use apollo_compiler::{Schema, ast::Document, validation::WithErrors};
42
use apollo_federation::error::FederationError;
53
use reqwest::header::{InvalidHeaderName, InvalidHeaderValue};
@@ -16,16 +14,16 @@ pub enum OperationError {
1614
Internal(String),
1715

1816
#[error("{0}: Operation is missing its required name: {1}")]
19-
MissingName(PathBuf, String),
17+
MissingName(String, String),
2018

2119
#[error("{0}: No operations defined")]
22-
NoOperations(PathBuf),
20+
NoOperations(String),
2321

2422
#[error("Invalid JSON: {0}")]
2523
Json(#[from] serde_json::Error),
2624

2725
#[error("{0}: Too many operations. Expected 1 but got {1}")]
28-
TooManyOperations(PathBuf, usize),
26+
TooManyOperations(String, usize),
2927

3028
#[error(transparent)]
3129
File(#[from] std::io::Error),

crates/apollo-mcp-server/src/introspection.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,12 @@ impl graphql::Executable for Execute {
173173
})?;
174174

175175
// validate the operation
176-
operation_defs(&input.query, self.mutation_mode == MutationMode::All, &None)
177-
.map_err(|e| McpError::new(ErrorCode::INVALID_PARAMS, e.to_string(), None))?;
176+
operation_defs(
177+
&input.query,
178+
self.mutation_mode == MutationMode::All,
179+
"Introspection".to_string(),
180+
)
181+
.map_err(|e| McpError::new(ErrorCode::INVALID_PARAMS, e.to_string(), None))?;
178182

179183
Ok(input.query)
180184
}

0 commit comments

Comments
 (0)