benada002 / wp-graphql-widgets

This plugin adds widgets and sidebar queries to WPGraphQL.
13 stars 4 forks source link

Fatal error: Uncaught Error: Call to undefined function WPGraphQL\graphql_get_endpoint() #7

Open igorluiza4d opened 1 year ago

igorluiza4d commented 1 year ago

With the last update of WP GraphQL, the plugin started giving this error:

Fatal error: Uncaught Error: Call to undefined function WPGraphQL\graphql_get_endpoint()

{main} thrown in /wp-content/plugins/wp-graphql/src/Router.php on line 54

However, if I disable wp-graphql-widgets, wordpress works normally.

In my first analysis (very quick) I identified that WP-Graphql changed the graphqlEndpoint.

this change came in version 1.12, until version 1.11.3 is working properly

snibbo71 commented 1 year ago

Just to add my voice to this one... Same problem here.

I've temporarily fixed it by copying the WordPress wp-graphql plugin directory into the vendor directory to 'update' this this plugins vendor code.

NGL though this looks like an absolutely horrible way of having a dependency on other code - I feel like so much is liable to break with this way of doing things - indeed, any time WPGraphQL plugin gets updated it's liable to break. And it's duplicated code. All the classes and functions should be accessible if WPGraphQL is installed surely? Just test it's installed and throw an error message if you try to activate this plugin without WPGraphQL installed?

Or am I missing something?