import pathlib


def get_gql_template(template_path=None):
    """Gets graphql html template text from template.html"""
    if not template_path:
        path = pathlib.Path(__file__)
        cur_path = path.parent.absolute()
        template_path = f"{cur_path}/gql/template.html"
    with open(template_path, encoding="utf-8") as f:
        template = f.read()
    return template