I tried out the master branch with wpgraphql 0.3.2 and querying for product didn't work. I tried the develop branch and it gave my site a 500 error. It's a broad question but are there any tips for getting it to work?
Here is a test query:
query GET_PRODUCTS {
products {
edges {
node {
id
}
}
}
}
Found this error but will troubleshoot more later.
PHP Fatal error: require(): Failed opening required '/wp-content/plugins/wp-graphql-woocommerce/vendor/composer/../symfony/polyfill-ctype/bootstrap.php' (include_path='.:/opt/alt/php72/usr/share/pear') in /wp-content/plugins/wp-graphql-woocommerce/vendor/composer/autoload_real.php on line 66
I need to install ext-pdo in my PHP.ini but I have a somewhat locked down host. :(
Have you tried running composer dumpautoload -o in the project working directory? There is a error in autoloader files included when you clone the master branch. It'll be fix in the v0.0.2 which will be released on tomorrow or Monday.
I did, that's how I got the error that I needed ext-pdo. Thanks for getting back to me!
This is the complete error.
composer dumpautoload -o
Generating optimized autoload files
[ wp-graphql-woocommerce-develop]$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for lucatume/wp-browser 2.2.1 -> satisfiable by lucatume/wp-browser[2.2.1].
- lucatume/wp-browser 2.2.1 requires ext-pdo * -> the requested PHP extension pdo is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- /opt/alt/php72/etc/php.ini
- /opt/alt/php72/link/conf/alt_php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP i
Oh I see what's happening, First delete the vendor directory and composer.lock rm -rf vendor composer.lock and run composer install --no-dev to install without lucatume/wp-browser the codeception testing framework. The testing framework needs ext-pdo, however the plugin does not.
I'll try this out when I get home. Thanks and Happy Easter
composer install --no-dev didn't work but deleting lucatume/wp-browser from the composer.json did. I am able to make queries now.