You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: parse_query.go
    path of file: ./repos/grafana/pkg/tsdb/loki
    
    the code of the file until where you have to start completion: package loki

import (
	"fmt"
	"math"
	"strconv"
	"strings"
	"time"

	"github.com/grafana/grafana-plugin-sdk-go/backend"
	"github.com/grafana/grafana-plugin-sdk-go/backend/gtime"

	"github.com/grafana/gra
    
func parseQueryType(jsonPointerValue *string) (QueryType, error) {
	if jsonPointerValue == nil {
		// there are older queries stored in alerting that did not have queryType,
		// those were range-queries
		return QueryTypeRange, nil
	} else {
		jsonValue := *jsonPointerValue
		switch jsonValue {
		case "instant":
			return QueryTypeInstant, nil
		case "range":
			return QueryTypeRange, nil
		default:
			return QueryTypeRange, fmt.Errorf("invalid queryType: %s", jsonValue)
		}
	}
}