I am using wordpress website Local by flywheel ( url: xyz.local ) . I created a new gatsby site using and added gatsby-source-woocommerce. I also generated consumer key and consumer secret from woo-commerce settings. i added them to the api_keys in the config file.
When i run gastby develop, i get this error.
========== WARNING FOR FIELD products ===========
The following error status was produced: Error: connect ECONNREFUSED 127.0.0.1:8080
================== END WARNING ==================
08:19:23.204Z > gatsby-source-woocommerce: Fetching 0 nodes for field: products
08:19:23.206Z > gatsby-source-woocommerce: Completed fetching nodes for field: products
warn
========== WARNING FOR FIELD products/categories ===========
The following error status was produced: Error: connect ECONNREFUSED 127.0.0.1:8080
================== END WARNING ==================
08:19:23.213Z > gatsby-source-woocommerce: Fetching 0 nodes for field: products/categories
08:19:23.215Z > gatsby-source-woocommerce: Completed fetching nodes for field: products/categories
warn
========== WARNING FOR FIELD products/attributes ===========
The following error status was produced: Error: connect ECONNREFUSED 127.0.0.1:8080
================== END WARNING ==================
Can someone pls say if did i miss anything? or any wrong i have done?
2
Answers
I solved it. Problem is with plugin. In config options of gatsby-source-woocommerce, comment everything after fields i.e After commenting it looks like,
Head to the @pasdo501/gatsby-source-woocommerce folder ( node modules ) -> gatsby-node.js change api_version = "wc/v3" to "wc/v2" and change wpAPIPrefix = null to "wp-json" and save it.
voila
no need to change the package. you can do this:
add
/index.php
to the end ofapi
.set
wpAPIPrefix
towp-json
.set
query_string_auth
totrue
(I,m not sure if this one necessary).