reym
Projections/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 @upsertOn(...) {
    description: String! @safeHtml
}

Before storing the data for the description field, 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