Skip to content

Conversation

@pasdo501
Copy link

@pasdo501 pasdo501 commented Mar 8, 2019

This update should allow for all endpoints to be used (as long as they don't contain any parameters, like products/<product_id>/reviews).

Config update also allows for different versions of the API to be accessed. For example, product reviews at 'products/reviews' (available at wc/v3+).

Edit: Now also allows for max retrieved item count to be configurable.

pasdo501 and others added 7 commits March 9, 2019 11:55
- Allows access to 'nested' fields, e.g. products/categories
- Works for field names following the specs of the API docs
(https://woocommerce.github.io/woocommerce-rest-api-docs/)
- Does NOT work for endpoints containing a wild card, e.g.
products/id:/reviews
- Some very basic error handling - if the route is not available, a
warning message is logged to the console during develop/build
- In this case, an empty array is returning, effectively skipping this field
- Additional minor change: Added a 'wordpress_id' field to nodes -> this
corresponds to the int ID saved in the wordpress DB (e.g. post_id,
tax_id, etc)
- Allows the API version being used to be changed.
- Defaults to 'wc/v1', the version currently being used.
- If an incorrect version is entered in the config file, warnings will
be logged for each field being fetched, but nothing specific about the
API veresion will be pinpointed, so it's up to people to enter a valid
version.
- Updated README to reflect this change, as well as a short addition to
the supported field types section.
- Allows the number of items to retrieve from the API request to be
configurable (defaults to 10 otherwise)
- Updated README; also moved optional config options to the end
Specify default option in object spread.
Remove array from api_version
@pasdo501
Copy link
Author

pasdo501 commented Apr 4, 2019

Superseded by #5

@pasdo501 pasdo501 closed this Apr 4, 2019
shendriksza pushed a commit to shendriksza/gatsby-source-woocommerce that referenced this pull request Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants