Skip to main content

previewLiquidDocumentTemplate

Requires permission documents:template:update.

Render a template source with neutral sample data and return the HTML. Nothing is saved.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query PreviewLiquidDocumentTemplate($docType: String!, $source: String!) {
previewLiquidDocumentTemplate(docType: $docType, source: $source)
}

Variables:

{
"docType": "string",
"source": "string"
}

Response:

{
"data": {
"previewLiquidDocumentTemplate": "string"
}
}
previewLiquidDocumentTemplate(
docType: String!
source: String!
): String!

Arguments​

previewLiquidDocumentTemplate.docType ● String! non-null scalar​

The document type, e.g. invoice.

previewLiquidDocumentTemplate.source ● String! non-null scalar​

The Liquid source to preview.

Type​

String scalar​

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.