File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change @@ -328,3 +328,65 @@ fn graphql_cannot_create_new_subgraph_with_invalid_name() {
328
328
assert_ne ! ( resp, success_resp) ;
329
329
} ) ;
330
330
}
331
+
332
+ #[ test]
333
+ fn graphql_can_remove_subgraph ( ) {
334
+ run_test ( || async {
335
+ let resp = send_graphql_request (
336
+ json ! ( {
337
+ "query" : r#"mutation RemoveSubgraph {
338
+ deployment {
339
+ remove(name: "subgraph_1") {
340
+ success
341
+ }
342
+ }
343
+ }"#
344
+ } ) ,
345
+ VALID_TOKEN ,
346
+ )
347
+ . await ;
348
+
349
+ let expected_resp = json ! ( {
350
+ "data" : {
351
+ "deployment" : {
352
+ "remove" : {
353
+ "success" : true ,
354
+ }
355
+ }
356
+ }
357
+ } ) ;
358
+
359
+ assert_eq ! ( resp, expected_resp) ;
360
+ } ) ;
361
+ }
362
+
363
+ #[ test]
364
+ fn graphql_cannot_remove_subgraph_with_invalid_name ( ) {
365
+ run_test ( || async {
366
+ let resp = send_graphql_request (
367
+ json ! ( {
368
+ "query" : r#"mutation RemoveInvalidSubgraph {
369
+ deployment {
370
+ remove(name: "*@$%^subgraph") {
371
+ success
372
+ }
373
+ }
374
+ }"#
375
+ } ) ,
376
+ VALID_TOKEN ,
377
+ )
378
+ . await ;
379
+
380
+ let success_resp = json ! ( {
381
+ "data" : {
382
+ "deployment" : {
383
+ "remove" : {
384
+ "success" : true ,
385
+ }
386
+ }
387
+ }
388
+ } ) ;
389
+
390
+ assert_ne ! ( resp, success_resp) ;
391
+ } ) ;
392
+ }
You can’t perform that action at this time.
0 commit comments