@@ -527,6 +527,7 @@ protected function register_graphql_field( $type_name, $field_name, $config ) {
527
527
]
528
528
);
529
529
530
+
530
531
$ this ->add_field_group_fields ( $ acf_field , $ field_type_name );
531
532
532
533
$ field_config ['type ' ] = $ field_type_name ;
@@ -572,6 +573,7 @@ protected function register_graphql_field( $type_name, $field_name, $config ) {
572
573
break ;
573
574
case 'repeater ' :
574
575
$ field_type_name = $ type_name . '_ ' . self ::camel_case ( $ acf_field ['name ' ] );
576
+
575
577
if ( TypeRegistry::get_type ( $ field_type_name ) ) {
576
578
$ field_config ['type ' ] = $ field_type_name ;
577
579
break ;
@@ -701,6 +703,12 @@ protected function register_graphql_field( $type_name, $field_name, $config ) {
701
703
*/
702
704
protected function add_field_group_fields ( $ field_group , $ type_name ) {
703
705
706
+ /**
707
+ * If the field group has the show_in_graphql setting configured, respect it's setting
708
+ * otherwise default to true (for nested fields)
709
+ */
710
+ $ field_group ['show_in_graphql ' ] = isset ( $ field_group ['show_in_graphql ' ] ) ? (boolean ) $ field_group ['show_in_graphql ' ] : true ;
711
+
704
712
/**
705
713
* Determine if the field group should be exposed
706
714
* to graphql
@@ -714,6 +722,7 @@ protected function add_field_group_fields( $field_group, $type_name ) {
714
722
*/
715
723
$ acf_fields = ! empty ( $ field_group ['sub_fields ' ] ) ? $ field_group ['sub_fields ' ] : acf_get_fields ( $ field_group );
716
724
725
+
717
726
/**
718
727
* If there are no fields, bail
719
728
*/
@@ -741,6 +750,7 @@ protected function add_field_group_fields( $field_group, $type_name ) {
741
750
empty ( $ name ) ||
742
751
true !== $ show_in_graphql
743
752
) {
753
+
744
754
/**
745
755
* Uncomment line below to determine what fields are not going to be output
746
756
* in the Schema.
0 commit comments