88use WPGraphQL \Acf \Model \AcfOptionsPage ;
99use WPGraphQL \AppContext ;
1010use WPGraphQL \Registry \TypeRegistry ;
11- use WPGraphQL \Utils \Utils ;
1211
1312class Registry {
1413
@@ -95,7 +94,7 @@ public function has_registered_field_group( string $key ): bool {
9594 * @param array<mixed> $acf_field_group
9695 */
9796 public function should_field_group_show_in_graphql ( array $ acf_field_group ): bool {
98- return \ WPGraphQL \ Acf \ Utils::should_field_group_show_in_graphql ( $ acf_field_group );
97+ return Utils::should_field_group_show_in_graphql ( $ acf_field_group );
9998 }
10099
101100 /**
@@ -305,7 +304,8 @@ public function get_field_group_interfaces( array $acf_field_group ): array {
305304 * @throws \Exception
306305 */
307306 public function register_options_pages (): void {
308- $ graphql_options_pages = \WPGraphQL \Acf \Utils::get_acf_options_pages ();
307+
308+ $ graphql_options_pages = Utils::get_acf_options_pages ();
309309
310310 if ( empty ( $ graphql_options_pages ) ) {
311311 return ;
@@ -361,7 +361,7 @@ public function register_options_pages(): void {
361361 ]
362362 );
363363
364- $ field_name = Utils::format_field_name ( $ type_name );
364+ $ field_name = \ WPGraphQL \ Utils \ Utils::format_field_name ( $ type_name );
365365
366366 $ interface_name = 'WithAcfOptionsPage ' . $ type_name ;
367367
@@ -507,7 +507,7 @@ public function map_acf_field_to_graphql( array $acf_field, array $acf_field_gro
507507 * @throws \GraphQL\Error\Error
508508 */
509509 public function get_field_group_name ( array $ field_group ): string {
510- return \ WPGraphQL \ Acf \ Utils::get_field_group_name ( $ field_group );
510+ return Utils::get_field_group_name ( $ field_group );
511511 }
512512
513513 /**
@@ -516,7 +516,7 @@ public function get_field_group_name( array $field_group ): string {
516516 * @throws \GraphQL\Error\Error
517517 */
518518 public function get_graphql_field_name ( array $ acf_field ): string {
519- return Utils::format_field_name ( $ this ->get_field_group_name ( $ acf_field ), true );
519+ return \ WPGraphQL \ Utils \ Utils::format_field_name ( $ this ->get_field_group_name ( $ acf_field ), true );
520520 }
521521
522522 /**
@@ -548,7 +548,7 @@ public function get_field_group_graphql_type_name( array $field_group ): ?string
548548 return null ;
549549 }
550550
551- return Utils::format_type_name ( $ replaced );
551+ return \ WPGraphQL \ Utils \ Utils::format_type_name ( $ replaced );
552552 }
553553
554554 /**
@@ -640,9 +640,14 @@ public function get_graphql_locations_for_field_group( array $field_group, array
640640 return $ graphql_types ;
641641 }
642642
643- $ field_group_name = \WPGraphQL \Acf \Utils::get_field_group_name ( $ field_group );
643+ $ field_group_name = Utils::get_field_group_name ( $ field_group );
644+ $ field_group_name = \WPGraphQL \Utils \Utils::format_field_name ( $ field_group_name , true );
645+ // The fields are mapped as lowercase strings and should be retrieved as such
646+ // see: LocationRules.php
647+ $ field_group_name = strtolower ( $ field_group_name );
644648
645649 $ location_rules = $ this ->get_location_rules ( $ acf_field_groups );
650+
646651 if ( isset ( $ location_rules [ $ field_group_name ] ) ) {
647652 $ graphql_types = $ location_rules [ $ field_group_name ];
648653 }
@@ -679,7 +684,7 @@ public function register_acf_field_groups_to_graphql( array $acf_field_groups =
679684 if ( ! empty ( $ locations ) ) {
680685 $ with_field_group_interface_name = 'WithAcf ' . $ type_name ;
681686
682- $ field_name = Utils::format_field_name ( $ type_name , true );
687+ $ field_name = \ WPGraphQL \ Utils \ Utils::format_field_name ( $ type_name , true );
683688
684689 if ( ! $ this ->has_registered_field_group ( $ with_field_group_interface_name ) ) {
685690 register_graphql_interface_type (
0 commit comments