Skip to content

Commit cb4fad8

Browse files
authored
Merge pull request #232 from w3bdesign/development
Add reference to Apollo Client developer extension
2 parents 424fa3d + e979a5a commit cb4fad8

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NODE_ENV="development"

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
- [algolia-woo-indexer](https://github.com/w3bdesign/algolia-woo-indexer) Sends WooCommerce products to Algolia.
1414
- [headless-wordpress](https://github.com/w3bdesign/headless-wp) Disables the frontend so only the backend is accessible. (optional)
1515

16-
1. Make sure WooCommerce has some products already or import some sample products
16+
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.
17+
18+
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.
19+
20+
3. Make sure WooCommerce has some products already or import some sample products
1721

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

utils/apollo/ApolloClient.js

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

0 commit comments

Comments
 (0)