@@ -2,10 +2,12 @@ pub mod util;
2
2
3
3
use std:: time:: Duration ;
4
4
5
+ use graph:: components:: store:: SubgraphStore ;
5
6
use graph:: prelude:: DeploymentHash ;
6
7
use serde:: Deserialize ;
7
8
use serde_json:: json;
8
9
use test_store:: create_test_subgraph;
10
+ use test_store:: SUBGRAPH_STORE ;
9
11
use tokio:: time:: sleep;
10
12
11
13
use self :: util:: client:: send_graphql_request;
@@ -497,7 +499,7 @@ fn graphql_can_reassign_deployment() {
497
499
create_test_subgraph ( & deployment_hash, TEST_SUBGRAPH_SCHEMA ) . await ;
498
500
499
501
let deployment_hash = DeploymentHash :: new ( "subgraph_2" ) . unwrap ( ) ;
500
- create_test_subgraph ( & deployment_hash, TEST_SUBGRAPH_SCHEMA ) . await ;
502
+ let locator = create_test_subgraph ( & deployment_hash, TEST_SUBGRAPH_SCHEMA ) . await ;
501
503
502
504
send_graphql_request (
503
505
json ! ( {
@@ -513,20 +515,26 @@ fn graphql_can_reassign_deployment() {
513
515
)
514
516
. await ;
515
517
518
+ let node = SUBGRAPH_STORE . assigned_node ( & locator) . unwrap ( ) . unwrap ( ) ;
519
+
516
520
let reassign = send_graphql_request (
517
521
json ! ( {
518
- "query" : r#"mutation {
522
+ "query" : r#"mutation ReassignDeployment($node: String!) {
519
523
deployment {
520
- reassign(deployment: { hash: "subgraph_1" }, node: "test" ) {
524
+ reassign(deployment: { hash: "subgraph_1" }, node: $node ) {
521
525
... on EmptyResponse {
522
526
success
523
527
}
524
528
... on CompletedWithWarnings {
529
+ success
525
530
warnings
526
531
}
527
532
}
528
533
}
529
- }"#
534
+ }"# ,
535
+ "variables" : {
536
+ "node" : node. to_string( ) ,
537
+ }
530
538
} ) ,
531
539
VALID_TOKEN ,
532
540
)
@@ -561,6 +569,7 @@ fn graphql_warns_reassign_on_wrong_node_id() {
561
569
success
562
570
}
563
571
... on CompletedWithWarnings {
572
+ success
564
573
warnings
565
574
}
566
575
}
@@ -575,6 +584,7 @@ fn graphql_warns_reassign_on_wrong_node_id() {
575
584
"data" : {
576
585
"deployment" : {
577
586
"reassign" : {
587
+ "success" : true ,
578
588
"warnings" : [ "This is the only deployment assigned to 'invalid_node'. Please make sure that the node ID is spelled correctly." ] ,
579
589
}
580
590
}
0 commit comments