as is done in the print-template.
This ports the logic in the substitutions-print-templates to a graphql-type.