moltin / gatsby-source-moltin

🚀 Gatsby source plugin for building Elastic Path Commerce Cloud powered eCommerce websites
https://www.gatsbyjs.org/packages/@moltin/gatsby-source-moltin
MIT License
21 stars 4 forks source link

Cannot destructure property next of 'undefined' #39

Closed ehallvard closed 5 years ago

ehallvard commented 5 years ago

If I use the latest version (1.6.0) my graphql query fails with the following errors:

gatsby-source-moltin: ERROR TypeError: Cannot destructure propertynextof 'undefined' or 'null'. at getPaginatedResource (/Users/user/dev/project/node_modules/@moltin/gatsby-source-moltin/gatsby-node.js:187:11)

Downgrading 1.4.1 made it work. I'm running this query: allProducts: allMoltinProduct { edges { node { id slug sku } } }

notrab commented 5 years ago

Hi @ehallvard

Thanks for reporting this.

Are you able to see if this is resolved if you add a collection/category?

We're in the process of fixing another issue which might also help here. I'll keep you updated on a fix.

ehallvard commented 5 years ago

Adding a collection and a category solved it

notrab commented 5 years ago

@ehallvard thanks! I'll keep you posted when we have the fix.

samblacklock commented 5 years ago

@ehallvard we've just merged https://github.com/moltin/gatsby-source-moltin/pull/40 which should solve your issue

ehallvard commented 5 years ago

I can confirm that it works without any collections or categories. Thanks guys!