From 6949d6c543e9397578c7c840812df9bbf8531528 Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Wed, 15 May 2019 15:04:57 +0200 Subject: Upgrade gqlgen version to v0.9.0 --- vendor/github.com/99designs/gqlgen/graphql/any.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 vendor/github.com/99designs/gqlgen/graphql/any.go (limited to 'vendor/github.com/99designs/gqlgen/graphql/any.go') diff --git a/vendor/github.com/99designs/gqlgen/graphql/any.go b/vendor/github.com/99designs/gqlgen/graphql/any.go new file mode 100644 index 00000000..6ea8bf2e --- /dev/null +++ b/vendor/github.com/99designs/gqlgen/graphql/any.go @@ -0,0 +1,19 @@ +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 +} -- cgit