aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/99designs/gqlgen/graphql/any.go
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-05-15 15:04:57 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-05-15 15:04:57 +0200
commit6949d6c543e9397578c7c840812df9bbf8531528 (patch)
treecdbc6c797b406029f03b5e5391fe1afdea88ce8e /vendor/github.com/99designs/gqlgen/graphql/any.go
parent97476ff5fadaf0a457d0f0133db58415b6075940 (diff)
downloadgit-bug-6949d6c543e9397578c7c840812df9bbf8531528.tar.gz
Upgrade gqlgen version to v0.9.0
Diffstat (limited to 'vendor/github.com/99designs/gqlgen/graphql/any.go')
-rw-r--r--vendor/github.com/99designs/gqlgen/graphql/any.go19
1 files changed, 19 insertions, 0 deletions
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
+}