Skip to content

Commit

Permalink
fix(gatsby-source-contentful): remove duplicate resolving (#34599)
Browse files Browse the repository at this point in the history
* perf: resolve all Contentful links manually

* perf(Contentful): no more cache previous Contentful API syncs

* feat(contentful): report new and update node counts seperate from each other
  • Loading branch information
axe312ger authored Jan 28, 2022
1 parent c4602c0 commit 6e955a4
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 1,330 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
exports[`gatsby-node should add a new blogpost and update linkedNodes 1`] = `
Array [
Array [
"Contentful: 4 new/updated entries",
"Contentful: 4 new entries",
],
Array [
"Contentful: 0 updated entries",
],
Array [
"Contentful: 0 deleted entries",
Expand All @@ -12,7 +15,10 @@ Array [
"Contentful: 0 cached entries",
],
Array [
"Contentful: 4 new/updated assets",
"Contentful: 4 new assets",
],
Array [
"Contentful: 0 updated assets",
],
Array [
"Contentful: 0 cached assets",
Expand All @@ -30,39 +36,45 @@ Array [
"Creating 4 Contentful asset nodes",
],
Array [
"Contentful: 1 new/updated entries",
"Contentful: 1 new entries",
],
Array [
"Contentful: 0 updated entries",
],
Array [
"Contentful: 0 deleted entries",
],
Array [
"Contentful: 4 cached entries",
"Contentful: 22 cached entries",
],
Array [
"Contentful: 1 new/updated assets",
"Contentful: 1 new assets",
],
Array [
"Contentful: 4 cached assets",
"Contentful: 0 updated assets",
],
Array [
"Contentful: 0 deleted assets",
"Contentful: 8 cached assets",
],
Array [
"Creating 1 Contentful Person nodes",
"Contentful: 0 deleted assets",
],
Array [
"Creating 4 Contentful Blog Post nodes",
"Creating 1 Contentful Blog Post nodes",
],
Array [
"Creating 5 Contentful asset nodes",
"Creating 1 Contentful asset nodes",
],
]
`;

exports[`gatsby-node should create nodes from initial payload 3`] = `
Array [
Array [
"Contentful: 4 new/updated entries",
"Contentful: 4 new entries",
],
Array [
"Contentful: 0 updated entries",
],
Array [
"Contentful: 0 deleted entries",
Expand All @@ -71,7 +83,10 @@ Array [
"Contentful: 0 cached entries",
],
Array [
"Contentful: 4 new/updated assets",
"Contentful: 4 new assets",
],
Array [
"Contentful: 0 updated assets",
],
Array [
"Contentful: 0 cached assets",
Expand All @@ -94,7 +109,10 @@ Array [
exports[`gatsby-node should remove a blogpost and update linkedNodes 1`] = `
Array [
Array [
"Contentful: 4 new/updated entries",
"Contentful: 4 new entries",
],
Array [
"Contentful: 0 updated entries",
],
Array [
"Contentful: 0 deleted entries",
Expand All @@ -103,7 +121,10 @@ Array [
"Contentful: 0 cached entries",
],
Array [
"Contentful: 4 new/updated assets",
"Contentful: 4 new assets",
],
Array [
"Contentful: 0 updated assets",
],
Array [
"Contentful: 0 cached assets",
Expand All @@ -121,66 +142,69 @@ Array [
"Creating 4 Contentful asset nodes",
],
Array [
"Contentful: 1 new/updated entries",
"Contentful: 1 new entries",
],
Array [
"Contentful: 0 deleted entries",
"Contentful: 0 updated entries",
],
Array [
"Contentful: 4 cached entries",
"Contentful: 0 deleted entries",
],
Array [
"Contentful: 1 new/updated assets",
"Contentful: 22 cached entries",
],
Array [
"Contentful: 4 cached assets",
"Contentful: 1 new assets",
],
Array [
"Contentful: 0 deleted assets",
"Contentful: 0 updated assets",
],
Array [
"Creating 1 Contentful Person nodes",
"Contentful: 8 cached assets",
],
Array [
"Creating 4 Contentful Blog Post nodes",
"Contentful: 0 deleted assets",
],
Array [
"Creating 5 Contentful asset nodes",
"Creating 1 Contentful Blog Post nodes",
],
Array [
"Contentful: 0 new/updated entries",
"Creating 1 Contentful asset nodes",
],
Array [
"Contentful: 1 deleted entries",
"Contentful: 0 new entries",
],
Array [
"Contentful: 5 cached entries",
"Contentful: 0 updated entries",
],
Array [
"Contentful: 0 new/updated assets",
"Contentful: 1 deleted entries",
],
Array [
"Contentful: 5 cached assets",
"Contentful: 28 cached entries",
],
Array [
"Contentful: 0 deleted assets",
"Contentful: 0 new assets",
],
Array [
"Creating 1 Contentful Person nodes",
"Contentful: 0 updated assets",
],
Array [
"Creating 3 Contentful Blog Post nodes",
"Contentful: 10 cached assets",
],
Array [
"Creating 5 Contentful asset nodes",
"Contentful: 0 deleted assets",
],
]
`;

exports[`gatsby-node should remove an asset 1`] = `
Array [
Array [
"Contentful: 4 new/updated entries",
"Contentful: 4 new entries",
],
Array [
"Contentful: 0 updated entries",
],
Array [
"Contentful: 0 deleted entries",
Expand All @@ -189,7 +213,10 @@ Array [
"Contentful: 0 cached entries",
],
Array [
"Contentful: 4 new/updated assets",
"Contentful: 4 new assets",
],
Array [
"Contentful: 0 updated assets",
],
Array [
"Contentful: 0 cached assets",
Expand All @@ -207,66 +234,69 @@ Array [
"Creating 4 Contentful asset nodes",
],
Array [
"Contentful: 1 new/updated entries",
"Contentful: 1 new entries",
],
Array [
"Contentful: 0 deleted entries",
"Contentful: 0 updated entries",
],
Array [
"Contentful: 4 cached entries",
"Contentful: 0 deleted entries",
],
Array [
"Contentful: 1 new/updated assets",
"Contentful: 22 cached entries",
],
Array [
"Contentful: 4 cached assets",
"Contentful: 1 new assets",
],
Array [
"Contentful: 0 deleted assets",
"Contentful: 0 updated assets",
],
Array [
"Creating 1 Contentful Person nodes",
"Contentful: 8 cached assets",
],
Array [
"Creating 4 Contentful Blog Post nodes",
"Contentful: 0 deleted assets",
],
Array [
"Creating 5 Contentful asset nodes",
"Creating 1 Contentful Blog Post nodes",
],
Array [
"Contentful: 0 new/updated entries",
"Creating 1 Contentful asset nodes",
],
Array [
"Contentful: 0 deleted entries",
"Contentful: 0 new entries",
],
Array [
"Contentful: 5 cached entries",
"Contentful: 0 updated entries",
],
Array [
"Contentful: 0 new/updated assets",
"Contentful: 0 deleted entries",
],
Array [
"Contentful: 5 cached assets",
"Contentful: 28 cached entries",
],
Array [
"Contentful: 1 deleted assets",
"Contentful: 0 new assets",
],
Array [
"Creating 1 Contentful Person nodes",
"Contentful: 0 updated assets",
],
Array [
"Creating 4 Contentful Blog Post nodes",
"Contentful: 10 cached assets",
],
Array [
"Creating 4 Contentful asset nodes",
"Contentful: 1 deleted assets",
],
]
`;

exports[`gatsby-node should update a blogpost 1`] = `
Array [
Array [
"Contentful: 4 new/updated entries",
"Contentful: 4 new entries",
],
Array [
"Contentful: 0 updated entries",
],
Array [
"Contentful: 0 deleted entries",
Expand All @@ -275,7 +305,10 @@ Array [
"Contentful: 0 cached entries",
],
Array [
"Contentful: 4 new/updated assets",
"Contentful: 4 new assets",
],
Array [
"Contentful: 0 updated assets",
],
Array [
"Contentful: 0 cached assets",
Expand All @@ -293,58 +326,61 @@ Array [
"Creating 4 Contentful asset nodes",
],
Array [
"Contentful: 1 new/updated entries",
"Contentful: 1 new entries",
],
Array [
"Contentful: 0 updated entries",
],
Array [
"Contentful: 0 deleted entries",
],
Array [
"Contentful: 4 cached entries",
"Contentful: 22 cached entries",
],
Array [
"Contentful: 1 new/updated assets",
"Contentful: 1 new assets",
],
Array [
"Contentful: 4 cached assets",
"Contentful: 0 updated assets",
],
Array [
"Contentful: 0 deleted assets",
"Contentful: 8 cached assets",
],
Array [
"Creating 1 Contentful Person nodes",
"Contentful: 0 deleted assets",
],
Array [
"Creating 4 Contentful Blog Post nodes",
"Creating 1 Contentful Blog Post nodes",
],
Array [
"Creating 5 Contentful asset nodes",
"Creating 1 Contentful asset nodes",
],
Array [
"Contentful: 1 new/updated entries",
"Contentful: 0 new entries",
],
Array [
"Contentful: 0 deleted entries",
"Contentful: 1 updated entries",
],
Array [
"Contentful: 5 cached entries",
"Contentful: 0 deleted entries",
],
Array [
"Contentful: 0 new/updated assets",
"Contentful: 28 cached entries",
],
Array [
"Contentful: 5 cached assets",
"Contentful: 0 new assets",
],
Array [
"Contentful: 0 deleted assets",
"Contentful: 0 updated assets",
],
Array [
"Creating 1 Contentful Person nodes",
"Contentful: 10 cached assets",
],
Array [
"Creating 4 Contentful Blog Post nodes",
"Contentful: 0 deleted assets",
],
Array [
"Creating 5 Contentful asset nodes",
"Creating 1 Contentful Blog Post nodes",
],
]
`;
Expand Down
Loading

0 comments on commit 6e955a4

Please sign in to comment.