thirdandgrove / gatsby-source-bigcommerce

Gatsby source plugin that makes Big Commerce api data available
10 stars 5 forks source link

Support for v2 API collection responses #9

Closed becomevocal closed 4 years ago

becomevocal commented 4 years ago

Since v2 doesn't have a data object in collection responses, the res.data.map() call would fail. This checks to see if the data object exists and falls back to the root response to map through as a fix.

grantglidewell commented 4 years ago

@becomevocal Sorry Im just seeing this, I think I handled this via an outside conversation? Looks like the code defaults to v3 currently, but handles v2 on this line: https://github.com/thirdandgrove/gatsby-source-bigcommerce/blob/master/src/gatsby-node.js#L60

Let me know if this is something we should support differently, I can get something updated.