reym
CRUD/Schema/Field

@safeHtml

Use the @safeHtml directive to sanitize html the content of a field.

All unwanted JavaScript is removed from your html strings.

Example

user.graphql
type User @crudType {
    description: String! @safeHtml
}

When you try to store a string that contains any kind of html or JavaScript, the JavaScript will be removed and the string in the description field will be sanitized. This is best to be used for all kinds of user generated HTML that you want to display on a website.

On this page