def query_write(opath, type, qname, content, mode):
    """
    This function is used in order to generate the Queries Mutations & Subscriptions templates.
    Path and file name will be generated as follow:

    :param opath:
        query path template it needs two %s to work

    :param type:
        query, mutation, subscription

    :param qname:
        query, mutation, subscription names

    :param content:
        file content

    :param mode:
        w, a and so on

    :return:
        none
    """
    with open(opath % (type, '%s.query' % qname), mode) as ofile:
        ofile.write(content)
