I noticed this bug while adding unit tests in a plugin.
PHP Fatal error: Cannot redeclare get_post_type_graphql_fields() (previously declared in /var/www/project/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php:748) in /var/www/project/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 748
Fatal error: Cannot redeclare get_post_type_graphql_fields() (previously declared in /var/www/project/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php:748) in /var/www/project/wp-content/plugins/add-wpgraphql-seo/wp-graphql-yoast-seo.php on line 748
The issue seems to be because this function is being instantiated inside the graphql_register_types hook action which can be run multiple times.
I noticed this bug while adding unit tests in a plugin.
The issue seems to be because this function is being instantiated inside the
graphql_register_types
hook action which can be run multiple times.https://github.com/ashhitch/wp-graphql-yoast-seo/blob/278d751c765dba031fdcbeec1ed0d425a16486be/wp-graphql-yoast-seo.php#L748