Skip to content

Commit

Permalink
feat(contentful): improve Rich Text field support
Browse files Browse the repository at this point in the history
* Allow circular references
* Improve performance and reduce RAM footprint
* Query referenced entries and assets via GraphQL

fixes #24221

BREAKING CHANGE:

* Entities references in Rich Text fields are no more automatically resolved
* Use the `raw` subfield instead of `json`
* Use GraphQL to define your referenced data with the new `references` field
* Removes the `resolveFieldLocales` as the new `references` field automatically resolves locales
* To render Rich Text fields unse the new `renderRichText()` function from `gatsby-source-contentful/rich-text`
  • Loading branch information
axe312ger committed Jun 30, 2020
1 parent d8eb55b commit 0fd5023
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 558 deletions.
1 change: 1 addition & 0 deletions packages/gatsby-source-contentful/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"dependencies": {
"@babel/runtime": "^7.10.3",
"@contentful/rich-text-react-renderer": "^14.1.1",
"@contentful/rich-text-types": "^13.4.0",
"@hapi/joi": "^15.1.1",
"axios": "^0.19.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ describe(`Options validation`, () => {
downloadLocal: 5,
useNameForId: 5,
pageLimit: `fifty`,
richText: true,
}
)

Expand Down Expand Up @@ -204,9 +203,6 @@ describe(`Options validation`, () => {
expect(reporter.panic).toBeCalledWith(
expect.stringContaining(`"pageLimit" must be a number`)
)
expect(reporter.panic).toBeCalledWith(
expect.stringContaining(`"richText" must be an object`)
)
})

it(`Fails with undefined option keys`, () => {
Expand Down
355 changes: 0 additions & 355 deletions packages/gatsby-source-contentful/src/__tests__/rich-text.js

This file was deleted.

Loading

0 comments on commit 0fd5023

Please sign in to comment.