File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -551,6 +551,45 @@ public function testFieldShowsInSchemaIfShowInGraphqlIsNull() {
551551
552552 }
553553
554+ public function testFieldDoesNotShowInSchemaIfShowInGraphqlIsZero () {
555+
556+ $ field_key = $ this ->register_acf_field ([
557+ 'show_in_graphql ' => 0
558+ ]);
559+
560+ $ query = '
561+ query GetType( $name: String! ) {
562+ __type( name: $name ) {
563+ name
564+ fields {
565+ name
566+ }
567+ }
568+ }
569+ ' ;
570+
571+ $ actual = $ this ->graphql ( [
572+ 'query ' => $ query ,
573+ 'variables ' => [
574+ 'name ' => 'AcfTestGroup ' ,
575+ ]
576+ ]);
577+
578+ codecept_debug ( $ actual );
579+
580+ // the query should succeed
581+ self ::assertQuerySuccessful ( $ actual , [
582+ // the instructions should be used for the description
583+ $ this ->not ()->expectedNode ( '__type.fields ' , [
584+ 'name ' => $ this ->get_formatted_field_name (),
585+ ]),
586+ ] );
587+
588+ // remove the local field
589+ acf_remove_local_field ( $ field_key );
590+
591+ }
592+
554593 public function testFieldDoesNotShowInSchemaIfShowInGraphqlIsFalse () {
555594
556595 $ field_key = $ this ->register_acf_field ([
You can’t perform that action at this time.
0 commit comments