Gatsby: Conditional page builds not working with static queries

Created on 21 Jul 2020  路  2Comments  路  Source: gatsbyjs/gatsby

25723 has moved static queries outside of the js bundles. Previously a change to these would trigger a full rebuild which wasn't ideal. The changes made have fixed this, however now nothing is triggering so it is not possible to detect and deploy a static query change.

This effectively makes them unreliable for use with conditional page builds

needs core review bug

All 2 comments

I am also having this issue, where any template with a static query being exported fails to build... which are most of my pages in some projects.

This is a good change having the static queries outside of the JS bundles馃檱 . The full rebuild on the static data change wasn't ideal, in the first attempt we struggled linking page paths to its static data.

Just thinking how to we could go about fixing conditional page builds 馃 . I haven't started investigating myself yet, so just a few questions.

I see in the PR (#25723) there is now a staticQueryResults with a path, is the staticQueryResults saved in the redux.state cache?

Do the staticQueryHashes change if query data returned is different?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

ferMartz picture ferMartz  路  3Comments

magicly picture magicly  路  3Comments

brandonmp picture brandonmp  路  3Comments

totsteps picture totsteps  路  3Comments