ButterCMS / gatsbyjs-starter-buttercms

Drop-in proof-of-concept GatsbyJS app, fully integrated with your ButterCMS account
https://gatsbyjs-starter-buttercms-vercel.vercel.app/
3 stars 8 forks source link

redundant filter #20

Closed ViolanteCodes closed 2 years ago

ViolanteCodes commented 2 years ago
prokopsimek commented 2 years ago

I don't understand what's wrong.

ViolanteCodes commented 2 years ago

@orlyohreally correct me if I'm wrong here, but the issue is that preference for published and draft articles be set by the env variable in the initial build? So it's not necessary to filter by status? or is that incorrect?

orlyohreally commented 2 years ago

By setting previewMode true or false in on this line https://github.com/ButterCMS/gatsby-applifting/blob/a631b5619e9017545fe0f9cb6be84ab1cfa29cee/gatsby-config.js#L25 we set which posts/pages we want: all or only published ones. The source plugin filters the data we want, so no need to filter it in the app by status

prokopsimek commented 2 years ago

@orlyohreally Oh, thanks! Gonna fix it.

prokopsimek commented 2 years ago

https://github.com/ButterCMS/gatsby-applifting/pull/33

ViolanteCodes commented 2 years ago

approved by orly and LGTM, merged in and closing issue