diff --git a/packages/gatsby-source-contentful/src/__fixtures__/starter-blog-data.js b/packages/gatsby-source-contentful/src/__fixtures__/starter-blog-data.js index eb5aeeffae201..805597d44cd1f 100644 --- a/packages/gatsby-source-contentful/src/__fixtures__/starter-blog-data.js +++ b/packages/gatsby-source-contentful/src/__fixtures__/starter-blog-data.js @@ -11,10 +11,10 @@ exports.initialSync = { contentful_id: `uzfinxahlog0`, }, }, - id: `c15jwOBqpxqSAOy2eOO4S0m`, + id: `c31TNnjHlfaGUoMOwU0M2og`, type: `Entry`, - createdAt: `2020-04-09T10:53:01.487Z`, - updatedAt: `2020-04-09T10:55:54.432Z`, + createdAt: `2020-06-03T14:17:32.667Z`, + updatedAt: `2020-06-03T14:17:32.667Z`, environment: { sys: { id: `master`, @@ -23,97 +23,48 @@ exports.initialSync = { contentful_id: `master`, }, }, - revision: 2, + revision: 1, contentType: { sys: { type: `Link`, linkType: `ContentType`, - id: `person`, - contentful_id: `person`, + id: `blogPost`, + contentful_id: `blogPost`, }, }, - contentful_id: `15jwOBqpxqSAOy2eOO4S0m`, + contentful_id: `31TNnjHlfaGUoMOwU0M2og`, }, fields: { - name: { - "en-US": `John Doe`, - }, - title: { - "en-US": `Web Developer`, - nl: `Web developer`, - }, - company: { - "en-US": `ACME`, - }, - shortBio: { - "en-US": `Research and recommendations for modern stack websites.`, - nl: `Onderzoek en aanbevelingen voor moderne stapelwebsites.`, - }, - email: { - "en-US": `john@doe.com`, - }, - phone: { - "en-US": `0176 / 1234567`, - }, - facebook: { - "en-US": `johndoe`, + title: { "en-US": `Automate with webhooks` }, + slug: { "en-US": `automate-with-webhooks` }, + heroImage: { + "en-US": { + sys: { + type: `Link`, + linkType: `Asset`, + id: `c4shwYI3POEGkw0Eg6kcyaQ`, + contentful_id: `4shwYI3POEGkw0Eg6kcyaQ`, + }, + }, }, - twitter: { - "en-US": `johndoe`, + description: { + "en-US": `Webhooks notify you, another person or system when resources have changed by calling a given HTTP endpoint.`, }, - github: { - "en-US": `johndoe`, + body: { + "en-US": `## What are webhooks?\n\nThe webhooks are used to notify you when content has been changed. Specify a URL, configure your webhook, and we will send an HTTP POST request whenever something happens to your content.\n\n## How do I configure a webhook?\n\nGo to Settings → Webhooks from the navigation bar at the top. From there, hit Add webhook, and you will be directed to your new webhook. Then choose a name, put in the information of your HTTP endpoint (URL and authentication), specify any custom headers and select the types of events that should trigger the webhook.\n\n## Why do I get an old version in the CDA?\n\nAs the delivery API is powered by a CDN network consisting of hundreds of servers distributed across continents, it takes some time (up to a few minutes) to reflect the changes to the published content. This must be taken into consideration when reacting to webhooks. In normal conditions, there could be a reasonable delay of 2 to 5 minutes.\n\nExtracted from the [Webhooks FAQ](https://www.contentful.com/faq/webhooks/ "Webhooks FAQ").`, }, - image: { + author: { "en-US": { sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, - id: `c7orLdboQQowIUs22KAW4U`, - type: `Asset`, - createdAt: `2020-04-09T10:53:02.132Z`, - updatedAt: `2020-04-09T10:53:02.132Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 1, - contentful_id: `7orLdboQQowIUs22KAW4U`, - }, - fields: { - title: { - "en-US": `Sparkler`, - }, - description: { - "en-US": `John with Sparkler`, - }, - file: { - "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/7orLdboQQowIUs22KAW4U/d6906da78e61909fc5ad673d00da68e1/matt-palmer-254999.jpg`, - details: { - size: 2293094, - image: { - width: 3000, - height: 2000, - }, - }, - fileName: `matt-palmer-254999.jpg`, - contentType: `image/jpeg`, - }, - }, + type: `Link`, + linkType: `Entry`, + id: `c15jwOBqpxqSAOy2eOO4S0m`, + contentful_id: `15jwOBqpxqSAOy2eOO4S0m`, }, }, }, + publishDate: { "en-US": `2017-05-12T00:00+02:00` }, + tags: { "en-US": [`javascript`] }, }, }, { @@ -126,10 +77,10 @@ exports.initialSync = { contentful_id: `uzfinxahlog0`, }, }, - id: `c31TNnjHlfaGUoMOwU0M2og`, + id: `c3K9b0esdy0q0yGqgW2g6Ke`, type: `Entry`, - createdAt: `2020-04-09T10:53:01.488Z`, - updatedAt: `2020-04-09T10:53:01.488Z`, + createdAt: `2020-06-03T14:17:32.289Z`, + updatedAt: `2020-06-03T14:17:32.289Z`, environment: { sys: { id: `master`, @@ -147,194 +98,39 @@ exports.initialSync = { contentful_id: `blogPost`, }, }, - contentful_id: `31TNnjHlfaGUoMOwU0M2og`, + contentful_id: `3K9b0esdy0q0yGqgW2g6Ke`, }, fields: { - title: { - "en-US": `Automate with webhooks`, - }, - slug: { - "en-US": `automate-with-webhooks`, - }, + title: { "en-US": `Hello world` }, + slug: { "en-US": `hello-world` }, heroImage: { "en-US": { sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, - id: `c4shwYI3POEGkw0Eg6kcyaQ`, - type: `Asset`, - createdAt: `2020-04-09T10:53:03.759Z`, - updatedAt: `2020-04-09T10:53:03.759Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 1, - contentful_id: `4shwYI3POEGkw0Eg6kcyaQ`, - }, - fields: { - title: { - "en-US": `Man in the fields`, - }, - description: { - "en-US": `Tattooed man walking in a field`, - }, - file: { - "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/4shwYI3POEGkw0Eg6kcyaQ/c4cb544901e8c454265d7350c9fa565d/felix-russell-saw-112140.jpg`, - details: { - size: 4539181, - image: { - width: 2500, - height: 1667, - }, - }, - fileName: `felix-russell-saw-112140.jpg`, - contentType: `image/jpeg`, - }, - }, + type: `Link`, + linkType: `Asset`, + id: `c6Od9v3wzLOysiMum0Wkmme`, + contentful_id: `6Od9v3wzLOysiMum0Wkmme`, }, }, }, description: { - "en-US": `Webhooks notify you, another person or system when resources have changed by calling a given HTTP endpoint.`, + "en-US": `Your very first content with Contentful, pulled in JSON format using the Content Delivery API.`, }, body: { - "en-US": `## What are webhooks?\n\nThe webhooks are used to notify you when content has been changed. Specify a URL, configure your webhook, and we will send an HTTP POST request whenever something happens to your content.\n\n## How do I configure a webhook?\n\nGo to Settings ÔåÆ Webhooks from the navigation bar at the top. From there, hit Add webhook, and you will be directed to your new webhook. Then choose a name, put in the information of your HTTP endpoint (URL and authentication), specify any custom headers and select the types of events that should trigger the webhook.\n\n## Why do I get an old version in the CDA?\n\nAs the delivery API is powered by a CDN network consisting of hundreds of servers distributed across continents, it takes some time (up to a few minutes) to reflect the changes to the published content. This must be taken into consideration when reacting to webhooks. In normal conditions, there could be a reasonable delay of 2 to 5 minutes.\n\nExtracted from the [Webhooks FAQ](https://www.contentful.com/faq/webhooks/ "Webhooks FAQ").`, + "en-US": `These is your very first content with Contentful, pulled in JSON format using the [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/ "Content Delivery API"). Content and presentation are now decoupled, allowing you to focus your efforts in building the perfect app.\n\n## Your first steps\n\nBuilding with Contentful is easy. First take a moment to get [the basics of content modelling](https://www.contentful.com/r/knowledgebase/content-modelling-basics/ "the basics of content modelling"), which you can set up in the [Contentful Web app](https://app.contentful.com/ "Contentful Web app"). Once you get that, feel free to drop by the [Documentation](https://www.contentful.com/developers/docs/ "Documentation") to learn a bit more about how to build your app with Contentful, in particular the [API basics](https://www.contentful.com/developers/docs/concepts/apis/ "API basics") and each one of our four APIs, as shown below.\n\n### Content Delivery API\n\nThe [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/ "Content Delivery API") (CDA), available at \`cdn.contentful.com\`, is a read-only API for delivering content from Contentful to apps, websites and other media. Content is delivered as JSON data, and images, videos and other media as files.\nThe API is available via a globally distributed content delivery network. The server closest to the user serves all content, both JSON and binary. This minimizes latency, which especially benefits mobile apps. Hosting content in multiple global data centers also greatly improves the availability of content.\n\n### Content Management API\n\nThe [Content Management API](https://www.contentful.com/developers/docs/references/content-management-api/ "Content Management API") (CMA), available at \`api.contentful.com\`, is a read-write API for managing content. Unlike the Content Delivery API, the management API requires you to authenticate as a Contentful user. You could use the CMA for several use cases, such as:\n* Automatic imports from different CMSes like WordPress or Drupal.\n* Integration with other backend systems, such as an e-commerce shop.\n* Building custom editing experiences. We built the [Contentful Web app](https://app.contentful.com/ "Contentful Web app") on top of this API.\n\n### Preview API\n\nThe [Content Preview API](https://www.contentful.com/developers/docs/concepts/apis/#content-preview-api "Content Preview API"), available at \`preview.contentful.com\`, is a variant of the CDA for previewing your content before delivering it to your customers. You use the Content Preview API in combination with a "preview" deployment of your website (or a "preview" build of your mobile app) that allows content managers and authors to view their work in-context, as if it were published, using a "preview" access token as though it were delivered by the CDA.\n\n### Images API\n\nThe [Images API](https://www.contentful.com/developers/docs/concepts/apis/#images-api "Images API"), available at \`images.contentful.com\`, allows you to resize and crop images, change their background color and convert them to different formats. Using our API for these transformations lets you upload high-quality assets, deliver exactly what your app needs, and still get all the benefits of our caching CDN.`, }, author: { "en-US": { sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, + type: `Link`, + linkType: `Entry`, id: `c15jwOBqpxqSAOy2eOO4S0m`, - type: `Entry`, - createdAt: `2020-04-09T10:53:01.487Z`, - updatedAt: `2020-04-09T10:55:54.432Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 2, - contentType: { - sys: { - type: `Link`, - linkType: `ContentType`, - id: `person`, - contentful_id: `person`, - }, - }, contentful_id: `15jwOBqpxqSAOy2eOO4S0m`, }, - fields: { - name: { - "en-US": `John Doe`, - }, - title: { - "en-US": `Web Developer`, - nl: `Web developer`, - }, - company: { - "en-US": `ACME`, - }, - shortBio: { - "en-US": `Research and recommendations for modern stack websites.`, - nl: `Onderzoek en aanbevelingen voor moderne stapelwebsites.`, - }, - email: { - "en-US": `john@doe.com`, - }, - phone: { - "en-US": `0176 / 1234567`, - }, - facebook: { - "en-US": `johndoe`, - }, - twitter: { - "en-US": `johndoe`, - }, - github: { - "en-US": `johndoe`, - }, - image: { - "en-US": { - sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, - id: `c7orLdboQQowIUs22KAW4U`, - type: `Asset`, - createdAt: `2020-04-09T10:53:02.132Z`, - updatedAt: `2020-04-09T10:53:02.132Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 1, - contentful_id: `7orLdboQQowIUs22KAW4U`, - }, - fields: { - title: { - "en-US": `Sparkler`, - }, - description: { - "en-US": `John with Sparkler`, - }, - file: { - "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/7orLdboQQowIUs22KAW4U/d6906da78e61909fc5ad673d00da68e1/matt-palmer-254999.jpg`, - details: { - size: 2293094, - image: { - width: 3000, - height: 2000, - }, - }, - fileName: `matt-palmer-254999.jpg`, - contentType: `image/jpeg`, - }, - }, - }, - }, - }, - }, }, }, - publishDate: { - "en-US": `2017-05-12T00:00+02:00`, - }, - tags: { - "en-US": [`javascript`], - }, + publishDate: { "en-US": `2017-05-15T00:00+02:00` }, + tags: { "en-US": [`general`] }, }, }, { @@ -347,10 +143,10 @@ exports.initialSync = { contentful_id: `uzfinxahlog0`, }, }, - id: `c3K9b0esdy0q0yGqgW2g6Ke`, + id: `c2PtC9h1YqIA6kaUaIsWEQ0`, type: `Entry`, - createdAt: `2020-04-09T10:53:01.485Z`, - updatedAt: `2020-04-09T10:53:01.485Z`, + createdAt: `2020-06-03T14:17:31.852Z`, + updatedAt: `2020-06-03T14:17:31.852Z`, environment: { sys: { id: `master`, @@ -368,194 +164,39 @@ exports.initialSync = { contentful_id: `blogPost`, }, }, - contentful_id: `3K9b0esdy0q0yGqgW2g6Ke`, + contentful_id: `2PtC9h1YqIA6kaUaIsWEQ0`, }, fields: { - title: { - "en-US": `Hello world`, - }, - slug: { - "en-US": `hello-world`, - }, + title: { "en-US": `Static sites are great` }, + slug: { "en-US": `static-sites-are-great` }, heroImage: { "en-US": { sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, - id: `c6Od9v3wzLOysiMum0Wkmme`, - type: `Asset`, - createdAt: `2020-04-09T10:53:01.953Z`, - updatedAt: `2020-04-09T10:53:01.953Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 1, - contentful_id: `6Od9v3wzLOysiMum0Wkmme`, - }, - fields: { - title: { - "en-US": `Woman with black hat`, - }, - description: { - "en-US": `Woman wearing a black hat`, - }, - file: { - "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/6Od9v3wzLOysiMum0Wkmme/6617fbe227b7362b236fc6777c0a67bf/cameron-kirby-88711.jpg`, - details: { - size: 7316629, - image: { - width: 3000, - height: 2000, - }, - }, - fileName: `cameron-kirby-88711.jpg`, - contentType: `image/jpeg`, - }, - }, + type: `Link`, + linkType: `Asset`, + id: `c4NzwDSDlGECGIiokKomsyI`, + contentful_id: `4NzwDSDlGECGIiokKomsyI`, }, }, }, description: { - "en-US": `Your very first content with Contentful, pulled in JSON format using the Content Delivery API.`, + "en-US": `Worry less about security, caching, and talking to the server. Static sites are the new thing.`, }, body: { - "en-US": `These is your very first content with Contentful, pulled in JSON format using the [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/ "Content Delivery API"). Content and presentation are now decoupled, allowing you to focus your efforts in building the perfect app.\n\n## Your first steps\n\nBuilding with Contentful is easy. First take a moment to get [the basics of content modelling](https://www.contentful.com/r/knowledgebase/content-modelling-basics/ "the basics of content modelling"), which you can set up in the [Contentful Web app](https://app.contentful.com/ "Contentful Web app"). Once you get that, feel free to drop by the [Documentation](https://www.contentful.com/developers/docs/ "Documentation") to learn a bit more about how to build your app with Contentful, in particular the [API basics](https://www.contentful.com/developers/docs/concepts/apis/ "API basics") and each one of our four APIs, as shown below.\n\n### Content Delivery API\n\nThe [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/ "Content Delivery API") (CDA), available at \`cdn.contentful.com\`, is a read-only API for delivering content from Contentful to apps, websites and other media. Content is delivered as JSON data, and images, videos and other media as files.\nThe API is available via a globally distributed content delivery network. The server closest to the user serves all content, both JSON and binary. This minimizes latency, which especially benefits mobile apps. Hosting content in multiple global data centers also greatly improves the availability of content.\n\n### Content Management API\n\nThe [Content Management API](https://www.contentful.com/developers/docs/references/content-management-api/ "Content Management API") (CMA), available at \`api.contentful.com\`, is a read-write API for managing content. Unlike the Content Delivery API, the management API requires you to authenticate as a Contentful user. You could use the CMA for several use cases, such as:\n* Automatic imports from different CMSes like WordPress or Drupal.\n* Integration with other backend systems, such as an e-commerce shop.\n* Building custom editing experiences. We built the [Contentful Web app](https://app.contentful.com/ "Contentful Web app") on top of this API.\n\n### Preview API\n\nThe [Content Preview API](https://www.contentful.com/developers/docs/concepts/apis/#content-preview-api "Content Preview API"), available at \`preview.contentful.com\`, is a variant of the CDA for previewing your content before delivering it to your customers. You use the Content Preview API in combination with a "preview" deployment of your website (or a "preview" build of your mobile app) that allows content managers and authors to view their work in-context, as if it were published, using a "preview" access token as though it were delivered by the CDA.\n\n### Images API\n\nThe [Images API](https://www.contentful.com/developers/docs/concepts/apis/#images-api "Images API"), available at \`images.contentful.com\`, allows you to resize and crop images, change their background color and convert them to different formats. Using our API for these transformations lets you upload high-quality assets, deliver exactly what your app needs, and still get all the benefits of our caching CDN.`, + "en-US": `## The case for the static site generator\n\nMore and more developers are jumping on the "go static train", and rightfully so. Static pages are fast, lightweight, they scale well. They are more secure, and simple to maintain and they allow you to focus all your time and effort on the user interface. Often times, this dedication really shows.\n\nIt just so happens that static site generators are mostly loved by developers, but not by the average Joe. They do not offer WYSIWYG, previewing on demo sites may take an update cycle, they are often based on markdown text files, and they require some knowledge of modern day repositories.\n\nMoreover, when teams are collaborating, it can get complicated quickly. Has this article already been proof-read or reviewed? Is this input valid? Are user permissions available, e.g. for administering adding and removing team members? Can this article be published at a future date? How can a large repository of content be categorized, organized, and searched? All these requirements have previously been more or less solved within the admin area of your CMS. But of course with all the baggage that made you leave the appserver-app-database-in-one-big-blob stack in the first place.\n\n## Content APIs to the rescue\n\nAn alternative is decoupling the content management aspect from the system. And then replacing the maintenance prone server with a cloud based web service offering. Effectively, instead of your CMS of old, you move to a [Content Management as a Service (CMaaS)](https://www.contentful.com/r/knowledgebase/content-as-a-service/ "Content Management as a Service (CMaaS)") world, with a content API to deliver all your content. That way, you get the all the [benefits of content management features](http://www.digett.com/blog/01/16/2014/pairing-static-websites-cms "benefits of content management features") while still being able to embrace the static site generator mantra.\n\nIt so happens that Contentful is offering just that kind of content API. A service that\n\n* from the ground up has been designed to be fast, scalable, secure, and offer high uptime, so that you don’t have to worry about maintenance ever again.\n* offers a powerful editor and lots of flexibility in creating templates for your documents that your editors can reuse and combine, so that no developers resources are required in everyday writing and updating tasks.\n* separates content from presentation, so you can reuse your content repository for any device platform your heart desires. That way, you can COPE ("create once, publish everywhere").\n* offers webhooks that you can use to rebuild your static site in a fully automated fashion every time your content is modified.\n\nExtracted from the article [CMS-functionality for static site generators](https://www.contentful.com/r/knowledgebase/contentful-api-cms-static-site-generators/ "CMS-functionality for static site generators"). Read more about the [static site generators supported by Contentful](https://www.contentful.com/developers/docs/tools/staticsitegenerators/ "static site generators supported by Contentful").`, }, author: { "en-US": { sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, + type: `Link`, + linkType: `Entry`, id: `c15jwOBqpxqSAOy2eOO4S0m`, - type: `Entry`, - createdAt: `2020-04-09T10:53:01.487Z`, - updatedAt: `2020-04-09T10:55:54.432Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 2, - contentType: { - sys: { - type: `Link`, - linkType: `ContentType`, - id: `person`, - contentful_id: `person`, - }, - }, contentful_id: `15jwOBqpxqSAOy2eOO4S0m`, }, - fields: { - name: { - "en-US": `John Doe`, - }, - title: { - "en-US": `Web Developer`, - nl: `Web developer`, - }, - company: { - "en-US": `ACME`, - }, - shortBio: { - "en-US": `Research and recommendations for modern stack websites.`, - nl: `Onderzoek en aanbevelingen voor moderne stapelwebsites.`, - }, - email: { - "en-US": `john@doe.com`, - }, - phone: { - "en-US": `0176 / 1234567`, - }, - facebook: { - "en-US": `johndoe`, - }, - twitter: { - "en-US": `johndoe`, - }, - github: { - "en-US": `johndoe`, - }, - image: { - "en-US": { - sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, - id: `c7orLdboQQowIUs22KAW4U`, - type: `Asset`, - createdAt: `2020-04-09T10:53:02.132Z`, - updatedAt: `2020-04-09T10:53:02.132Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 1, - contentful_id: `7orLdboQQowIUs22KAW4U`, - }, - fields: { - title: { - "en-US": `Sparkler`, - }, - description: { - "en-US": `John with Sparkler`, - }, - file: { - "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/7orLdboQQowIUs22KAW4U/d6906da78e61909fc5ad673d00da68e1/matt-palmer-254999.jpg`, - details: { - size: 2293094, - image: { - width: 3000, - height: 2000, - }, - }, - fileName: `matt-palmer-254999.jpg`, - contentType: `image/jpeg`, - }, - }, - }, - }, - }, - }, }, }, - publishDate: { - "en-US": `2017-05-15T00:00+02:00`, - }, - tags: { - "en-US": [`general`], - }, + publishDate: { "en-US": `2017-05-16T00:00+02:00` }, + tags: { "en-US": [`javascript`, `static-sites`] }, }, }, { @@ -568,10 +209,10 @@ exports.initialSync = { contentful_id: `uzfinxahlog0`, }, }, - id: `c2PtC9h1YqIA6kaUaIsWEQ0`, + id: `c15jwOBqpxqSAOy2eOO4S0m`, type: `Entry`, - createdAt: `2020-04-09T10:53:01.483Z`, - updatedAt: `2020-04-09T10:53:01.483Z`, + createdAt: `2020-06-03T14:17:31.246Z`, + updatedAt: `2020-06-03T14:17:31.246Z`, environment: { sys: { id: `master`, @@ -585,198 +226,34 @@ exports.initialSync = { sys: { type: `Link`, linkType: `ContentType`, - id: `blogPost`, - contentful_id: `blogPost`, + id: `person`, + contentful_id: `person`, }, }, - contentful_id: `2PtC9h1YqIA6kaUaIsWEQ0`, + contentful_id: `15jwOBqpxqSAOy2eOO4S0m`, }, fields: { - title: { - "en-US": `Static sites are great`, - }, - slug: { - "en-US": `static-sites-are-great`, - }, - heroImage: { - "en-US": { - sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, - id: `c4NzwDSDlGECGIiokKomsyI`, - type: `Asset`, - createdAt: `2020-04-09T10:53:01.941Z`, - updatedAt: `2020-04-09T10:53:01.941Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 1, - contentful_id: `4NzwDSDlGECGIiokKomsyI`, - }, - fields: { - title: { - "en-US": `City`, - }, - description: { - "en-US": `City pictured from the sky`, - }, - file: { - "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/4NzwDSDlGECGIiokKomsyI/c3745babd5d75655d1ce71d8a79b5986/denys-nevozhai-100695.jpg`, - details: { - size: 15736986, - image: { - width: 3992, - height: 2992, - }, - }, - fileName: `denys-nevozhai-100695.jpg`, - contentType: `image/jpeg`, - }, - }, - }, - }, - }, - description: { - "en-US": `Worry less about security, caching, and talking to the server. Static sites are the new thing.`, - }, - body: { - "en-US": `## The case for the static site generator\n\nMore and more developers are jumping on the "go static train", and rightfully so. Static pages are fast, lightweight, they scale well. They are more secure, and simple to maintain and they allow you to focus all your time and effort on the user interface. Often times, this dedication really shows.\n\nIt just so happens that static site generators are mostly loved by developers, but not by the average Joe. They do not offer WYSIWYG, previewing on demo sites may take an update cycle, they are often based on markdown text files, and they require some knowledge of modern day repositories.\n\nMoreover, when teams are collaborating, it can get complicated quickly. Has this article already been proof-read or reviewed? Is this input valid? Are user permissions available, e.g. for administering adding and removing team members? Can this article be published at a future date? How can a large repository of content be categorized, organized, and searched? All these requirements have previously been more or less solved within the admin area of your CMS. But of course with all the baggage that made you leave the appserver-app-database-in-one-big-blob stack in the first place.\n\n## Content APIs to the rescue\n\nAn alternative is decoupling the content management aspect from the system. And then replacing the maintenance prone server with a cloud based web service offering. Effectively, instead of your CMS of old, you move to a [Content Management as a Service (CMaaS)](https://www.contentful.com/r/knowledgebase/content-as-a-service/ "Content Management as a Service (CMaaS)") world, with a content API to deliver all your content. That way, you get the all the [benefits of content management features](http://www.digett.com/blog/01/16/2014/pairing-static-websites-cms "benefits of content management features") while still being able to embrace the static site generator mantra.\n\nIt so happens that Contentful is offering just that kind of content API. A service that\n\n* from the ground up has been designed to be fast, scalable, secure, and offer high uptime, so that you donÔÇÖt have to worry about maintenance ever again.\n* offers a powerful editor and lots of flexibility in creating templates for your documents that your editors can reuse and combine, so that no developers resources are required in everyday writing and updating tasks.\n* separates content from presentation, so you can reuse your content repository for any device platform your heart desires. That way, you can COPE ("create once, publish everywhere").\n* offers webhooks that you can use to rebuild your static site in a fully automated fashion every time your content is modified.\n\nExtracted from the article [CMS-functionality for static site generators](https://www.contentful.com/r/knowledgebase/contentful-api-cms-static-site-generators/ "CMS-functionality for static site generators"). Read more about the [static site generators supported by Contentful](https://www.contentful.com/developers/docs/tools/staticsitegenerators/ "static site generators supported by Contentful").`, + name: { "en-US": `John Doe` }, + title: { "en-US": `Web Developer` }, + company: { "en-US": `ACME` }, + shortBio: { + "en-US": `Research and recommendations for modern stack websites.`, }, - author: { + email: { "en-US": `john@doe.com` }, + phone: { "en-US": `0176 / 1234567` }, + facebook: { "en-US": `johndoe` }, + twitter: { "en-US": `johndoe` }, + github: { "en-US": `johndoe` }, + image: { "en-US": { sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, - id: `c15jwOBqpxqSAOy2eOO4S0m`, - type: `Entry`, - createdAt: `2020-04-09T10:53:01.487Z`, - updatedAt: `2020-04-09T10:55:54.432Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 2, - contentType: { - sys: { - type: `Link`, - linkType: `ContentType`, - id: `person`, - contentful_id: `person`, - }, - }, - contentful_id: `15jwOBqpxqSAOy2eOO4S0m`, - }, - fields: { - name: { - "en-US": `John Doe`, - }, - title: { - "en-US": `Web Developer`, - nl: `Web developer`, - }, - company: { - "en-US": `ACME`, - }, - shortBio: { - "en-US": `Research and recommendations for modern stack websites.`, - nl: `Onderzoek en aanbevelingen voor moderne stapelwebsites.`, - }, - email: { - "en-US": `john@doe.com`, - }, - phone: { - "en-US": `0176 / 1234567`, - }, - facebook: { - "en-US": `johndoe`, - }, - twitter: { - "en-US": `johndoe`, - }, - github: { - "en-US": `johndoe`, - }, - image: { - "en-US": { - sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, - id: `c7orLdboQQowIUs22KAW4U`, - type: `Asset`, - createdAt: `2020-04-09T10:53:02.132Z`, - updatedAt: `2020-04-09T10:53:02.132Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 1, - contentful_id: `7orLdboQQowIUs22KAW4U`, - }, - fields: { - title: { - "en-US": `Sparkler`, - }, - description: { - "en-US": `John with Sparkler`, - }, - file: { - "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/7orLdboQQowIUs22KAW4U/d6906da78e61909fc5ad673d00da68e1/matt-palmer-254999.jpg`, - details: { - size: 2293094, - image: { - width: 3000, - height: 2000, - }, - }, - fileName: `matt-palmer-254999.jpg`, - contentType: `image/jpeg`, - }, - }, - }, - }, - }, + type: `Link`, + linkType: `Asset`, + id: `c7orLdboQQowIUs22KAW4U`, + contentful_id: `7orLdboQQowIUs22KAW4U`, }, }, }, - publishDate: { - "en-US": `2017-05-16T00:00+02:00`, - }, - tags: { - "en-US": [`javascript`, `static-sites`], - }, }, }, ], @@ -791,10 +268,10 @@ exports.initialSync = { contentful_id: `uzfinxahlog0`, }, }, - id: `c4shwYI3POEGkw0Eg6kcyaQ`, + id: `c6Od9v3wzLOysiMum0Wkmme`, type: `Asset`, - createdAt: `2020-04-09T10:53:03.759Z`, - updatedAt: `2020-04-09T10:53:03.759Z`, + createdAt: `2020-06-03T14:17:27.525Z`, + updatedAt: `2020-06-03T14:17:27.525Z`, environment: { sys: { id: `master`, @@ -804,26 +281,16 @@ exports.initialSync = { }, }, revision: 1, - contentful_id: `4shwYI3POEGkw0Eg6kcyaQ`, + contentful_id: `6Od9v3wzLOysiMum0Wkmme`, }, fields: { - title: { - "en-US": `Man in the fields`, - }, - description: { - "en-US": `Tattooed man walking in a field`, - }, + title: { "en-US": `Woman with black hat` }, + description: { "en-US": `Woman wearing a black hat` }, file: { "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/4shwYI3POEGkw0Eg6kcyaQ/c4cb544901e8c454265d7350c9fa565d/felix-russell-saw-112140.jpg`, - details: { - size: 4539181, - image: { - width: 2500, - height: 1667, - }, - }, - fileName: `felix-russell-saw-112140.jpg`, + url: `//images.ctfassets.net/uzfinxahlog0/6Od9v3wzLOysiMum0Wkmme/d261929fcaffdd2e676d450fc519decf/cameron-kirby-88711.jpg`, + details: { size: 7316629, image: { width: 3000, height: 2000 } }, + fileName: `cameron-kirby-88711.jpg`, contentType: `image/jpeg`, }, }, @@ -839,10 +306,10 @@ exports.initialSync = { contentful_id: `uzfinxahlog0`, }, }, - id: `c7orLdboQQowIUs22KAW4U`, + id: `c4NzwDSDlGECGIiokKomsyI`, type: `Asset`, - createdAt: `2020-04-09T10:53:02.132Z`, - updatedAt: `2020-04-09T10:53:02.132Z`, + createdAt: `2020-06-03T14:17:27.247Z`, + updatedAt: `2020-06-03T14:17:27.247Z`, environment: { sys: { id: `master`, @@ -852,26 +319,16 @@ exports.initialSync = { }, }, revision: 1, - contentful_id: `7orLdboQQowIUs22KAW4U`, + contentful_id: `4NzwDSDlGECGIiokKomsyI`, }, fields: { - title: { - "en-US": `Sparkler`, - }, - description: { - "en-US": `John with Sparkler`, - }, + title: { "en-US": `City` }, + description: { "en-US": `City pictured from the sky` }, file: { "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/7orLdboQQowIUs22KAW4U/d6906da78e61909fc5ad673d00da68e1/matt-palmer-254999.jpg`, - details: { - size: 2293094, - image: { - width: 3000, - height: 2000, - }, - }, - fileName: `matt-palmer-254999.jpg`, + url: `//images.ctfassets.net/uzfinxahlog0/4NzwDSDlGECGIiokKomsyI/f763654f90472d84e928b653a6741c05/denys-nevozhai-100695.jpg`, + details: { size: 15736986, image: { width: 3992, height: 2992 } }, + fileName: `denys-nevozhai-100695.jpg`, contentType: `image/jpeg`, }, }, @@ -887,10 +344,10 @@ exports.initialSync = { contentful_id: `uzfinxahlog0`, }, }, - id: `c6Od9v3wzLOysiMum0Wkmme`, + id: `c4shwYI3POEGkw0Eg6kcyaQ`, type: `Asset`, - createdAt: `2020-04-09T10:53:01.953Z`, - updatedAt: `2020-04-09T10:53:01.953Z`, + createdAt: `2020-06-03T14:17:26.971Z`, + updatedAt: `2020-06-03T14:17:26.971Z`, environment: { sys: { id: `master`, @@ -900,26 +357,16 @@ exports.initialSync = { }, }, revision: 1, - contentful_id: `6Od9v3wzLOysiMum0Wkmme`, + contentful_id: `4shwYI3POEGkw0Eg6kcyaQ`, }, fields: { - title: { - "en-US": `Woman with black hat`, - }, - description: { - "en-US": `Woman wearing a black hat`, - }, + title: { "en-US": `Man in the fields` }, + description: { "en-US": `Tattooed man walking in a field` }, file: { "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/6Od9v3wzLOysiMum0Wkmme/6617fbe227b7362b236fc6777c0a67bf/cameron-kirby-88711.jpg`, - details: { - size: 7316629, - image: { - width: 3000, - height: 2000, - }, - }, - fileName: `cameron-kirby-88711.jpg`, + url: `//images.ctfassets.net/uzfinxahlog0/4shwYI3POEGkw0Eg6kcyaQ/48c44bb6ebb52013dd14addd25725a76/felix-russell-saw-112140.jpg`, + details: { size: 4539181, image: { width: 2500, height: 1667 } }, + fileName: `felix-russell-saw-112140.jpg`, contentType: `image/jpeg`, }, }, @@ -935,10 +382,10 @@ exports.initialSync = { contentful_id: `uzfinxahlog0`, }, }, - id: `c4NzwDSDlGECGIiokKomsyI`, + id: `c7orLdboQQowIUs22KAW4U`, type: `Asset`, - createdAt: `2020-04-09T10:53:01.941Z`, - updatedAt: `2020-04-09T10:53:01.941Z`, + createdAt: `2020-06-03T14:17:26.685Z`, + updatedAt: `2020-06-03T14:17:26.685Z`, environment: { sys: { id: `master`, @@ -948,26 +395,16 @@ exports.initialSync = { }, }, revision: 1, - contentful_id: `4NzwDSDlGECGIiokKomsyI`, + contentful_id: `7orLdboQQowIUs22KAW4U`, }, fields: { - title: { - "en-US": `City`, - }, - description: { - "en-US": `City pictured from the sky`, - }, + title: { "en-US": `Sparkler` }, + description: { "en-US": `John with Sparkler` }, file: { "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/4NzwDSDlGECGIiokKomsyI/c3745babd5d75655d1ce71d8a79b5986/denys-nevozhai-100695.jpg`, - details: { - size: 15736986, - image: { - width: 3992, - height: 2992, - }, - }, - fileName: `denys-nevozhai-100695.jpg`, + url: `//images.ctfassets.net/uzfinxahlog0/7orLdboQQowIUs22KAW4U/c0f07c92d9eb36b73c883681e639441c/matt-palmer-254999.jpg`, + details: { size: 2293094, image: { width: 3000, height: 2000 } }, + fileName: `matt-palmer-254999.jpg`, contentType: `image/jpeg`, }, }, @@ -976,7 +413,7 @@ exports.initialSync = { ], deletedEntries: [], deletedAssets: [], - nextSyncToken: `wrXDkijCgsOuTgwXKDbCk8KiwqbCjmTDo0zCn0zCjMKdFsO5w5zCmFIhwpdnSGJFWl_Cn0DCvsKOSlzDqMKIC8KpwqPDucOKw43CmVbDvsKtPGdXw40MwqNccVvCscOkwqPDssOMAsKKwpxqM3cZBHBew7XDtMO5UQ`, + nextSyncToken: `FEnChMOBwr1Yw4TCqsK2LcKpCH3CjsORIyLDrGbDtgozw6xreMKCwpjCtlxATw3CswoUY34WECLCh152KsOLQcKwH8Kfw4kOQcOlw6TCr8OmEcKiwrhBZ8KhwrLCrcOsA8KYAMOFwo1kBMOZwrHDgCbDllcXVA`, }, contentTypeItems: [ { @@ -989,10 +426,10 @@ exports.initialSync = { contentful_id: `uzfinxahlog0`, }, }, - id: `blogPost`, + id: `person`, type: `ContentType`, - createdAt: `2020-04-09T10:52:57.586Z`, - updatedAt: `2020-04-09T10:52:57.586Z`, + createdAt: `2020-06-03T14:17:18.696Z`, + updatedAt: `2020-06-03T14:17:18.696Z`, environment: { sys: { id: `master`, @@ -1002,15 +439,15 @@ exports.initialSync = { }, }, revision: 1, - contentful_id: `blogPost`, + contentful_id: `person`, }, - displayField: `title`, - name: `Blog Post`, - description: null, + displayField: `name`, + name: `Person`, + description: ``, fields: [ { - id: `title`, - name: `Title`, + id: `name`, + name: `Name`, type: `Symbol`, localized: false, required: true, @@ -1018,8 +455,8 @@ exports.initialSync = { omitted: false, }, { - id: `slug`, - name: `Slug`, + id: `title`, + name: `Title`, type: `Symbol`, localized: false, required: true, @@ -1027,18 +464,17 @@ exports.initialSync = { omitted: false, }, { - id: `heroImage`, - name: `Hero Image`, - type: `Link`, + id: `company`, + name: `Company`, + type: `Symbol`, localized: false, required: true, disabled: false, omitted: false, - linkType: `Asset`, }, { - id: `description`, - name: `Description`, + id: `shortBio`, + name: `Short Bio`, type: `Text`, localized: false, required: true, @@ -1046,49 +482,59 @@ exports.initialSync = { omitted: false, }, { - id: `body`, - name: `Body`, - type: `Text`, + id: `email`, + name: `Email`, + type: `Symbol`, localized: false, - required: true, + required: false, disabled: false, omitted: false, }, { - id: `author`, - name: `Author`, - type: `Link`, + id: `phone`, + name: `Phone`, + type: `Symbol`, localized: false, required: false, disabled: false, omitted: false, - linkType: `Entry`, }, { - id: `publishDate`, - name: `Publish Date`, - type: `Date`, + id: `facebook`, + name: `Facebook`, + type: `Symbol`, localized: false, - required: true, + required: false, disabled: false, omitted: false, }, { - id: `tags`, - name: `Tags`, - type: `Array`, + id: `twitter`, + name: `Twitter`, + type: `Symbol`, localized: false, required: false, disabled: false, omitted: false, - items: { - type: `Symbol`, - validations: [ - { - in: [`general`, `javascript`, `static-sites`], - }, - ], - }, + }, + { + id: `github`, + name: `Github`, + type: `Symbol`, + localized: false, + required: false, + disabled: false, + omitted: false, + }, + { + id: `image`, + name: `Image`, + type: `Link`, + localized: false, + required: false, + disabled: false, + omitted: false, + linkType: `Asset`, }, ], }, @@ -1102,10 +548,10 @@ exports.initialSync = { contentful_id: `uzfinxahlog0`, }, }, - id: `person`, + id: `blogPost`, type: `ContentType`, - createdAt: `2020-04-09T10:52:57.596Z`, - updatedAt: `2020-04-09T10:54:43.408Z`, + createdAt: `2020-06-03T14:17:19.068Z`, + updatedAt: `2020-06-03T14:17:19.068Z`, environment: { sys: { id: `master`, @@ -1114,16 +560,16 @@ exports.initialSync = { contentful_id: `master`, }, }, - revision: 2, - contentful_id: `person`, + revision: 1, + contentful_id: `blogPost`, }, - displayField: `name`, - name: `Person`, - description: null, + displayField: `title`, + name: `Blog Post`, + description: ``, fields: [ { - id: `name`, - name: `Name`, + id: `title`, + name: `Title`, type: `Symbol`, localized: false, required: true, @@ -1131,86 +577,73 @@ exports.initialSync = { omitted: false, }, { - id: `title`, - name: `Title`, + id: `slug`, + name: `Slug`, type: `Symbol`, - localized: true, + localized: false, required: true, disabled: false, omitted: false, }, { - id: `company`, - name: `Company`, - type: `Symbol`, + id: `heroImage`, + name: `Hero Image`, + type: `Link`, localized: false, required: true, disabled: false, omitted: false, + linkType: `Asset`, }, { - id: `shortBio`, - name: `Short Bio`, + id: `description`, + name: `Description`, type: `Text`, - localized: true, - required: true, - disabled: false, - omitted: false, - }, - { - id: `email`, - name: `Email`, - type: `Symbol`, - localized: false, - required: false, - disabled: false, - omitted: false, - }, - { - id: `phone`, - name: `Phone`, - type: `Symbol`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `facebook`, - name: `Facebook`, - type: `Symbol`, + id: `body`, + name: `Body`, + type: `Text`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `twitter`, - name: `Twitter`, - type: `Symbol`, + id: `author`, + name: `Author`, + type: `Link`, localized: false, required: false, disabled: false, omitted: false, + linkType: `Entry`, }, { - id: `github`, - name: `Github`, - type: `Symbol`, + id: `publishDate`, + name: `Publish Date`, + type: `Date`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `image`, - name: `Image`, - type: `Link`, + id: `tags`, + name: `Tags`, + type: `Array`, localized: false, required: false, disabled: false, omitted: false, - linkType: `Asset`, + items: { + type: `Symbol`, + validations: [{ in: [`general`, `javascript`, `static-sites`] }], + }, }, ], }, @@ -1241,11 +674,8 @@ exports.initialSync = { }, ], space: { - sys: { - type: `Space`, - id: `uzfinxahlog0`, - }, - name: `gatsby-test`, + sys: { type: `Space`, id: `uzfinxahlog0` }, + name: `Starter Gatsby Blog`, locales: [ { code: `en-US`, @@ -1276,10 +706,10 @@ exports.createBlogPost = { contentful_id: `uzfinxahlog0`, }, }, - id: `c2XTZRrfbMRcfdyFSo4mrOR`, + id: `c1dHS3UzOqupJZY7AyeDc6s`, type: `Entry`, - createdAt: `2020-04-09T10:59:16.604Z`, - updatedAt: `2020-04-09T10:59:16.604Z`, + createdAt: `2020-06-03T14:22:37.720Z`, + updatedAt: `2020-06-03T14:22:37.720Z`, environment: { sys: { id: `master`, @@ -1297,62 +727,18 @@ exports.createBlogPost = { contentful_id: `blogPost`, }, }, - contentful_id: `2XTZRrfbMRcfdyFSo4mrOR`, + contentful_id: `1dHS3UzOqupJZY7AyeDc6s`, }, fields: { - title: { - "en-US": `Integration tests`, - }, - slug: { - "en-US": `integration-tests`, - }, + title: { "en-US": `Integration tests` }, + slug: { "en-US": `integration-tests` }, heroImage: { "en-US": { sys: { - space: { - sys: { - type: `Link`, - linkType: `Space`, - id: `uzfinxahlog0`, - contentful_id: `uzfinxahlog0`, - }, - }, - id: `c21xFOvxOk9guLHTakpnezz`, - type: `Asset`, - createdAt: `2020-04-09T10:59:13.259Z`, - updatedAt: `2020-04-09T10:59:13.259Z`, - environment: { - sys: { - id: `master`, - type: `Link`, - linkType: `Environment`, - contentful_id: `master`, - }, - }, - revision: 1, - contentful_id: `21xFOvxOk9guLHTakpnezz`, - }, - fields: { - title: { - "en-US": `Dummy image`, - }, - description: { - "en-US": `Just a dummy image`, - }, - file: { - "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/21xFOvxOk9guLHTakpnezz/11442938f3ed3db99680c78d69e256c4/dummy.jpg`, - details: { - size: 617491, - image: { - width: 2133, - height: 1200, - }, - }, - fileName: `dummy.jpg`, - contentType: `image/jpeg`, - }, - }, + type: `Link`, + linkType: `Asset`, + id: `c1aaRo2sQbdfWnG8iNvnkH3`, + contentful_id: `1aaRo2sQbdfWnG8iNvnkH3`, }, }, }, @@ -1372,9 +758,7 @@ exports.createBlogPost = { }, }, }, - publishDate: { - "en-US": `2020-04-01T00:00+00:00`, - }, + publishDate: { "en-US": `2020-04-01T00:00+02:00` }, }, }, ], @@ -1389,10 +773,10 @@ exports.createBlogPost = { contentful_id: `uzfinxahlog0`, }, }, - id: `c21xFOvxOk9guLHTakpnezz`, + id: `c1aaRo2sQbdfWnG8iNvnkH3`, type: `Asset`, - createdAt: `2020-04-09T10:59:13.259Z`, - updatedAt: `2020-04-09T10:59:13.259Z`, + createdAt: `2020-06-03T14:22:35.102Z`, + updatedAt: `2020-06-03T14:22:35.102Z`, environment: { sys: { id: `master`, @@ -1402,27 +786,17 @@ exports.createBlogPost = { }, }, revision: 1, - contentful_id: `21xFOvxOk9guLHTakpnezz`, + contentful_id: `1aaRo2sQbdfWnG8iNvnkH3`, }, fields: { - title: { - "en-US": `Dummy image`, - }, - description: { - "en-US": `Just a dummy image`, - }, + title: { "en-US": `Dummy image` }, + description: { "en-US": `Just a dummy image` }, file: { "en-US": { - url: `//images.ctfassets.net/uzfinxahlog0/21xFOvxOk9guLHTakpnezz/11442938f3ed3db99680c78d69e256c4/dummy.jpg`, - details: { - size: 617491, - image: { - width: 2133, - height: 1200, - }, - }, - fileName: `dummy.jpg`, - contentType: `image/jpeg`, + url: `//images.ctfassets.net/uzfinxahlog0/1aaRo2sQbdfWnG8iNvnkH3/4b70303a3989c92bdc09870a00d294a8/Gatsby_Monogram.png`, + details: { size: 77907, image: { width: 2000, height: 2000 } }, + fileName: `Gatsby_Monogram.png`, + contentType: `image/png`, }, }, }, @@ -1430,7 +804,7 @@ exports.createBlogPost = { ], deletedEntries: [], deletedAssets: [], - nextSyncToken: `wrXDkijCgsOuTgwXKDbCk8KiwqbCjmTDo0zCn0zCjMKdFsO5w5zCmFIhwpdnSGJFBhDDtTrCs8KPw6bCrQ3CssKIwo0Gw7BNN13DsMKYw4zDuUrClcOGb8Ouw4nDjGJAMRbDihVjTEgub8OpUMO2dR8Pc8O0wpw`, + nextSyncToken: `FEnChMOBwr1Yw4TCqsK2LcKpCH3CjsORIyLDrGbDtgozw6xreMKCwpjCtlxATw0YQMOfwrtZBsOQw41ww7xhJj8Ew4TChcOow6ZPPVVZaMOfOlFEwp7CpcOxwpd_YcKBw5jCkznDgMO6w4lsw73CrcOmwpILwqTClg`, }, contentTypeItems: [ { @@ -1443,10 +817,10 @@ exports.createBlogPost = { contentful_id: `uzfinxahlog0`, }, }, - id: `blogPost`, + id: `person`, type: `ContentType`, - createdAt: `2020-04-09T10:52:57.586Z`, - updatedAt: `2020-04-09T10:52:57.586Z`, + createdAt: `2020-06-03T14:17:18.696Z`, + updatedAt: `2020-06-03T14:17:18.696Z`, environment: { sys: { id: `master`, @@ -1456,15 +830,15 @@ exports.createBlogPost = { }, }, revision: 1, - contentful_id: `blogPost`, + contentful_id: `person`, }, - displayField: `title`, - name: `Blog Post`, - description: null, + displayField: `name`, + name: `Person`, + description: ``, fields: [ { - id: `title`, - name: `Title`, + id: `name`, + name: `Name`, type: `Symbol`, localized: false, required: true, @@ -1472,8 +846,8 @@ exports.createBlogPost = { omitted: false, }, { - id: `slug`, - name: `Slug`, + id: `title`, + name: `Title`, type: `Symbol`, localized: false, required: true, @@ -1481,18 +855,17 @@ exports.createBlogPost = { omitted: false, }, { - id: `heroImage`, - name: `Hero Image`, - type: `Link`, + id: `company`, + name: `Company`, + type: `Symbol`, localized: false, required: true, disabled: false, omitted: false, - linkType: `Asset`, }, { - id: `description`, - name: `Description`, + id: `shortBio`, + name: `Short Bio`, type: `Text`, localized: false, required: true, @@ -1500,49 +873,59 @@ exports.createBlogPost = { omitted: false, }, { - id: `body`, - name: `Body`, - type: `Text`, + id: `email`, + name: `Email`, + type: `Symbol`, localized: false, - required: true, + required: false, disabled: false, omitted: false, }, { - id: `author`, - name: `Author`, - type: `Link`, + id: `phone`, + name: `Phone`, + type: `Symbol`, localized: false, required: false, disabled: false, omitted: false, - linkType: `Entry`, }, { - id: `publishDate`, - name: `Publish Date`, - type: `Date`, + id: `facebook`, + name: `Facebook`, + type: `Symbol`, localized: false, - required: true, + required: false, disabled: false, omitted: false, }, { - id: `tags`, - name: `Tags`, - type: `Array`, + id: `twitter`, + name: `Twitter`, + type: `Symbol`, localized: false, required: false, disabled: false, omitted: false, - items: { - type: `Symbol`, - validations: [ - { - in: [`general`, `javascript`, `static-sites`], - }, - ], - }, + }, + { + id: `github`, + name: `Github`, + type: `Symbol`, + localized: false, + required: false, + disabled: false, + omitted: false, + }, + { + id: `image`, + name: `Image`, + type: `Link`, + localized: false, + required: false, + disabled: false, + omitted: false, + linkType: `Asset`, }, ], }, @@ -1556,10 +939,10 @@ exports.createBlogPost = { contentful_id: `uzfinxahlog0`, }, }, - id: `person`, + id: `blogPost`, type: `ContentType`, - createdAt: `2020-04-09T10:52:57.596Z`, - updatedAt: `2020-04-09T10:54:43.408Z`, + createdAt: `2020-06-03T14:17:19.068Z`, + updatedAt: `2020-06-03T14:17:19.068Z`, environment: { sys: { id: `master`, @@ -1568,34 +951,25 @@ exports.createBlogPost = { contentful_id: `master`, }, }, - revision: 2, - contentful_id: `person`, + revision: 1, + contentful_id: `blogPost`, }, - displayField: `name`, - name: `Person`, - description: null, + displayField: `title`, + name: `Blog Post`, + description: ``, fields: [ - { - id: `name`, - name: `Name`, - type: `Symbol`, - localized: false, - required: true, - disabled: false, - omitted: false, - }, { id: `title`, name: `Title`, type: `Symbol`, - localized: true, + localized: false, required: true, disabled: false, omitted: false, }, { - id: `company`, - name: `Company`, + id: `slug`, + name: `Slug`, type: `Symbol`, localized: false, required: true, @@ -1603,68 +977,64 @@ exports.createBlogPost = { omitted: false, }, { - id: `shortBio`, - name: `Short Bio`, - type: `Text`, - localized: true, - required: true, - disabled: false, - omitted: false, - }, - { - id: `email`, - name: `Email`, - type: `Symbol`, + id: `heroImage`, + name: `Hero Image`, + type: `Link`, localized: false, - required: false, + required: true, disabled: false, omitted: false, + linkType: `Asset`, }, { - id: `phone`, - name: `Phone`, - type: `Symbol`, + id: `description`, + name: `Description`, + type: `Text`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `facebook`, - name: `Facebook`, - type: `Symbol`, + id: `body`, + name: `Body`, + type: `Text`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `twitter`, - name: `Twitter`, - type: `Symbol`, + id: `author`, + name: `Author`, + type: `Link`, localized: false, required: false, disabled: false, omitted: false, + linkType: `Entry`, }, { - id: `github`, - name: `Github`, - type: `Symbol`, + id: `publishDate`, + name: `Publish Date`, + type: `Date`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `image`, - name: `Image`, - type: `Link`, + id: `tags`, + name: `Tags`, + type: `Array`, localized: false, required: false, disabled: false, omitted: false, - linkType: `Asset`, + items: { + type: `Symbol`, + validations: [{ in: [`general`, `javascript`, `static-sites`] }], + }, }, ], }, @@ -1695,11 +1065,8 @@ exports.createBlogPost = { }, ], space: { - sys: { - type: `Space`, - id: `uzfinxahlog0`, - }, - name: `gatsby-test`, + sys: { type: `Space`, id: `uzfinxahlog0` }, + name: `Starter Gatsby Blog`, locales: [ { code: `en-US`, @@ -1730,10 +1097,10 @@ exports.updateBlogPost = { contentful_id: `uzfinxahlog0`, }, }, - id: `c3K9b0esdy0q0yGqgW2g6Ke`, + id: `c1dHS3UzOqupJZY7AyeDc6s`, type: `Entry`, - createdAt: `2020-04-09T10:53:01.485Z`, - updatedAt: `2020-04-09T11:01:27.357Z`, + createdAt: `2020-06-03T14:22:37.720Z`, + updatedAt: `2020-06-03T14:27:24.359Z`, environment: { sys: { id: `master`, @@ -1751,22 +1118,18 @@ exports.updateBlogPost = { contentful_id: `blogPost`, }, }, - contentful_id: `3K9b0esdy0q0yGqgW2g6Ke`, + contentful_id: `1dHS3UzOqupJZY7AyeDc6s`, }, fields: { - title: { - "en-US": `Hello world 1234`, - }, - slug: { - "en-US": `hello-world`, - }, + title: { "en-US": `Hello world 1234` }, + slug: { "en-US": `hello-world-1234` }, heroImage: { "en-US": { sys: { type: `Link`, linkType: `Asset`, - id: `c6Od9v3wzLOysiMum0Wkmme`, - contentful_id: `6Od9v3wzLOysiMum0Wkmme`, + id: `c1aaRo2sQbdfWnG8iNvnkH3`, + contentful_id: `1aaRo2sQbdfWnG8iNvnkH3`, }, }, }, @@ -1774,7 +1137,7 @@ exports.updateBlogPost = { "en-US": `Your very first content with Contentful, pulled in JSON format using the Content Delivery API.`, }, body: { - "en-US": `These is your very first content with Contentful, pulled in JSON format using the [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/ "Content Delivery API"). Content and presentation are now decoupled, allowing you to focus your efforts in building the perfect app.\n\n## Your first steps\n\nBuilding with Contentful is easy. First take a moment to get [the basics of content modelling](https://www.contentful.com/r/knowledgebase/content-modelling-basics/ "the basics of content modelling"), which you can set up in the [Contentful Web app](https://app.contentful.com/ "Contentful Web app"). Once you get that, feel free to drop by the [Documentation](https://www.contentful.com/developers/docs/ "Documentation") to learn a bit more about how to build your app with Contentful, in particular the [API basics](https://www.contentful.com/developers/docs/concepts/apis/ "API basics") and each one of our four APIs, as shown below.\n\n### Content Delivery API\n\nThe [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/ "Content Delivery API") (CDA), available at \`cdn.contentful.com\`, is a read-only API for delivering content from Contentful to apps, websites and other media. Content is delivered as JSON data, and images, videos and other media as files.\nThe API is available via a globally distributed content delivery network. The server closest to the user serves all content, both JSON and binary. This minimizes latency, which especially benefits mobile apps. Hosting content in multiple global data centers also greatly improves the availability of content.\n\n### Content Management API\n\nThe [Content Management API](https://www.contentful.com/developers/docs/references/content-management-api/ "Content Management API") (CMA), available at \`api.contentful.com\`, is a read-write API for managing content. Unlike the Content Delivery API, the management API requires you to authenticate as a Contentful user. You could use the CMA for several use cases, such as:\n* Automatic imports from different CMSes like WordPress or Drupal.\n* Integration with other backend systems, such as an e-commerce shop.\n* Building custom editing experiences. We built the [Contentful Web app](https://app.contentful.com/ "Contentful Web app") on top of this API.\n\n### Preview API\n\nThe [Content Preview API](https://www.contentful.com/developers/docs/concepts/apis/#content-preview-api "Content Preview API"), available at \`preview.contentful.com\`, is a variant of the CDA for previewing your content before delivering it to your customers. You use the Content Preview API in combination with a "preview" deployment of your website (or a "preview" build of your mobile app) that allows content managers and authors to view their work in-context, as if it were published, using a "preview" access token as though it were delivered by the CDA.\n\n### Images API\n\nThe [Images API](https://www.contentful.com/developers/docs/concepts/apis/#images-api "Images API"), available at \`images.contentful.com\`, allows you to resize and crop images, change their background color and convert them to different formats. Using our API for these transformations lets you upload high-quality assets, deliver exactly what your app needs, and still get all the benefits of our caching CDN.`, + "en-US": `These is your very first content with Contentful, pulled in JSON format using the [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/ "Content Delivery API"). Content and presentation are now decoupled, allowing you to focus your efforts in building the perfect app.\n\n## Your first steps\n\nBuilding with Contentful is easy. First take a moment to get [the basics of content modelling](https://www.contentful.com/r/knowledgebase/content-modelling-basics/ "the basics of content modelling"), which you can set up in the [Contentful Web app](https://app.contentful.com/ "Contentful Web app"). Once you get that, feel free to drop by the [Documentation](https://www.contentful.com/developers/docs/ "Documentation") to learn a bit more about how to build your app with Contentful, in particular the [API basics](https://www.contentful.com/developers/docs/concepts/apis/ "API basics") and each one of our four APIs, as shown below.\n\n### Content Delivery API\n\nThe [Content Delivery API](https://www.contentful.com/developers/docs/references/content-delivery-api/ "Content Delivery API") (CDA), available at \\\`cdn.contentful.com\\\`, is a read-only API for delivering content from Contentful to apps, websites and other media. Content is delivered as JSON data, and images, videos and other media as files.\nThe API is available via a globally distributed content delivery network. The server closest to the user serves all content, both JSON and binary. This minimizes latency, which especially benefits mobile apps. Hosting content in multiple global data centers also greatly improves the availability of content.\n\n### Content Management API\n\nThe [Content Management API](https://www.contentful.com/developers/docs/references/content-management-api/ "Content Management API") (CMA), available at \\\`api.contentful.com\\\`, is a read-write API for managing content. Unlike the Content Delivery API, the management API requires you to authenticate as a Contentful user. You could use the CMA for several use cases, such as:\n* Automatic imports from different CMSes like WordPress or Drupal.\n* Integration with other backend systems, such as an e-commerce shop.\n* Building custom editing experiences. We built the [Contentful Web app](https://app.contentful.com/ "Contentful Web app") on top of this API.\n\n### Preview API\n\nThe [Content Preview API](https://www.contentful.com/developers/docs/concepts/apis/#content-preview-api "Content Preview API"), available at \\\`preview.contentful.com\\\`, is a variant of the CDA for previewing your content before delivering it to your customers. You use the Content Preview API in combination with a "preview" deployment of your website (or a "preview" build of your mobile app) that allows content managers and authors to view their work in-context, as if it were published, using a "preview" access token as though it were delivered by the CDA.\n\n### Images API\n\nThe [Images API](https://www.contentful.com/developers/docs/concepts/apis/#images-api "Images API"), available at \\\`images.contentful.com\\\`, allows you to resize and crop images, change their background color and convert them to different formats. Using our API for these transformations lets you upload high-quality assets, deliver exactly what your app needs, and still get all the benefits of our caching CDN.`, }, author: { "en-US": { @@ -1786,19 +1149,14 @@ exports.updateBlogPost = { }, }, }, - publishDate: { - "en-US": `2017-05-15T00:00+02:00`, - }, - tags: { - "en-US": [`general`], - }, + publishDate: { "en-US": `2020-05-15T00:00+02:00` }, }, }, ], assets: [], deletedEntries: [], deletedAssets: [], - nextSyncToken: `wrXDkijCgsOuTgwXKDbCk8KiwqbCjmTDo0zCn0zCjMKdFsO5w5zCmFIhwpdnSGJFwrxIOXrCkMKJw5_CkcKrVjhQwq_DucKOLcKTwrNNHiIvOzfDi8KBXjHDtikNwobDksKhwp8_TcOgLjjCtMO7O25Mw7smwos`, + nextSyncToken: `FEnChMOBwr1Yw4TCqsK2LcKpCH3CjsORIyLDrGbDtgozw6xreMKCwpjCtlxATw0OwpjDkMOywrZewqlOAMK_wp_DmcOzLRXDmlJ3wp5VextfJMKtw43CngvCrw7Cn07CgnNJw4XDscOsw5zCuXbDrMKnw7rCsTPCpxE`, }, contentTypeItems: [ { @@ -1811,10 +1169,10 @@ exports.updateBlogPost = { contentful_id: `uzfinxahlog0`, }, }, - id: `blogPost`, + id: `person`, type: `ContentType`, - createdAt: `2020-04-09T10:52:57.586Z`, - updatedAt: `2020-04-09T10:52:57.586Z`, + createdAt: `2020-06-03T14:17:18.696Z`, + updatedAt: `2020-06-03T14:17:18.696Z`, environment: { sys: { id: `master`, @@ -1824,15 +1182,15 @@ exports.updateBlogPost = { }, }, revision: 1, - contentful_id: `blogPost`, + contentful_id: `person`, }, - displayField: `title`, - name: `Blog Post`, - description: null, + displayField: `name`, + name: `Person`, + description: ``, fields: [ { - id: `title`, - name: `Title`, + id: `name`, + name: `Name`, type: `Symbol`, localized: false, required: true, @@ -1840,8 +1198,8 @@ exports.updateBlogPost = { omitted: false, }, { - id: `slug`, - name: `Slug`, + id: `title`, + name: `Title`, type: `Symbol`, localized: false, required: true, @@ -1849,18 +1207,17 @@ exports.updateBlogPost = { omitted: false, }, { - id: `heroImage`, - name: `Hero Image`, - type: `Link`, + id: `company`, + name: `Company`, + type: `Symbol`, localized: false, required: true, disabled: false, omitted: false, - linkType: `Asset`, }, { - id: `description`, - name: `Description`, + id: `shortBio`, + name: `Short Bio`, type: `Text`, localized: false, required: true, @@ -1868,49 +1225,59 @@ exports.updateBlogPost = { omitted: false, }, { - id: `body`, - name: `Body`, - type: `Text`, + id: `email`, + name: `Email`, + type: `Symbol`, localized: false, - required: true, + required: false, disabled: false, omitted: false, }, { - id: `author`, - name: `Author`, - type: `Link`, + id: `phone`, + name: `Phone`, + type: `Symbol`, localized: false, required: false, disabled: false, omitted: false, - linkType: `Entry`, }, { - id: `publishDate`, - name: `Publish Date`, - type: `Date`, + id: `facebook`, + name: `Facebook`, + type: `Symbol`, localized: false, - required: true, + required: false, disabled: false, omitted: false, }, { - id: `tags`, - name: `Tags`, - type: `Array`, + id: `twitter`, + name: `Twitter`, + type: `Symbol`, localized: false, required: false, disabled: false, omitted: false, - items: { - type: `Symbol`, - validations: [ - { - in: [`general`, `javascript`, `static-sites`], - }, - ], - }, + }, + { + id: `github`, + name: `Github`, + type: `Symbol`, + localized: false, + required: false, + disabled: false, + omitted: false, + }, + { + id: `image`, + name: `Image`, + type: `Link`, + localized: false, + required: false, + disabled: false, + omitted: false, + linkType: `Asset`, }, ], }, @@ -1924,10 +1291,10 @@ exports.updateBlogPost = { contentful_id: `uzfinxahlog0`, }, }, - id: `person`, + id: `blogPost`, type: `ContentType`, - createdAt: `2020-04-09T10:52:57.596Z`, - updatedAt: `2020-04-09T10:54:43.408Z`, + createdAt: `2020-06-03T14:17:19.068Z`, + updatedAt: `2020-06-03T14:17:19.068Z`, environment: { sys: { id: `master`, @@ -1936,34 +1303,25 @@ exports.updateBlogPost = { contentful_id: `master`, }, }, - revision: 2, - contentful_id: `person`, + revision: 1, + contentful_id: `blogPost`, }, - displayField: `name`, - name: `Person`, - description: null, + displayField: `title`, + name: `Blog Post`, + description: ``, fields: [ - { - id: `name`, - name: `Name`, - type: `Symbol`, - localized: false, - required: true, - disabled: false, - omitted: false, - }, { id: `title`, name: `Title`, type: `Symbol`, - localized: true, + localized: false, required: true, disabled: false, omitted: false, }, { - id: `company`, - name: `Company`, + id: `slug`, + name: `Slug`, type: `Symbol`, localized: false, required: true, @@ -1971,68 +1329,64 @@ exports.updateBlogPost = { omitted: false, }, { - id: `shortBio`, - name: `Short Bio`, - type: `Text`, - localized: true, - required: true, - disabled: false, - omitted: false, - }, - { - id: `email`, - name: `Email`, - type: `Symbol`, + id: `heroImage`, + name: `Hero Image`, + type: `Link`, localized: false, - required: false, + required: true, disabled: false, omitted: false, + linkType: `Asset`, }, { - id: `phone`, - name: `Phone`, - type: `Symbol`, + id: `description`, + name: `Description`, + type: `Text`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `facebook`, - name: `Facebook`, - type: `Symbol`, + id: `body`, + name: `Body`, + type: `Text`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `twitter`, - name: `Twitter`, - type: `Symbol`, + id: `author`, + name: `Author`, + type: `Link`, localized: false, required: false, disabled: false, omitted: false, + linkType: `Entry`, }, { - id: `github`, - name: `Github`, - type: `Symbol`, + id: `publishDate`, + name: `Publish Date`, + type: `Date`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `image`, - name: `Image`, - type: `Link`, + id: `tags`, + name: `Tags`, + type: `Array`, localized: false, required: false, disabled: false, omitted: false, - linkType: `Asset`, + items: { + type: `Symbol`, + validations: [{ in: [`general`, `javascript`, `static-sites`] }], + }, }, ], }, @@ -2063,11 +1417,8 @@ exports.updateBlogPost = { }, ], space: { - sys: { - type: `Space`, - id: `uzfinxahlog0`, - }, - name: `gatsby-test`, + sys: { type: `Space`, id: `uzfinxahlog0` }, + name: `Starter Gatsby Blog`, locales: [ { code: `en-US`, @@ -2093,7 +1444,7 @@ exports.removeBlogPost = { { sys: { type: `DeletedEntry`, - id: `c2XTZRrfbMRcfdyFSo4mrOR`, + id: `c1dHS3UzOqupJZY7AyeDc6s`, space: { sys: { type: `Link`, @@ -2110,16 +1461,16 @@ exports.removeBlogPost = { contentful_id: `master`, }, }, - revision: 1, - createdAt: `2020-04-09T11:02:59.504Z`, - updatedAt: `2020-04-09T11:02:59.504Z`, - deletedAt: `2020-04-09T11:02:59.504Z`, - contentful_id: `2XTZRrfbMRcfdyFSo4mrOR`, + revision: 2, + createdAt: `2020-06-03T14:28:24.828Z`, + updatedAt: `2020-06-03T14:28:24.828Z`, + deletedAt: `2020-06-03T14:28:24.828Z`, + contentful_id: `1dHS3UzOqupJZY7AyeDc6s`, }, }, ], deletedAssets: [], - nextSyncToken: `wrXDkijCgsOuTgwXKDbCk8KiwqbCjmTDo0zCn0zCjMKdFsO5w5zCmFIhwpdnSGJFbHrCtg_Cix3DmMO6FMKsGsK1QHUmLwdHw5nDmMO4CMK1w4nCvsK_fMOOwpg2w4bCksOGwrfClsKYw5tXw5rDoMOHwrPChMKKwp3CtTzCkg`, + nextSyncToken: `FEnChMOBwr1Yw4TCqsK2LcKpCH3CjsORIyLDrGbDtgozw6xreMKCwpjCtlxATw13woJkDMK6fDpuN014SMKXw4MowpNDLcKVGQlXJiNSw53DlcKow4Fjw5HDqjthfQQrwo5MBlfDr3UfZjjCiMKi`, }, contentTypeItems: [ { @@ -2132,10 +1483,10 @@ exports.removeBlogPost = { contentful_id: `uzfinxahlog0`, }, }, - id: `blogPost`, + id: `person`, type: `ContentType`, - createdAt: `2020-04-09T10:52:57.586Z`, - updatedAt: `2020-04-09T10:52:57.586Z`, + createdAt: `2020-06-03T14:17:18.696Z`, + updatedAt: `2020-06-03T14:17:18.696Z`, environment: { sys: { id: `master`, @@ -2145,15 +1496,15 @@ exports.removeBlogPost = { }, }, revision: 1, - contentful_id: `blogPost`, + contentful_id: `person`, }, - displayField: `title`, - name: `Blog Post`, - description: null, + displayField: `name`, + name: `Person`, + description: ``, fields: [ { - id: `title`, - name: `Title`, + id: `name`, + name: `Name`, type: `Symbol`, localized: false, required: true, @@ -2161,8 +1512,8 @@ exports.removeBlogPost = { omitted: false, }, { - id: `slug`, - name: `Slug`, + id: `title`, + name: `Title`, type: `Symbol`, localized: false, required: true, @@ -2170,18 +1521,17 @@ exports.removeBlogPost = { omitted: false, }, { - id: `heroImage`, - name: `Hero Image`, - type: `Link`, + id: `company`, + name: `Company`, + type: `Symbol`, localized: false, required: true, disabled: false, omitted: false, - linkType: `Asset`, }, { - id: `description`, - name: `Description`, + id: `shortBio`, + name: `Short Bio`, type: `Text`, localized: false, required: true, @@ -2189,49 +1539,59 @@ exports.removeBlogPost = { omitted: false, }, { - id: `body`, - name: `Body`, - type: `Text`, + id: `email`, + name: `Email`, + type: `Symbol`, localized: false, - required: true, + required: false, disabled: false, omitted: false, }, { - id: `author`, - name: `Author`, - type: `Link`, + id: `phone`, + name: `Phone`, + type: `Symbol`, localized: false, required: false, disabled: false, omitted: false, - linkType: `Entry`, }, { - id: `publishDate`, - name: `Publish Date`, - type: `Date`, + id: `facebook`, + name: `Facebook`, + type: `Symbol`, localized: false, - required: true, + required: false, disabled: false, omitted: false, }, { - id: `tags`, - name: `Tags`, - type: `Array`, + id: `twitter`, + name: `Twitter`, + type: `Symbol`, localized: false, required: false, disabled: false, omitted: false, - items: { - type: `Symbol`, - validations: [ - { - in: [`general`, `javascript`, `static-sites`], - }, - ], - }, + }, + { + id: `github`, + name: `Github`, + type: `Symbol`, + localized: false, + required: false, + disabled: false, + omitted: false, + }, + { + id: `image`, + name: `Image`, + type: `Link`, + localized: false, + required: false, + disabled: false, + omitted: false, + linkType: `Asset`, }, ], }, @@ -2245,10 +1605,10 @@ exports.removeBlogPost = { contentful_id: `uzfinxahlog0`, }, }, - id: `person`, + id: `blogPost`, type: `ContentType`, - createdAt: `2020-04-09T10:52:57.596Z`, - updatedAt: `2020-04-09T10:54:43.408Z`, + createdAt: `2020-06-03T14:17:19.068Z`, + updatedAt: `2020-06-03T14:17:19.068Z`, environment: { sys: { id: `master`, @@ -2257,34 +1617,25 @@ exports.removeBlogPost = { contentful_id: `master`, }, }, - revision: 2, - contentful_id: `person`, + revision: 1, + contentful_id: `blogPost`, }, - displayField: `name`, - name: `Person`, - description: null, + displayField: `title`, + name: `Blog Post`, + description: ``, fields: [ - { - id: `name`, - name: `Name`, - type: `Symbol`, - localized: false, - required: true, - disabled: false, - omitted: false, - }, { id: `title`, name: `Title`, type: `Symbol`, - localized: true, + localized: false, required: true, disabled: false, omitted: false, }, { - id: `company`, - name: `Company`, + id: `slug`, + name: `Slug`, type: `Symbol`, localized: false, required: true, @@ -2292,68 +1643,64 @@ exports.removeBlogPost = { omitted: false, }, { - id: `shortBio`, - name: `Short Bio`, - type: `Text`, - localized: true, - required: true, - disabled: false, - omitted: false, - }, - { - id: `email`, - name: `Email`, - type: `Symbol`, + id: `heroImage`, + name: `Hero Image`, + type: `Link`, localized: false, - required: false, + required: true, disabled: false, omitted: false, + linkType: `Asset`, }, { - id: `phone`, - name: `Phone`, - type: `Symbol`, + id: `description`, + name: `Description`, + type: `Text`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `facebook`, - name: `Facebook`, - type: `Symbol`, + id: `body`, + name: `Body`, + type: `Text`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `twitter`, - name: `Twitter`, - type: `Symbol`, + id: `author`, + name: `Author`, + type: `Link`, localized: false, required: false, disabled: false, omitted: false, + linkType: `Entry`, }, { - id: `github`, - name: `Github`, - type: `Symbol`, + id: `publishDate`, + name: `Publish Date`, + type: `Date`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `image`, - name: `Image`, - type: `Link`, + id: `tags`, + name: `Tags`, + type: `Array`, localized: false, required: false, disabled: false, omitted: false, - linkType: `Asset`, + items: { + type: `Symbol`, + validations: [{ in: [`general`, `javascript`, `static-sites`] }], + }, }, ], }, @@ -2384,11 +1731,8 @@ exports.removeBlogPost = { }, ], space: { - sys: { - type: `Space`, - id: `uzfinxahlog0`, - }, - name: `gatsby-test`, + sys: { type: `Space`, id: `uzfinxahlog0` }, + name: `Starter Gatsby Blog`, locales: [ { code: `en-US`, @@ -2415,7 +1759,7 @@ exports.removeAsset = { { sys: { type: `DeletedAsset`, - id: `c21xFOvxOk9guLHTakpnezz`, + id: `c1aaRo2sQbdfWnG8iNvnkH3`, space: { sys: { type: `Link`, @@ -2433,14 +1777,14 @@ exports.removeAsset = { }, }, revision: 1, - createdAt: `2020-04-09T11:03:48.457Z`, - updatedAt: `2020-04-09T11:03:48.457Z`, - deletedAt: `2020-04-09T11:03:48.457Z`, - contentful_id: `21xFOvxOk9guLHTakpnezz`, + createdAt: `2020-06-03T14:28:57.237Z`, + updatedAt: `2020-06-03T14:28:57.237Z`, + deletedAt: `2020-06-03T14:28:57.237Z`, + contentful_id: `1aaRo2sQbdfWnG8iNvnkH3`, }, }, ], - nextSyncToken: `wrXDkijCgsOuTgwXKDbCk8KiwqbCjmTDo0zCn0zCjMKdFsO5w5zCmFIhwpdnSGJFaERvTsKwI8K0w69BSCfChsO3wqbDnMKwaxcKFMOIw4DDkcKYw7fCuHnCmV1MQcKtw79DwokewrvCscOcwpgFd3R_T0TDpxU`, + nextSyncToken: `FEnChMOBwr1Yw4TCqsK2LcKpCH3CjsORIyLDrGbDtgozw6xreMKCwpjCtlxATw0LNMOLwow1KMKwAW_Ci8OIwoPDgcK-Hn5Rw5XDvwXCsMK7wpPDk2jDtywiw6lyU8KEwprCojzDscOMwollMCbCicK_XTUEw7wZ`, }, contentTypeItems: [ { @@ -2453,10 +1797,10 @@ exports.removeAsset = { contentful_id: `uzfinxahlog0`, }, }, - id: `blogPost`, + id: `person`, type: `ContentType`, - createdAt: `2020-04-09T10:52:57.586Z`, - updatedAt: `2020-04-09T10:52:57.586Z`, + createdAt: `2020-06-03T14:17:18.696Z`, + updatedAt: `2020-06-03T14:17:18.696Z`, environment: { sys: { id: `master`, @@ -2466,15 +1810,15 @@ exports.removeAsset = { }, }, revision: 1, - contentful_id: `blogPost`, + contentful_id: `person`, }, - displayField: `title`, - name: `Blog Post`, - description: null, + displayField: `name`, + name: `Person`, + description: ``, fields: [ { - id: `title`, - name: `Title`, + id: `name`, + name: `Name`, type: `Symbol`, localized: false, required: true, @@ -2482,8 +1826,8 @@ exports.removeAsset = { omitted: false, }, { - id: `slug`, - name: `Slug`, + id: `title`, + name: `Title`, type: `Symbol`, localized: false, required: true, @@ -2491,18 +1835,17 @@ exports.removeAsset = { omitted: false, }, { - id: `heroImage`, - name: `Hero Image`, - type: `Link`, + id: `company`, + name: `Company`, + type: `Symbol`, localized: false, required: true, disabled: false, omitted: false, - linkType: `Asset`, }, { - id: `description`, - name: `Description`, + id: `shortBio`, + name: `Short Bio`, type: `Text`, localized: false, required: true, @@ -2510,49 +1853,59 @@ exports.removeAsset = { omitted: false, }, { - id: `body`, - name: `Body`, - type: `Text`, + id: `email`, + name: `Email`, + type: `Symbol`, localized: false, - required: true, + required: false, disabled: false, omitted: false, }, { - id: `author`, - name: `Author`, - type: `Link`, + id: `phone`, + name: `Phone`, + type: `Symbol`, localized: false, required: false, disabled: false, omitted: false, - linkType: `Entry`, }, { - id: `publishDate`, - name: `Publish Date`, - type: `Date`, + id: `facebook`, + name: `Facebook`, + type: `Symbol`, localized: false, - required: true, + required: false, disabled: false, omitted: false, }, { - id: `tags`, - name: `Tags`, - type: `Array`, + id: `twitter`, + name: `Twitter`, + type: `Symbol`, localized: false, required: false, disabled: false, omitted: false, - items: { - type: `Symbol`, - validations: [ - { - in: [`general`, `javascript`, `static-sites`], - }, - ], - }, + }, + { + id: `github`, + name: `Github`, + type: `Symbol`, + localized: false, + required: false, + disabled: false, + omitted: false, + }, + { + id: `image`, + name: `Image`, + type: `Link`, + localized: false, + required: false, + disabled: false, + omitted: false, + linkType: `Asset`, }, ], }, @@ -2566,10 +1919,10 @@ exports.removeAsset = { contentful_id: `uzfinxahlog0`, }, }, - id: `person`, + id: `blogPost`, type: `ContentType`, - createdAt: `2020-04-09T10:52:57.596Z`, - updatedAt: `2020-04-09T10:54:43.408Z`, + createdAt: `2020-06-03T14:17:19.068Z`, + updatedAt: `2020-06-03T14:17:19.068Z`, environment: { sys: { id: `master`, @@ -2578,34 +1931,25 @@ exports.removeAsset = { contentful_id: `master`, }, }, - revision: 2, - contentful_id: `person`, + revision: 1, + contentful_id: `blogPost`, }, - displayField: `name`, - name: `Person`, - description: null, + displayField: `title`, + name: `Blog Post`, + description: ``, fields: [ - { - id: `name`, - name: `Name`, - type: `Symbol`, - localized: false, - required: true, - disabled: false, - omitted: false, - }, { id: `title`, name: `Title`, type: `Symbol`, - localized: true, + localized: false, required: true, disabled: false, omitted: false, }, { - id: `company`, - name: `Company`, + id: `slug`, + name: `Slug`, type: `Symbol`, localized: false, required: true, @@ -2613,68 +1957,64 @@ exports.removeAsset = { omitted: false, }, { - id: `shortBio`, - name: `Short Bio`, - type: `Text`, - localized: true, - required: true, - disabled: false, - omitted: false, - }, - { - id: `email`, - name: `Email`, - type: `Symbol`, + id: `heroImage`, + name: `Hero Image`, + type: `Link`, localized: false, - required: false, + required: true, disabled: false, omitted: false, + linkType: `Asset`, }, { - id: `phone`, - name: `Phone`, - type: `Symbol`, + id: `description`, + name: `Description`, + type: `Text`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `facebook`, - name: `Facebook`, - type: `Symbol`, + id: `body`, + name: `Body`, + type: `Text`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `twitter`, - name: `Twitter`, - type: `Symbol`, + id: `author`, + name: `Author`, + type: `Link`, localized: false, required: false, disabled: false, omitted: false, + linkType: `Entry`, }, { - id: `github`, - name: `Github`, - type: `Symbol`, + id: `publishDate`, + name: `Publish Date`, + type: `Date`, localized: false, - required: false, + required: true, disabled: false, omitted: false, }, { - id: `image`, - name: `Image`, - type: `Link`, + id: `tags`, + name: `Tags`, + type: `Array`, localized: false, required: false, disabled: false, omitted: false, - linkType: `Asset`, + items: { + type: `Symbol`, + validations: [{ in: [`general`, `javascript`, `static-sites`] }], + }, }, ], }, @@ -2705,11 +2045,8 @@ exports.removeAsset = { }, ], space: { - sys: { - type: `Space`, - id: `uzfinxahlog0`, - }, - name: `gatsby-test`, + sys: { type: `Space`, id: `uzfinxahlog0` }, + name: `Starter Gatsby Blog`, locales: [ { code: `en-US`, diff --git a/packages/gatsby-source-contentful/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-source-contentful/src/__tests__/__snapshots__/gatsby-node.js.snap index 929f6aea9ead8..227f463c32077 100644 --- a/packages/gatsby-source-contentful/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-source-contentful/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -3,16 +3,16 @@ exports[`gatsby-node should add a new blogpost and update linkedNodes 1`] = ` Object { "author___NODE": "uzfinxahlog0___c15jwOBqpxqSAOy2eOO4S0m___Entry", - "body___NODE": "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___EntrybodyTextNode", + "body___NODE": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___EntrybodyTextNode", "children": Array [ - "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___EntrydescriptionTextNode", - "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___EntrybodyTextNode", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___EntrydescriptionTextNode", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___EntrybodyTextNode", ], - "contentful_id": "2XTZRrfbMRcfdyFSo4mrOR", - "createdAt": "2020-04-09T10:59:16.604Z", - "description___NODE": "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___EntrydescriptionTextNode", - "heroImage___NODE": "uzfinxahlog0___c21xFOvxOk9guLHTakpnezz___Asset", - "id": "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___Entry", + "contentful_id": "1dHS3UzOqupJZY7AyeDc6s", + "createdAt": "2020-06-03T14:22:37.720Z", + "description___NODE": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___EntrydescriptionTextNode", + "heroImage___NODE": "uzfinxahlog0___c1aaRo2sQbdfWnG8iNvnkH3___Asset", + "id": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry", "internal": Object { "contentDigest": "contentDigest", "owner": "gatsby-source-contentful", @@ -20,7 +20,7 @@ Object { }, "node_locale": "en-US", "parent": "Blog Post", - "publishDate": "2020-04-01T00:00+00:00", + "publishDate": "2020-04-01T00:00+02:00", "slug": "integration-tests", "spaceId": "uzfinxahlog0", "sys": Object { @@ -36,7 +36,7 @@ Object { "type": "Entry", }, "title": "Integration tests", - "updatedAt": "2020-04-09T10:59:16.604Z", + "updatedAt": "2020-06-03T14:22:37.720Z", } `; @@ -46,14 +46,14 @@ Object { "uzfinxahlog0___c31TNnjHlfaGUoMOwU0M2og___Entry", "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry", "uzfinxahlog0___c2PtC9h1YqIA6kaUaIsWEQ0___Entry", - "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___Entry", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry", ], "children": Array [ "uzfinxahlog0___c15jwOBqpxqSAOy2eOO4S0m___EntryshortBioTextNode", ], "company": "ACME", "contentful_id": "15jwOBqpxqSAOy2eOO4S0m", - "createdAt": "2020-04-09T10:53:01.487Z", + "createdAt": "2020-06-03T14:17:31.246Z", "email": "john@doe.com", "facebook": "johndoe", "github": "johndoe", @@ -79,28 +79,28 @@ Object { "type": "Link", }, }, - "revision": 2, + "revision": 1, "type": "Entry", }, "title": "Web Developer", "twitter": "johndoe", - "updatedAt": "2020-04-09T10:55:54.432Z", + "updatedAt": "2020-06-03T14:17:31.246Z", } `; exports[`gatsby-node should add a new blogpost and update linkedNodes 3`] = ` Object { "author___NODE": "uzfinxahlog0___c15jwOBqpxqSAOy2eOO4S0m___Entry___nl", - "body___NODE": "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___Entry___nlbodyTextNode", + "body___NODE": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nlbodyTextNode", "children": Array [ - "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___Entry___nldescriptionTextNode", - "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___Entry___nlbodyTextNode", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nldescriptionTextNode", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nlbodyTextNode", ], - "contentful_id": "2XTZRrfbMRcfdyFSo4mrOR", - "createdAt": "2020-04-09T10:59:16.604Z", - "description___NODE": "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___Entry___nldescriptionTextNode", - "heroImage___NODE": "uzfinxahlog0___c21xFOvxOk9guLHTakpnezz___Asset___nl", - "id": "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___Entry___nl", + "contentful_id": "1dHS3UzOqupJZY7AyeDc6s", + "createdAt": "2020-06-03T14:22:37.720Z", + "description___NODE": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nldescriptionTextNode", + "heroImage___NODE": "uzfinxahlog0___c1aaRo2sQbdfWnG8iNvnkH3___Asset___nl", + "id": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nl", "internal": Object { "contentDigest": "contentDigest", "owner": "gatsby-source-contentful", @@ -108,7 +108,7 @@ Object { }, "node_locale": "nl", "parent": "Blog Post", - "publishDate": "2020-04-01T00:00+00:00", + "publishDate": "2020-04-01T00:00+02:00", "slug": "integration-tests", "spaceId": "uzfinxahlog0", "sys": Object { @@ -124,7 +124,7 @@ Object { "type": "Entry", }, "title": "Integration tests", - "updatedAt": "2020-04-09T10:59:16.604Z", + "updatedAt": "2020-06-03T14:22:37.720Z", } `; @@ -134,14 +134,14 @@ Object { "uzfinxahlog0___c31TNnjHlfaGUoMOwU0M2og___Entry___nl", "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry___nl", "uzfinxahlog0___c2PtC9h1YqIA6kaUaIsWEQ0___Entry___nl", - "uzfinxahlog0___c2XTZRrfbMRcfdyFSo4mrOR___Entry___nl", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nl", ], "children": Array [ "uzfinxahlog0___c15jwOBqpxqSAOy2eOO4S0m___Entry___nlshortBioTextNode", ], "company": "ACME", "contentful_id": "15jwOBqpxqSAOy2eOO4S0m", - "createdAt": "2020-04-09T10:53:01.487Z", + "createdAt": "2020-06-03T14:17:31.246Z", "email": "john@doe.com", "facebook": "johndoe", "github": "johndoe", @@ -167,12 +167,12 @@ Object { "type": "Link", }, }, - "revision": 2, + "revision": 1, "type": "Entry", }, - "title": "Web developer", + "title": "Web Developer", "twitter": "johndoe", - "updatedAt": "2020-04-09T10:55:54.432Z", + "updatedAt": "2020-06-03T14:17:31.246Z", } `; @@ -188,7 +188,7 @@ Object { ], "company": "ACME", "contentful_id": "15jwOBqpxqSAOy2eOO4S0m", - "createdAt": "2020-04-09T10:53:01.487Z", + "createdAt": "2020-06-03T14:17:31.246Z", "email": "john@doe.com", "facebook": "johndoe", "github": "johndoe", @@ -214,12 +214,12 @@ Object { "type": "Link", }, }, - "revision": 2, + "revision": 1, "type": "Entry", }, "title": "Web Developer", "twitter": "johndoe", - "updatedAt": "2020-04-09T10:55:54.432Z", + "updatedAt": "2020-06-03T14:17:31.246Z", } `; @@ -235,7 +235,7 @@ Object { ], "company": "ACME", "contentful_id": "15jwOBqpxqSAOy2eOO4S0m", - "createdAt": "2020-04-09T10:53:01.487Z", + "createdAt": "2020-06-03T14:17:31.246Z", "email": "john@doe.com", "facebook": "johndoe", "github": "johndoe", @@ -261,28 +261,28 @@ Object { "type": "Link", }, }, - "revision": 2, + "revision": 1, "type": "Entry", }, - "title": "Web developer", + "title": "Web Developer", "twitter": "johndoe", - "updatedAt": "2020-04-09T10:55:54.432Z", + "updatedAt": "2020-06-03T14:17:31.246Z", } `; exports[`gatsby-node should update a blogpost 1`] = ` Object { "author___NODE": "uzfinxahlog0___c15jwOBqpxqSAOy2eOO4S0m___Entry", - "body___NODE": "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___EntrybodyTextNode", + "body___NODE": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___EntrybodyTextNode", "children": Array [ - "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___EntrydescriptionTextNode", - "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___EntrybodyTextNode", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___EntrydescriptionTextNode", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___EntrybodyTextNode", ], - "contentful_id": "3K9b0esdy0q0yGqgW2g6Ke", - "createdAt": "2020-04-09T10:53:01.485Z", - "description___NODE": "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___EntrydescriptionTextNode", - "heroImage___NODE": "uzfinxahlog0___c6Od9v3wzLOysiMum0Wkmme___Asset", - "id": "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry", + "contentful_id": "1dHS3UzOqupJZY7AyeDc6s", + "createdAt": "2020-06-03T14:22:37.720Z", + "description___NODE": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___EntrydescriptionTextNode", + "heroImage___NODE": "uzfinxahlog0___c1aaRo2sQbdfWnG8iNvnkH3___Asset", + "id": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry", "internal": Object { "contentDigest": "contentDigest", "owner": "gatsby-source-contentful", @@ -290,8 +290,8 @@ Object { }, "node_locale": "en-US", "parent": "Blog Post", - "publishDate": "2017-05-15T00:00+02:00", - "slug": "hello-world", + "publishDate": "2020-05-15T00:00+02:00", + "slug": "hello-world-1234", "spaceId": "uzfinxahlog0", "sys": Object { "contentType": Object { @@ -305,11 +305,8 @@ Object { "revision": 2, "type": "Entry", }, - "tags": Array [ - "general", - ], "title": "Hello world 1234", - "updatedAt": "2020-04-09T11:01:27.357Z", + "updatedAt": "2020-06-03T14:27:24.359Z", } `; @@ -319,14 +316,14 @@ Object { "uzfinxahlog0___c31TNnjHlfaGUoMOwU0M2og___Entry", "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry", "uzfinxahlog0___c2PtC9h1YqIA6kaUaIsWEQ0___Entry", - "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry", ], "children": Array [ "uzfinxahlog0___c15jwOBqpxqSAOy2eOO4S0m___EntryshortBioTextNode", ], "company": "ACME", "contentful_id": "15jwOBqpxqSAOy2eOO4S0m", - "createdAt": "2020-04-09T10:53:01.487Z", + "createdAt": "2020-06-03T14:17:31.246Z", "email": "john@doe.com", "facebook": "johndoe", "github": "johndoe", @@ -352,28 +349,28 @@ Object { "type": "Link", }, }, - "revision": 2, + "revision": 1, "type": "Entry", }, "title": "Web Developer", "twitter": "johndoe", - "updatedAt": "2020-04-09T10:55:54.432Z", + "updatedAt": "2020-06-03T14:17:31.246Z", } `; exports[`gatsby-node should update a blogpost 3`] = ` Object { "author___NODE": "uzfinxahlog0___c15jwOBqpxqSAOy2eOO4S0m___Entry___nl", - "body___NODE": "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry___nlbodyTextNode", + "body___NODE": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nlbodyTextNode", "children": Array [ - "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry___nldescriptionTextNode", - "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry___nlbodyTextNode", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nldescriptionTextNode", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nlbodyTextNode", ], - "contentful_id": "3K9b0esdy0q0yGqgW2g6Ke", - "createdAt": "2020-04-09T10:53:01.485Z", - "description___NODE": "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry___nldescriptionTextNode", - "heroImage___NODE": "uzfinxahlog0___c6Od9v3wzLOysiMum0Wkmme___Asset___nl", - "id": "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry___nl", + "contentful_id": "1dHS3UzOqupJZY7AyeDc6s", + "createdAt": "2020-06-03T14:22:37.720Z", + "description___NODE": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nldescriptionTextNode", + "heroImage___NODE": "uzfinxahlog0___c1aaRo2sQbdfWnG8iNvnkH3___Asset___nl", + "id": "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nl", "internal": Object { "contentDigest": "contentDigest", "owner": "gatsby-source-contentful", @@ -381,8 +378,8 @@ Object { }, "node_locale": "nl", "parent": "Blog Post", - "publishDate": "2017-05-15T00:00+02:00", - "slug": "hello-world", + "publishDate": "2020-05-15T00:00+02:00", + "slug": "hello-world-1234", "spaceId": "uzfinxahlog0", "sys": Object { "contentType": Object { @@ -396,11 +393,8 @@ Object { "revision": 2, "type": "Entry", }, - "tags": Array [ - "general", - ], "title": "Hello world 1234", - "updatedAt": "2020-04-09T11:01:27.357Z", + "updatedAt": "2020-06-03T14:27:24.359Z", } `; @@ -410,14 +404,14 @@ Object { "uzfinxahlog0___c31TNnjHlfaGUoMOwU0M2og___Entry___nl", "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry___nl", "uzfinxahlog0___c2PtC9h1YqIA6kaUaIsWEQ0___Entry___nl", - "uzfinxahlog0___c3K9b0esdy0q0yGqgW2g6Ke___Entry___nl", + "uzfinxahlog0___c1dHS3UzOqupJZY7AyeDc6s___Entry___nl", ], "children": Array [ "uzfinxahlog0___c15jwOBqpxqSAOy2eOO4S0m___Entry___nlshortBioTextNode", ], "company": "ACME", "contentful_id": "15jwOBqpxqSAOy2eOO4S0m", - "createdAt": "2020-04-09T10:53:01.487Z", + "createdAt": "2020-06-03T14:17:31.246Z", "email": "john@doe.com", "facebook": "johndoe", "github": "johndoe", @@ -443,11 +437,11 @@ Object { "type": "Link", }, }, - "revision": 2, + "revision": 1, "type": "Entry", }, - "title": "Web developer", + "title": "Web Developer", "twitter": "johndoe", - "updatedAt": "2020-04-09T10:55:54.432Z", + "updatedAt": "2020-06-03T14:17:31.246Z", } `; diff --git a/packages/gatsby-source-contentful/src/__tests__/gatsby-node.js b/packages/gatsby-source-contentful/src/__tests__/gatsby-node.js index 1123d70be8fe0..dece9e6015be4 100644 --- a/packages/gatsby-source-contentful/src/__tests__/gatsby-node.js +++ b/packages/gatsby-source-contentful/src/__tests__/gatsby-node.js @@ -7,16 +7,26 @@ jest.mock(`gatsby-core-utils`, () => { } }) +const _ = require(`lodash`) const gatsbyNode = require(`../gatsby-node`) const fetch = require(`../fetch`) const normalize = require(`../normalize`) const startersBlogFixture = require(`../__fixtures__/starter-blog-data`) +const createMockCache = () => { + return { + get: jest.fn(), + set: jest.fn(), + directory: __dirname, + } +} + describe(`gatsby-node`, () => { - const actions = {} + const actions = { createTypes: jest.fn() } + const schema = { buildObjectType: jest.fn() } const store = {} - const cache = {} + const cache = createMockCache() const getCache = jest.fn() const reporter = { info: jest.fn(), @@ -164,6 +174,26 @@ describe(`gatsby-node`, () => { } const testIfAssetsExists = (assets, locales) => { + const defaultLocale = locales[0] + locales.forEach(locale => { + assets.forEach(asset => { + const assetId = createNodeId( + normalize.makeId({ + spaceId: asset.sys.space.sys.id, + defaultLocale: defaultLocale, + currentLocale: locale, + id: asset.sys.id, + type: asset.sys.type, + }) + ) + + // check if asset exists + expect(getNode(assetId)).toBeDefined() + }) + }) + } + + const testIfAssetsExistsAndMatch = (assets, locales) => { const defaultLocale = locales[0] locales.forEach(locale => { assets.forEach(asset => { @@ -233,7 +263,11 @@ describe(`gatsby-node`, () => { }) it(`should create nodes from initial payload`, async () => { - fetch.mockImplementationOnce(() => startersBlogFixture.initialSync) + cache.get.mockClear() + cache.set.mockClear() + fetch.mockImplementationOnce(() => + _.cloneDeep(startersBlogFixture.initialSync) + ) const locales = [`en-US`, `nl`] await gatsbyNode.sourceNodes({ @@ -245,6 +279,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) testIfContentTypesExists(startersBlogFixture.initialSync.contentTypeItems) @@ -253,18 +288,34 @@ describe(`gatsby-node`, () => { startersBlogFixture.initialSync.contentTypeItems, locales ) - testIfAssetsExists( + testIfAssetsExistsAndMatch( startersBlogFixture.initialSync.currentSyncData.assets, locales ) + + // Tries to load data from cache + expect(cache.get).toHaveBeenCalledWith(`syncToken`) + expect(cache.get).toHaveBeenCalledWith(`previousSyncData`) + expect(cache.get.mock.calls.length).toBe(2) + + // Stores sync token and raw/unparsed data to the cache + expect(cache.set).toHaveBeenCalledWith( + `syncToken`, + startersBlogFixture.initialSync.currentSyncData.nextSyncToken + ) + expect(cache.set).toHaveBeenCalledWith( + `previousSyncData`, + startersBlogFixture.initialSync.currentSyncData + ) + expect(cache.set.mock.calls.length).toBe(2) }) it(`should add a new blogpost and update linkedNodes`, async () => { const locales = [`en-US`, `nl`] fetch - .mockReturnValueOnce(startersBlogFixture.initialSync) - .mockReturnValueOnce(startersBlogFixture.createBlogPost) + .mockReturnValueOnce(_.cloneDeep(startersBlogFixture.initialSync)) + .mockReturnValueOnce(_.cloneDeep(startersBlogFixture.createBlogPost)) const createdBlogEntry = startersBlogFixture.createBlogPost.currentSyncData.entries[0] @@ -288,6 +339,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) // check if blog posts do not exists @@ -305,6 +357,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) testIfContentTypesExists( startersBlogFixture.createBlogPost.contentTypeItems @@ -314,7 +367,7 @@ describe(`gatsby-node`, () => { startersBlogFixture.createBlogPost.contentTypeItems, locales ) - testIfAssetsExists( + testIfAssetsExistsAndMatch( startersBlogFixture.createBlogPost.currentSyncData.assets, locales ) @@ -329,9 +382,9 @@ describe(`gatsby-node`, () => { it(`should update a blogpost`, async () => { const locales = [`en-US`, `nl`] fetch - .mockReturnValueOnce(startersBlogFixture.initialSync) - .mockReturnValueOnce(startersBlogFixture.createBlogPost) - .mockReturnValueOnce(startersBlogFixture.updateBlogPost) + .mockReturnValueOnce(_.cloneDeep(startersBlogFixture.initialSync)) + .mockReturnValueOnce(_.cloneDeep(startersBlogFixture.createBlogPost)) + .mockReturnValueOnce(_.cloneDeep(startersBlogFixture.updateBlogPost)) const updatedBlogEntry = startersBlogFixture.updateBlogPost.currentSyncData.entries[0] @@ -355,6 +408,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) // create blog post @@ -367,10 +421,11 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) updatedBlogEntryIds.forEach(blogEntryId => { - expect(getNode(blogEntryId).title).toBe(`Hello world`) + expect(getNode(blogEntryId).title).toBe(`Integration tests`) }) // updated blog post @@ -383,6 +438,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) testIfContentTypesExists( @@ -393,7 +449,7 @@ describe(`gatsby-node`, () => { startersBlogFixture.updateBlogPost.contentTypeItems, locales ) - testIfAssetsExists( + testIfAssetsExistsAndMatch( startersBlogFixture.updateBlogPost.currentSyncData.assets, locales ) @@ -409,9 +465,9 @@ describe(`gatsby-node`, () => { it(`should remove a blogpost and update linkedNodes`, async () => { const locales = [`en-US`, `nl`] fetch - .mockReturnValueOnce(startersBlogFixture.initialSync) - .mockReturnValueOnce(startersBlogFixture.createBlogPost) - .mockReturnValueOnce(startersBlogFixture.removeBlogPost) + .mockReturnValueOnce(_.cloneDeep(startersBlogFixture.initialSync)) + .mockReturnValueOnce(_.cloneDeep(startersBlogFixture.createBlogPost)) + .mockReturnValueOnce(_.cloneDeep(startersBlogFixture.removeBlogPost)) const removedBlogEntry = startersBlogFixture.removeBlogPost.currentSyncData.deletedEntries[0] @@ -438,6 +494,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) // create blog post @@ -450,6 +507,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) let authorIds = [] @@ -470,6 +528,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) testIfContentTypesExists( @@ -486,8 +545,7 @@ describe(`gatsby-node`, () => { }) }) - // this isn't implemented - it.skip(`should remove an asset`, async () => { + it(`should remove an asset`, async () => { const locales = [`en-US`, `nl`] fetch @@ -496,7 +554,7 @@ describe(`gatsby-node`, () => { .mockReturnValueOnce(startersBlogFixture.removeAsset) const removedAssetEntry = - startersBlogFixture.removeAsset.currentSyncData.deletedEntries[0] + startersBlogFixture.createBlogPost.currentSyncData.entries[0] const removedAssetEntryIds = locales.map(locale => normalize.makeId({ spaceId: removedAssetEntry.sys.space.sys.id, @@ -517,6 +575,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) // create blog post @@ -529,6 +588,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) // check if blog post exists @@ -536,6 +596,12 @@ describe(`gatsby-node`, () => { expect(getNode(assetId)).not.toBeUndefined() }) + // check if assets exists + testIfAssetsExists( + startersBlogFixture.removeAsset.currentSyncData.deletedAssets, + locales + ) + // remove asset await gatsbyNode.sourceNodes({ actions, @@ -546,6 +612,7 @@ describe(`gatsby-node`, () => { createNodeId, cache, getCache, + schema, }) testIfContentTypesExists(startersBlogFixture.removeAsset.contentTypeItems) @@ -554,12 +621,8 @@ describe(`gatsby-node`, () => { startersBlogFixture.removeAsset.contentTypeItems, locales ) - testIfEntriesDeleted( - startersBlogFixture.removeAsset.currentSyncData.assets, - locales - ) testIfAssetsDeleted( - startersBlogFixture.removeAsset.currentSyncData.assets, + startersBlogFixture.removeAsset.currentSyncData.deletedAssets, locales ) }) diff --git a/packages/gatsby-source-contentful/src/fetch.js b/packages/gatsby-source-contentful/src/fetch.js index d7a1230c15de0..ab2af70bb854b 100644 --- a/packages/gatsby-source-contentful/src/fetch.js +++ b/packages/gatsby-source-contentful/src/fetch.js @@ -48,7 +48,7 @@ module.exports = async function contentfulFetch({ )}' were found but were filtered down to none.` ) } - reporter.info(`default locale is: ${defaultLocale}`) + reporter.info(`Default locale is: ${defaultLocale}`) } catch (e) { let details let errors @@ -89,10 +89,14 @@ ${formatPluginOptionsForCLI(pluginConfig.getOriginalPluginOptions(), errors)}`) } let currentSyncData + const basicSyncConfig = { + limit: pageLimit, + resolveLinks: false, + } try { let query = syncToken - ? { nextSyncToken: syncToken } - : { initial: true, limit: pageLimit } + ? { nextSyncToken: syncToken, ...basicSyncConfig } + : { initial: true, ...basicSyncConfig } currentSyncData = await client.sync(query) } catch (e) { reporter.panic(`Fetching contentful data failed`, e) @@ -104,9 +108,9 @@ ${formatPluginOptionsForCLI(pluginConfig.getOriginalPluginOptions(), errors)}`) try { contentTypes = await pagedGet(client, `getContentTypes`, pageLimit) } catch (e) { - reporter.panic(`error fetching content types`, e) + reporter.panic(`Error fetching content types`, e) } - reporter.info(`contentTypes fetched ${contentTypes.items.length}`) + reporter.info(`Content types fetched ${contentTypes.items.length}`) let contentTypeItems = contentTypes.items @@ -134,6 +138,8 @@ ${formatPluginOptionsForCLI(pluginConfig.getOriginalPluginOptions(), errors)}`) space, } + console.timeEnd(`Fetch Contentful data`) + return result } diff --git a/packages/gatsby-source-contentful/src/gatsby-node.js b/packages/gatsby-source-contentful/src/gatsby-node.js index 454d22500ad44..a39ef028d330f 100644 --- a/packages/gatsby-source-contentful/src/gatsby-node.js +++ b/packages/gatsby-source-contentful/src/gatsby-node.js @@ -2,14 +2,16 @@ const path = require(`path`) const isOnline = require(`is-online`) const _ = require(`lodash`) const fs = require(`fs-extra`) - const normalize = require(`./normalize`) const fetchData = require(`./fetch`) const { createPluginConfig, validateOptions } = require(`./plugin-options`) const { downloadContentfulAssets } = require(`./download-contentful-assets`) - +const { createClient } = require(`contentful`) const conflictFieldPrefix = `contentful` +const CACHE_SYNC_KEY = `previousSyncData` +const CACHE_SYNC_TOKEN = `syncToken` + // restrictedNodeFields from here https://www.gatsbyjs.org/docs/node-interface/ const restrictedNodeFields = [ `children`, @@ -48,8 +50,11 @@ exports.sourceNodes = async ( }, pluginOptions ) => { - const { createNode, deleteNode, touchNode, setPluginStatus } = actions - + const { createNode, deleteNode, touchNode } = actions + const client = createClient({ + space: `none`, + accessToken: `fake-access-token`, + }) const online = await isOnline() // If the user knows they are offline, serve them cached result @@ -80,27 +85,28 @@ exports.sourceNodes = async ( const pluginConfig = createPluginConfig(pluginOptions) - const createSyncToken = () => - `${pluginConfig.get(`spaceId`)}-${pluginConfig.get( - `environment` - )}-${pluginConfig.get(`host`)}` + /* + * Subsequent calls of Contentfuls sync API return only changed data. + * + * In some cases, especially when using rich-text fields, there can be data + * missing from referenced entries. This breaks the reference matching. + * + * To workround this, we cache the initial sync data and merge it + * with all data from subsequent syncs. Afterwards the references get + * resolved via the Contentful JS SDK. + */ + let syncToken = await cache.get(CACHE_SYNC_TOKEN) + let previousSyncData = { + assets: [], + entries: [], + } + let cachedData = await cache.get(CACHE_SYNC_KEY) - // Get sync token if it exists. - let syncToken - if ( - !pluginConfig.get(`forceFullSync`) && - store.getState().status.plugins && - store.getState().status.plugins[`gatsby-source-contentful`] && - store.getState().status.plugins[`gatsby-source-contentful`][ - createSyncToken() - ] - ) { - syncToken = store.getState().status.plugins[`gatsby-source-contentful`][ - createSyncToken() - ] + if (cachedData) { + previousSyncData = cachedData } - const { + let { currentSyncData, contentTypeItems, defaultLocale, @@ -112,6 +118,51 @@ exports.sourceNodes = async ( pluginConfig, }) + console.time(`Process Contentful data`) + + // Remove deleted entries and assets from cached sync data set + previousSyncData.entries = previousSyncData.entries.filter( + entry => + _.findIndex( + currentSyncData.deletedEntries, + o => o.sys.id === entry.sys.id + ) !== -1 + ) + + previousSyncData.assets = previousSyncData.assets.filter( + asset => + _.findIndex( + currentSyncData.deletedAssets, + o => o.sys.id === asset.sys.id + ) !== -1 + ) + + // Merge cached data with new sync data + // order is important here, fresh data first + currentSyncData.entries = _.uniqBy( + currentSyncData.entries.concat(previousSyncData.entries), + `sys.id` + ) + + currentSyncData.assets = _.uniqBy( + currentSyncData.assets.concat(previousSyncData.assets), + `sys.id` + ) + + // Store a raw and unresolved copy of the data for caching + const currentSyncDataRaw = _.cloneDeep(currentSyncData) + + // Use the JS-SDK to resolve the entries and assets + const res = client.parseEntries({ + items: currentSyncData.entries, + includes: { + assets: currentSyncData.assets, + entries: currentSyncData.entries, + }, + }) + + currentSyncData.entries = res.items + const entryList = normalize.buildEntryList({ currentSyncData, contentTypeItems, @@ -122,17 +173,13 @@ exports.sourceNodes = async ( // are "updated" so will get the now deleted reference removed. function deleteContentfulNode(node) { - const normalizedType = node.sys.type.startsWith(`Deleted`) - ? node.sys.type.substring(`Deleted`.length) - : node.sys.type - const localizedNodes = locales .map(locale => { const nodeId = createNodeId( normalize.makeId({ spaceId: space.sys.id, id: node.sys.id, - type: normalizedType, + type: node.sys.type, currentLocale: locale.code, defaultLocale, }) @@ -162,15 +209,16 @@ exports.sourceNodes = async ( reporter.info(`Deleted entries ${currentSyncData.deletedEntries.length}`) reporter.info(`Updated assets ${currentSyncData.assets.length}`) reporter.info(`Deleted assets ${currentSyncData.deletedAssets.length}`) - console.timeEnd(`Fetch Contentful data`) // Update syncToken const nextSyncToken = currentSyncData.nextSyncToken - // Store our sync state for the next sync. - const newState = {} - newState[createSyncToken()] = nextSyncToken - setPluginStatus(newState) + await Promise.all([ + cache.set(CACHE_SYNC_KEY, currentSyncDataRaw), + cache.set(CACHE_SYNC_TOKEN, nextSyncToken), + ]) + + reporter.info(`Building Contentful reference map`) // Create map of resolvable ids so we can check links against them while creating // links. @@ -194,6 +242,8 @@ exports.sourceNodes = async ( useNameForId: pluginConfig.get(`useNameForId`), }) + reporter.info(`Resolving Contentful references`) + const newOrUpdatedEntries = [] entryList.forEach(entries => { entries.forEach(entry => { @@ -224,9 +274,18 @@ exports.sourceNodes = async ( } }) + console.timeEnd(`Process Contentful data`) + console.time(`Create Contentful nodes`) + for (let i = 0; i < contentTypeItems.length; i++) { const contentTypeItem = contentTypeItems[i] + if (entryList[i].length) { + reporter.info( + `Creating ${entryList[i].length} Contentful ${contentTypeItem.name} nodes` + ) + } + // A contentType can hold lots of entries which create nodes // We wait until all nodes are created and processed until we handle the next one // TODO add batching in gatsby-core @@ -250,6 +309,10 @@ exports.sourceNodes = async ( ) } + if (assets.length) { + reporter.info(`Creating ${assets.length} Contentful asset nodes`) + } + for (let i = 0; i < assets.length; i++) { // We wait for each asset to be process until handling the next one. await Promise.all( @@ -264,7 +327,11 @@ exports.sourceNodes = async ( ) } + console.timeEnd(`Create Contentful nodes`) + if (pluginConfig.get(`downloadLocal`)) { + reporter.info(`Download Contentful asset files`) + await downloadContentfulAssets({ actions, createNodeId, diff --git a/packages/gatsby-source-contentful/src/normalize.js b/packages/gatsby-source-contentful/src/normalize.js index ec2341d2a4f05..d27021d0126d5 100644 --- a/packages/gatsby-source-contentful/src/normalize.js +++ b/packages/gatsby-source-contentful/src/normalize.js @@ -97,10 +97,14 @@ const fixIds = object => { } exports.fixIds = fixIds -const makeId = ({ spaceId, id, currentLocale, defaultLocale, type }) => - currentLocale === defaultLocale - ? `${spaceId}___${id}___${type}` - : `${spaceId}___${id}___${type}___${currentLocale}` +const makeId = ({ spaceId, id, currentLocale, defaultLocale, type }) => { + const normalizedType = type.startsWith(`Deleted`) + ? type.substring(`Deleted`.length) + : type + return currentLocale === defaultLocale + ? `${spaceId}___${id}___${normalizedType}` + : `${spaceId}___${id}___${normalizedType}___${currentLocale}` +} exports.makeId = makeId