Skip to content

Commit

Permalink
Add reference to Apollo Client developer extension
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Jul 23, 2020
1 parent 28fc6c2 commit e979a5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_ENV="development"
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
- [wp-graphql-woocommerce](https://github.com/wp-graphql/wp-graphql-woocommerce) Adds Woocommerce functionality to a WPGraphQL schema.
- [algolia-woo-indexer](https://github.com/w3bdesign/algolia-woo-indexer) Sends WooCommerce products to Algolia.

1. Make sure WooCommerce has some products already or import some sample products
2. For debugging and testing, install either https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/ (Firefox) or https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm (Chrome) depending on your browser.

Rename .env.example to .env so the Apollo debugger will correctly load. It will not load if the NODE_ENV variable is not correctly set.

3. Make sure WooCommerce has some products already or import some sample products

The WooCommerce sample products CSV file is available at `wp-content/plugins/woocommerce/sample-data/sample_products.csv` or [Sample products](sample_products/)

Expand Down
1 change: 1 addition & 0 deletions utils/apollo/ApolloClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { WOO_CONFIG } from 'utils/config/nextConfig';
export const middleware = new ApolloLink((operation, forward) => {
/**
* If session data exist in local storage, set value as session header.
* Here we also delete the session if it is older than 24 hours
*/
const session = process.browser ? localStorage.getItem('woo-session') : null;
const sessionAge = process.browser
Expand Down

0 comments on commit e979a5a

Please sign in to comment.