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: websocket_graphqlws.go
    path of file: ./repos/gqlgen/graphql/handler/transport
    
    the code of the file until where you have to start completion: package transport

import (
	"encoding/json"
	"fmt"

	"github.com/gorilla/websocket"
)

// https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md
const (
	graphqlwsSubprotocol = "graphql-ws"

	graphqlwsConnectionInitMsg      = graphqlwsMessageType("connection_init")
	graphqlwsConnectionTerminateMsg = graphqlwsMessageType("connection_terminate")
	graphqlwsStartMsg               = graphqlwsMessageType("start")
	graphqlwsStopMsg                = graphqlwsMessageT
    
func (m graphqlwsMessage) toMessage() (message, error) {
	var t messageType
	var err error
	switch m.Type {
	default:
		err = fmt.Errorf("invalid client->server message type %s", m.Type)
	case graphqlwsConnectionInitMsg:
		t = initMessageType
	case graphqlwsConnectionTerminateMsg:
		t = connectionCloseMessageType
	case graphqlwsStartMsg:
		t = startMessageType
	case graphqlwsStopMsg:
		t = stopMessageType
	case graphqlwsConnectionAckMsg:
		t = connectionAckMessageType
	case graphqlwsConnectionErrorMsg:
		t = connectionErrorMessageType
	case graphqlwsDataMsg:
		t = dataMessageType
	case graphqlwsErrorMsg:
		t = errorMessageType
	case graphqlwsCompleteMsg:
		t = completeMessageType
	case graphqlwsConnectionKeepAliveMsg:
		t = keepAliveMessageType
	}

	return message{
		payload: m.Payload,
		id:      m.ID,
		t:       t,
	}, err
}