AmazeeLabs / silverback-mono

Silverback Monorepo. Central hub for our open source packages and tooling.
https://silverback.netlify.app
8 stars 7 forks source link

Gutenberg validation #724

Open pmelab opened 3 years ago

pmelab commented 3 years ago

Gutenberg allows us to set predefined templates, but there is no way to validate their contents (e.g. enforce a headline). This often leads to problems in the react frontend where we don't want to deal with everything to be optional.

Idea: combine the gutenberg parser with the information in a graphql schema (which fields are mandatory, and which not) and validate blocks before they are sent through the API. If they are not valid, insert an "error" block instead. This way the error is displayed but the whole frontend does not necessarily break.

pmelab commented 2 years ago

@chindris since we approached this in [private project], i'll assign this to you for moving it into 'silverback_gutenberg`.