diff options
author | Michael Muré <batolettre@gmail.com> | 2019-05-15 18:20:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-15 18:20:54 +0200 |
commit | 22f435bd2a8fc35bde96eafb50b3f78650a5983b (patch) | |
tree | 629b72f3d95ac7b7806fb83096a3b89e14f745ef /vendor/github.com/99designs/gqlgen/graphql/any.go | |
parent | 97476ff5fadaf0a457d0f0133db58415b6075940 (diff) | |
parent | 8bab279114f06f10e22435b0caf9002201831555 (diff) | |
download | git-bug-22f435bd2a8fc35bde96eafb50b3f78650a5983b.tar.gz |
Merge pull request #134 from A-Hilaly/gqlgen
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.go | 19 |
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 +} |