Skip to content

Commit

Permalink
Update Contentful example to add validations to solve graphql complex…
Browse files Browse the repository at this point in the history
…ity errors. (#33958)

Hi! Dev Rel from Contentful here. We noticed that the Contentful example was giving a graphQL complexity error so adding in some validations to the content model that is imported to prevent the error from showing up. 

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
  • Loading branch information
brittanyrw committed Feb 3, 2022
1 parent ce9c6b7 commit 4749014
Showing 1 changed file with 71 additions and 1 deletion.
72 changes: 71 additions & 1 deletion examples/cms-contentful/contentful/export.json
Expand Up @@ -151,7 +151,77 @@
"type": "RichText",
"localized": false,
"required": true,
"validations": [],
"validations": [
{
"enabledMarks": ["bold", "italic", "underline", "code"],
"message": "Only bold, italic, underline, and code marks are allowed"
},
{
"enabledNodeTypes": [
"heading-1",
"heading-2",
"heading-3",
"heading-4",
"heading-5",
"heading-6",
"ordered-list",
"unordered-list",
"hr",
"blockquote",
"embedded-entry-block",
"embedded-asset-block",
"hyperlink",
"entry-hyperlink",
"asset-hyperlink",
"embedded-entry-inline"
],
"message": "Only heading 1, heading 2, heading 3, heading 4, heading 5, heading 6, ordered list, unordered list, horizontal rule, quote, block entry, asset, link to Url, link to entry, link to asset, and inline entry nodes are allowed"
},
{
"nodes": {
"asset-hyperlink": [
{
"size": {
"max": 10
},
"message": null
}
],
"embedded-asset-block": [
{
"size": {
"max": 10
},
"message": null
}
],
"embedded-entry-block": [
{
"size": {
"max": 10
},
"message": null
}
],
"embedded-entry-inline": [
{
"size": {
"max": 10
},
"message": null
}
],
"entry-hyperlink": [
{
"size": {
"max": 10
},
"message": null
}
]
}
}
],
"disabled": false,
"omitted": false
},
Expand Down

0 comments on commit 4749014

Please sign in to comment.