Skip to content

Commit 8bdc003

Browse files
committed
server: improve warning message for graphman graphql api and clean up code
1 parent dd1e299 commit 8bdc003

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

server/graphman/src/entities/warning_response.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ pub struct CompletedWithWarnings {
66
}
77

88
impl CompletedWithWarnings {
9-
/// Returns a response with success & message.
10-
pub fn new(msg: Vec<String>) -> Self {
11-
Self { warnings: msg }
9+
pub fn new(warnings: Vec<String>) -> Self {
10+
Self { warnings }
1211
}
1312
}

server/graphman/src/resolvers/deployment_mutation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl DeploymentMutation {
124124
let mirror = catalog::Mirror::primary_only(ctx.primary_pool);
125125
let count = mirror.assignments(&node)?.len();
126126
if count == 1 {
127-
let warning_msg = format!("warning: this is the only deployment assigned to '{}'. Are you sure it is spelled correctly?",node.as_str());
127+
let warning_msg = format!("This is the only deployment assigned to '{}'. Please make sure that the node ID is spelled correctly.",node.as_str());
128128
Ok(ReassignResponse::CompletedWithWarnings(
129129
CompletedWithWarnings::new(vec![warning_msg]),
130130
))

server/graphman/tests/deployment_mutation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ fn graphql_can_unassign_deployments() {
423423

424424
let subgraph_node_id = send_graphql_request(
425425
json!({
426-
"query": r#"query Deployment {
426+
"query": r#"{
427427
deployment {
428428
info(deployment: { hash: "subgraph_1" }) {
429429
nodeId

0 commit comments

Comments
 (0)