From b7dcbfe6c8e6d2c871e7aabb2b88adfeef699b67 Mon Sep 17 00:00:00 2001 From: Maxim Kuptsov Date: Fri, 21 May 2021 16:24:16 +0300 Subject: [PATCH] adding check kind resolver --- internal/exec/exec.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/exec/exec.go b/internal/exec/exec.go index 5ab64270..955d722b 100644 --- a/internal/exec/exec.go +++ b/internal/exec/exec.go @@ -266,7 +266,11 @@ func (r *Request) execSelectionSet(ctx context.Context, sels []selected.Selectio if s.ExtResolver != nil { if v, ok := s.ExtResolver[t.String()]; ok { - resolver = reflect.NewAt(v.Elem().Type(), unsafe.Pointer(resolver.Elem().UnsafeAddr())) + if resolver.Kind() == reflect.Struct { + resolver = reflect.NewAt(v.Elem().Type(), unsafe.Pointer(resolver.UnsafeAddr())) + } else { + resolver = reflect.NewAt(v.Elem().Type(), unsafe.Pointer(resolver.Elem().UnsafeAddr())) + } } }