File tree 2 files changed +5
-2
lines changed
e2e-tests/development-runtime
plugins/gatsby-source-fake-data
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 34
34
"test" : " npm run start-server-and-test || (npm run reset && exit 1)" ,
35
35
"posttest" : " npm run reset" ,
36
36
"reset" : " node scripts/reset.js" ,
37
- "reset:preview" : " node plugins/gatsby-source-fake-data/reset.js && npm run update:preview " ,
37
+ "reset:preview" : " curl -X POST http://localhost:8000/__refresh " ,
38
38
"update" : " node scripts/update.js" ,
39
39
"update:webhook" : " node scripts/webhook.js" ,
40
- "update:preview" : " curl -X POST http://localhost:8000/__refresh" ,
40
+ "update:preview" : " curl -X POST -d '{ \" fake-data-update \" : true }' -H \" Content-Type: application/json \" http://localhost:8000/__refresh" ,
41
41
"start-server-and-test" : " start-server-and-test develop http://localhost:8000 cy:run" ,
42
42
"cy:open" : " cypress open" ,
43
43
"cy:run" : " (is-ci && cypress run --browser chrome --record) || cypress run --browser chrome"
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ exports.sourceNodes = async function sourceNodes({
29
29
reporter . info ( `Webhook data detected; creating nodes` )
30
30
webhookBody . items . forEach ( node => createNode ( api . getNode ( node , helpers ) ) )
31
31
} else {
32
+ if ( ! ( webhookBody && webhookBody [ `fake-data-update` ] ) ) {
33
+ await api . reset ( )
34
+ }
32
35
const [ updated , deleted = [ ] ] = await api . sync ( helpers )
33
36
34
37
updated . forEach ( node => createNode ( node ) )
You can’t perform that action at this time.
0 commit comments