aboutsummaryrefslogblamecommitdiffstats
path: root/vendor/github.com/99designs/gqlgen/graphql/any.go
blob: 6ea8bf2eaeb5fa8af76b9f4ed4ec1030ceb47298 (plain) (tree)


















                                                       
package graphql

import (
	"encoding/json"
	"io"
)

func MarshalAny(v interface{}) Marshaler {
	return WriterFunc(func(w io.Writer) {
		err := json.NewEncoder(w).Encode(v)
		if err != nil {
			panic(err)
		}
	})
}

func UnmarshalAny(v interface{}) (interface{}, error) {
	return v, nil
}