From e546c53fba5c47043fb4c7580f1b86c34f1892ae Mon Sep 17 00:00:00 2001 From: "sharoon.austin" Date: Mon, 11 Oct 2021 11:48:30 +0530 Subject: [PATCH 1/2] Added Query in the Could not marshal error --- go.mod | 2 ++ internal/exec/exec.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 1c77f7a9..8411ecdf 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module github.com/tokopedia/graphql-go +go 1.15 + require ( github.com/graph-gophers/graphql-go v0.0.0-20190724201507-010347b5f9e6 // indirect github.com/opentracing/opentracing-go v1.1.0 diff --git a/internal/exec/exec.go b/internal/exec/exec.go index 07e4c7ed..d7da4789 100644 --- a/internal/exec/exec.go +++ b/internal/exec/exec.go @@ -281,7 +281,8 @@ func (r *Request) execSelectionSet(ctx context.Context, sels []selected.Selectio v := resolver.Interface() data, err := json.Marshal(v) if err != nil { - panic(errors.Errorf("could not marshal %v: %s", v, err)) + query, _ := ctx.Value(ctx.Value("query_name")).(string) + panic(errors.Errorf("could not marshal %v [%s]: %s", v, query, err)) } out.Write(data) From f98c032a269d8d492c00203d0fc14bed9cb599ae Mon Sep 17 00:00:00 2001 From: "sharoon.austin" Date: Mon, 11 Oct 2021 12:15:15 +0530 Subject: [PATCH 2/2] Removed go version from go.mod file --- go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.mod b/go.mod index 8411ecdf..1c77f7a9 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,5 @@ module github.com/tokopedia/graphql-go -go 1.15 - require ( github.com/graph-gophers/graphql-go v0.0.0-20190724201507-010347b5f9e6 // indirect github.com/opentracing/opentracing-go v1.1.0