From e4530da6a4636a6d6430ae93356fa423d7a5ead7 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sun, 9 Feb 2020 18:16:17 +0900 Subject: [PATCH 1/3] apply https://github.com/vektah/gqlparser/pull/117 --- go.mod | 3 ++- go.sum | 12 ++++++++++++ graphql/context_field.go | 12 +++++++----- graphql/context_response_test.go | 2 +- graphql/handler/apollotracing/tracer.go | 3 ++- graphql/handler/apollotracing/tracer_test.go | 4 ++-- graphql/handler/debug/tracer.go | 13 +------------ 7 files changed, 27 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 7726e1ddfe..f09a35e2a6 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/99designs/gqlgen go 1.12 require ( + github.com/agnivade/levenshtein v1.0.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-chi/chi v3.3.2+incompatible github.com/gogo/protobuf v1.0.0 // indirect @@ -25,7 +26,7 @@ require ( github.com/stretchr/testify v1.3.0 github.com/urfave/cli v1.20.0 github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e - github.com/vektah/gqlparser v1.3.1 + github.com/vektah/gqlparser v1.3.2-0.20200209091329-fcdc57498356 golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/yaml.v2 v2.2.2 diff --git a/go.sum b/go.sum index 06f3b01ccf..a1e3862cfd 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,15 @@ github.com/agnivade/levenshtein v1.0.1 h1:3oJU7J3FGFmyhn8KHjmVaZCN5hxTr7GxgRue+sxIXdQ= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/agnivade/levenshtein v1.0.3 h1:M5ZnqLOoZR8ygVq0FfkXsNOKzMCk0xRiow0R5+5VkQ0= +github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/go-chi/chi v3.3.2+incompatible h1:uQNcQN3NsV1j4ANsPh42P4ew4t6rnRbJb8frvpp31qQ= github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/gogo/protobuf v1.0.0 h1:2jyBKDKU/8v3v2xVR2PtiWQviFUyiaGk2rpfyFT8rTM= @@ -59,8 +63,16 @@ github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e h1:+w0Zm/9gaWpEAyDlU1eKOuk5twTjAjuevXqcJJw8hrg= github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= +github.com/vektah/gqlparser v1.2.2-0.20200207070222-bc3e68891810 h1:rWT63vqVwBxR3HWs/Uv3BaNNOjIOOKgNQ+eWk+q+pKo= +github.com/vektah/gqlparser v1.2.2-0.20200207070222-bc3e68891810/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= +github.com/vektah/gqlparser v1.2.2-0.20200209090035-1cdd9c855be2 h1:QESfBEW4Fdj70rV3Sz5+MkyFLuv60irXbW1cazk8hmM= +github.com/vektah/gqlparser v1.2.2-0.20200209090035-1cdd9c855be2/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= +github.com/vektah/gqlparser v1.2.2-0.20200209090733-6a7b2cdda12f h1:A1vVD0WMvyaSdCMlz5liWdMV4IFCVXqK1T+MQnQeNxI= +github.com/vektah/gqlparser v1.2.2-0.20200209090733-6a7b2cdda12f/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= github.com/vektah/gqlparser v1.3.1 h1:8b0IcD3qZKWJQHSzynbDlrtP3IxVydZ2DZepCGofqfU= github.com/vektah/gqlparser v1.3.1/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= +github.com/vektah/gqlparser v1.3.2-0.20200209091329-fcdc57498356 h1:v9PLvniug2CnIsccJr+eULcGQL0zQ2pgLyxDM18YMCM= +github.com/vektah/gqlparser v1.3.2-0.20200209091329-fcdc57498356/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= diff --git a/graphql/context_field.go b/graphql/context_field.go index 802b60e4c5..416646627f 100644 --- a/graphql/context_field.go +++ b/graphql/context_field.go @@ -3,6 +3,8 @@ package graphql import ( "context" "time" + + "github.com/vektah/gqlparser/ast" ) type key string @@ -39,13 +41,13 @@ type FieldStats struct { Completed time.Time } -func (r *FieldContext) Path() []interface{} { - var path []interface{} +func (r *FieldContext) Path() ast.Path { + var path ast.Path for it := r; it != nil; it = it.Parent { if it.Index != nil { - path = append(path, *it.Index) + path = append(path, ast.PathIndex(*it.Index)) } else if it.Field.Field != nil { - path = append(path, it.Field.Alias) + path = append(path, ast.PathName(it.Field.Alias)) } } @@ -75,7 +77,7 @@ func WithFieldContext(ctx context.Context, rc *FieldContext) context.Context { return context.WithValue(ctx, resolverCtx, rc) } -func equalPath(a []interface{}, b []interface{}) bool { +func equalPath(a ast.Path, b ast.Path) bool { if len(a) != len(b) { return false } diff --git a/graphql/context_response_test.go b/graphql/context_response_test.go index 59d80f4403..c009d45ab5 100644 --- a/graphql/context_response_test.go +++ b/graphql/context_response_test.go @@ -43,7 +43,7 @@ func TestAddError(t *testing.T) { AddError(ctx, errors.New("bar")) AddError(ctx, &gqlerror.Error{ Message: "foo3", - Path: append(child.Path(), "works"), + Path: append(child.Path(), ast.PathName("works")), }) specs := []struct { diff --git a/graphql/handler/apollotracing/tracer.go b/graphql/handler/apollotracing/tracer.go index b4b0cb312f..c1478a518d 100644 --- a/graphql/handler/apollotracing/tracer.go +++ b/graphql/handler/apollotracing/tracer.go @@ -6,6 +6,7 @@ import ( "time" "github.com/99designs/gqlgen/graphql" + "github.com/vektah/gqlparser/ast" ) type ( @@ -30,7 +31,7 @@ type ( } ResolverExecution struct { - Path []interface{} `json:"path"` + Path ast.Path `json:"path"` ParentType string `json:"parentType"` FieldName string `json:"fieldName"` ReturnType string `json:"returnType"` diff --git a/graphql/handler/apollotracing/tracer_test.go b/graphql/handler/apollotracing/tracer_test.go index d78d61c47c..fa52c387c2 100644 --- a/graphql/handler/apollotracing/tracer_test.go +++ b/graphql/handler/apollotracing/tracer_test.go @@ -9,7 +9,6 @@ import ( "time" "github.com/99designs/gqlgen/graphql" - "github.com/99designs/gqlgen/graphql/handler/apollotracing" "github.com/99designs/gqlgen/graphql/handler/extension" "github.com/99designs/gqlgen/graphql/handler/lru" @@ -17,6 +16,7 @@ import ( "github.com/99designs/gqlgen/graphql/handler/transport" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/vektah/gqlparser/ast" "github.com/vektah/gqlparser/gqlerror" ) @@ -59,7 +59,7 @@ func TestApolloTracing(t *testing.T) { require.EqualValues(t, 700, tracing.Execution.Resolvers[0].StartOffset) require.EqualValues(t, 100, tracing.Execution.Resolvers[0].Duration) - require.EqualValues(t, []interface{}{"name"}, tracing.Execution.Resolvers[0].Path) + require.EqualValues(t, ast.Path{ast.PathName("name")}, tracing.Execution.Resolvers[0].Path) require.EqualValues(t, "Query", tracing.Execution.Resolvers[0].ParentType) require.EqualValues(t, "name", tracing.Execution.Resolvers[0].FieldName) require.EqualValues(t, "String!", tracing.Execution.Resolvers[0].ReturnType) diff --git a/graphql/handler/debug/tracer.go b/graphql/handler/debug/tracer.go index 6115f5ad44..3a4c8436b4 100644 --- a/graphql/handler/debug/tracer.go +++ b/graphql/handler/debug/tracer.go @@ -62,18 +62,7 @@ func (a Tracer) InterceptResponse(ctx context.Context, next graphql.ResponseHand fmt.Fprintln(a.out, " resp:", Green(stringify(resp))) for _, err := range resp.Errors { - pathstr := "" - for i, bit := range err.Path { - if biti, ok := bit.(int); ok { - pathstr += fmt.Sprintf("[%d]", biti) - } else { - if i != 0 { - pathstr += "." - } - pathstr += fmt.Sprint(bit) - } - } - fmt.Fprintln(a.out, " error:", Bold(pathstr+":"), Red(err.Message)) + fmt.Fprintln(a.out, " error:", Bold(err.Path.String()+":"), Red(err.Message)) } fmt.Fprintln(a.out, "}") fmt.Fprintln(a.out) From 598559252c076967ae3120ee203885954c254a2a Mon Sep 17 00:00:00 2001 From: vvakame Date: Sun, 9 Feb 2020 19:53:39 +0900 Subject: [PATCH 2/3] go mod tidy --- go.sum | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/go.sum b/go.sum index a1e3862cfd..c1fd80c800 100644 --- a/go.sum +++ b/go.sum @@ -4,11 +4,13 @@ github.com/agnivade/levenshtein v1.0.3 h1:M5ZnqLOoZR8ygVq0FfkXsNOKzMCk0xRiow0R5+ github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c h1:TUuUh0Xgj97tLMNtWtNvI9mIV6isjEb9lBMNv+77IGM= github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/go-chi/chi v3.3.2+incompatible h1:uQNcQN3NsV1j4ANsPh42P4ew4t6rnRbJb8frvpp31qQ= github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= @@ -63,14 +65,6 @@ github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e h1:+w0Zm/9gaWpEAyDlU1eKOuk5twTjAjuevXqcJJw8hrg= github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= -github.com/vektah/gqlparser v1.2.2-0.20200207070222-bc3e68891810 h1:rWT63vqVwBxR3HWs/Uv3BaNNOjIOOKgNQ+eWk+q+pKo= -github.com/vektah/gqlparser v1.2.2-0.20200207070222-bc3e68891810/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= -github.com/vektah/gqlparser v1.2.2-0.20200209090035-1cdd9c855be2 h1:QESfBEW4Fdj70rV3Sz5+MkyFLuv60irXbW1cazk8hmM= -github.com/vektah/gqlparser v1.2.2-0.20200209090035-1cdd9c855be2/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= -github.com/vektah/gqlparser v1.2.2-0.20200209090733-6a7b2cdda12f h1:A1vVD0WMvyaSdCMlz5liWdMV4IFCVXqK1T+MQnQeNxI= -github.com/vektah/gqlparser v1.2.2-0.20200209090733-6a7b2cdda12f/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= -github.com/vektah/gqlparser v1.3.1 h1:8b0IcD3qZKWJQHSzynbDlrtP3IxVydZ2DZepCGofqfU= -github.com/vektah/gqlparser v1.3.1/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= github.com/vektah/gqlparser v1.3.2-0.20200209091329-fcdc57498356 h1:v9PLvniug2CnIsccJr+eULcGQL0zQ2pgLyxDM18YMCM= github.com/vektah/gqlparser v1.3.2-0.20200209091329-fcdc57498356/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From cf6f76830d3ebbfbce26a96f709edbb11c828551 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 17 Feb 2020 10:27:44 +1100 Subject: [PATCH 3/3] bump to gqlparser v2 --- cmd/ambient.go | 4 ++-- codegen/args.go | 2 +- codegen/config/binder.go | 2 +- codegen/config/binder_test.go | 4 ++-- codegen/config/config.go | 4 ++-- codegen/config/config_test.go | 4 ++-- codegen/data.go | 2 +- codegen/directive.go | 2 +- codegen/field.go | 2 +- codegen/generated!.gotpl | 4 ++-- codegen/interface.go | 2 +- codegen/object.go | 2 +- codegen/testserver/generated.go | 4 ++-- complexity/complexity.go | 2 +- complexity/complexity_test.go | 4 ++-- docs/content/reference/errors.md | 4 ++-- example/chat/generated.go | 4 ++-- example/config/generated.go | 4 ++-- example/dataloader/generated.go | 4 ++-- .../accounts/graph/generated/generated.go | 4 ++-- .../products/graph/generated/generated.go | 4 ++-- .../reviews/graph/generated/generated.go | 4 ++-- example/fileupload/generated.go | 4 ++-- example/scalars/generated.go | 4 ++-- example/selection/generated.go | 4 ++-- example/selection/selection.go | 2 +- example/starwars/generated/exec.go | 4 ++-- example/todo/generated.go | 4 ++-- example/type-system-extension/generated.go | 4 ++-- go.mod | 9 +++------ go.sum | 18 ++++++++++-------- graphql/context_field.go | 2 +- graphql/context_field_test.go | 2 +- graphql/context_operation.go | 2 +- graphql/context_operation_test.go | 2 +- graphql/context_response.go | 2 +- graphql/context_response_test.go | 4 ++-- graphql/errcode/codes.go | 2 +- graphql/error.go | 2 +- graphql/executable_schema.go | 2 +- graphql/executable_schema_mock.go | 2 +- graphql/handler.go | 2 +- graphql/handler/apollotracing/tracer.go | 2 +- graphql/handler/apollotracing/tracer_test.go | 4 ++-- graphql/handler/executor.go | 8 ++++---- graphql/handler/extension/apq.go | 2 +- graphql/handler/extension/complexity.go | 2 +- graphql/handler/extension/introspection.go | 2 +- graphql/handler/server.go | 2 +- graphql/handler/server_test.go | 6 +++--- graphql/handler/testserver/testserver.go | 4 ++-- graphql/handler/transport/error.go | 2 +- graphql/handler/transport/http_form_test.go | 4 ++-- graphql/handler/transport/http_get.go | 4 ++-- graphql/handler/transport/util.go | 2 +- graphql/handler/transport/websocket.go | 2 +- graphql/handler/transport/websocket_test.go | 4 ++-- graphql/introspection/introspection.go | 2 +- graphql/introspection/schema.go | 2 +- graphql/introspection/type.go | 2 +- graphql/introspection/type_test.go | 2 +- graphql/jsonw_test.go | 2 +- graphql/recovery.go | 2 +- graphql/response.go | 2 +- integration/generated.go | 4 ++-- integration/server/server.go | 2 +- plugin/federation/federation.go | 2 +- plugin/modelgen/models.go | 2 +- plugin/modelgen/models.gotpl | 4 ++-- plugin/plugin.go | 2 +- plugin/resolvergen/resolver.gotpl | 4 ++-- plugin/stubgen/stubs.gotpl | 4 ++-- 72 files changed, 118 insertions(+), 119 deletions(-) diff --git a/cmd/ambient.go b/cmd/ambient.go index 7838fdf16d..0f3655d34f 100644 --- a/cmd/ambient.go +++ b/cmd/ambient.go @@ -5,6 +5,6 @@ import ( // don't prune unused code for us. Both lists should be kept in sync. _ "github.com/99designs/gqlgen/graphql" _ "github.com/99designs/gqlgen/graphql/introspection" - _ "github.com/vektah/gqlparser" - _ "github.com/vektah/gqlparser/ast" + _ "github.com/vektah/gqlparser/v2" + _ "github.com/vektah/gqlparser/v2/ast" ) diff --git a/codegen/args.go b/codegen/args.go index 1d3e51aa3a..20a26e9754 100644 --- a/codegen/args.go +++ b/codegen/args.go @@ -8,7 +8,7 @@ import ( "github.com/99designs/gqlgen/codegen/config" "github.com/99designs/gqlgen/codegen/templates" "github.com/pkg/errors" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type ArgSet struct { diff --git a/codegen/config/binder.go b/codegen/config/binder.go index 00cb5f62fd..bea5c8f309 100644 --- a/codegen/config/binder.go +++ b/codegen/config/binder.go @@ -8,7 +8,7 @@ import ( "github.com/99designs/gqlgen/codegen/templates" "github.com/99designs/gqlgen/internal/code" "github.com/pkg/errors" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) // Binder connects graphql types to golang types using static analysis diff --git a/codegen/config/binder_test.go b/codegen/config/binder_test.go index a5c35bd185..67e9ed011b 100644 --- a/codegen/config/binder_test.go +++ b/codegen/config/binder_test.go @@ -7,8 +7,8 @@ import ( "github.com/99designs/gqlgen/internal/code" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) func TestBindingToInvalid(t *testing.T) { diff --git a/codegen/config/config.go b/codegen/config/config.go index da8f8e2da3..af9a610a17 100644 --- a/codegen/config/config.go +++ b/codegen/config/config.go @@ -11,8 +11,8 @@ import ( "github.com/99designs/gqlgen/internal/code" "github.com/pkg/errors" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" "gopkg.in/yaml.v2" ) diff --git a/codegen/config/config_test.go b/codegen/config/config_test.go index 28adff3f71..dbea2811b6 100644 --- a/codegen/config/config_test.go +++ b/codegen/config/config_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" "github.com/99designs/gqlgen/internal/code" ) diff --git a/codegen/data.go b/codegen/data.go index 513723ebb5..bedbef9d44 100644 --- a/codegen/data.go +++ b/codegen/data.go @@ -5,7 +5,7 @@ import ( "sort" "github.com/pkg/errors" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" "github.com/99designs/gqlgen/codegen/config" ) diff --git a/codegen/directive.go b/codegen/directive.go index f3a3c26208..5d4c038ffa 100644 --- a/codegen/directive.go +++ b/codegen/directive.go @@ -7,7 +7,7 @@ import ( "github.com/99designs/gqlgen/codegen/templates" "github.com/pkg/errors" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type DirectiveList map[string]*Directive diff --git a/codegen/field.go b/codegen/field.go index 8f6e9d52bb..c12520b703 100644 --- a/codegen/field.go +++ b/codegen/field.go @@ -11,7 +11,7 @@ import ( "github.com/99designs/gqlgen/codegen/config" "github.com/99designs/gqlgen/codegen/templates" "github.com/pkg/errors" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type Field struct { diff --git a/codegen/generated!.gotpl b/codegen/generated!.gotpl index bcfab0fa94..03be286e1e 100644 --- a/codegen/generated!.gotpl +++ b/codegen/generated!.gotpl @@ -8,8 +8,8 @@ {{ reserveImport "errors" }} {{ reserveImport "bytes" }} -{{ reserveImport "github.com/vektah/gqlparser" }} -{{ reserveImport "github.com/vektah/gqlparser/ast" }} +{{ reserveImport "github.com/vektah/gqlparser/v2" }} +{{ reserveImport "github.com/vektah/gqlparser/v2/ast" }} {{ reserveImport "github.com/99designs/gqlgen/graphql" }} {{ reserveImport "github.com/99designs/gqlgen/graphql/introspection" }} diff --git a/codegen/interface.go b/codegen/interface.go index 0ccbf87cda..a55ce1e6bf 100644 --- a/codegen/interface.go +++ b/codegen/interface.go @@ -5,7 +5,7 @@ import ( "go/types" "github.com/pkg/errors" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" "github.com/99designs/gqlgen/codegen/config" ) diff --git a/codegen/object.go b/codegen/object.go index 18cfd29bed..31fe38bdbf 100644 --- a/codegen/object.go +++ b/codegen/object.go @@ -8,7 +8,7 @@ import ( "github.com/99designs/gqlgen/codegen/config" "github.com/pkg/errors" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type GoFieldType int diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 53ac24f87b..46e585d405 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -17,8 +17,8 @@ import ( invalid_packagename "github.com/99designs/gqlgen/codegen/testserver/invalid-packagename" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/complexity/complexity.go b/complexity/complexity.go index d5b46bf451..1877aae5fb 100644 --- a/complexity/complexity.go +++ b/complexity/complexity.go @@ -2,7 +2,7 @@ package complexity import ( "github.com/99designs/gqlgen/graphql" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) func Calculate(es graphql.ExecutableSchema, op *ast.OperationDefinition, vars map[string]interface{}) int { diff --git a/complexity/complexity_test.go b/complexity/complexity_test.go index a7a2f25565..0c4be24e1c 100644 --- a/complexity/complexity_test.go +++ b/complexity/complexity_test.go @@ -6,8 +6,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) var schema = gqlparser.MustLoadSchema( diff --git a/docs/content/reference/errors.md b/docs/content/reference/errors.md index db39b41a57..361813b259 100644 --- a/docs/content/reference/errors.md +++ b/docs/content/reference/errors.md @@ -19,8 +19,8 @@ package foo import ( "context" - - "github.com/vektah/gqlparser/gqlerror" + + "github.com/vektah/gqlparser/v2/gqlerror" "github.com/99designs/gqlgen/graphql" ) diff --git a/example/chat/generated.go b/example/chat/generated.go index 17657a5ec0..f8a2eb260f 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -13,8 +13,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/config/generated.go b/example/config/generated.go index 2f42596f7f..e2a8e3604f 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -12,8 +12,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index 9c5fd59982..a42b79f08f 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -13,8 +13,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/federation/accounts/graph/generated/generated.go b/example/federation/accounts/graph/generated/generated.go index dd379debd2..09a43ea4ae 100644 --- a/example/federation/accounts/graph/generated/generated.go +++ b/example/federation/accounts/graph/generated/generated.go @@ -15,8 +15,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" "github.com/99designs/gqlgen/plugin/federation/fedruntime" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/federation/products/graph/generated/generated.go b/example/federation/products/graph/generated/generated.go index 4b71ac3c01..735fb65f8c 100644 --- a/example/federation/products/graph/generated/generated.go +++ b/example/federation/products/graph/generated/generated.go @@ -15,8 +15,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" "github.com/99designs/gqlgen/plugin/federation/fedruntime" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/federation/reviews/graph/generated/generated.go b/example/federation/reviews/graph/generated/generated.go index 2c4fd44a98..e81fb1e6e7 100644 --- a/example/federation/reviews/graph/generated/generated.go +++ b/example/federation/reviews/graph/generated/generated.go @@ -15,8 +15,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" "github.com/99designs/gqlgen/plugin/federation/fedruntime" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/fileupload/generated.go b/example/fileupload/generated.go index ccc53004ce..125846e6df 100644 --- a/example/fileupload/generated.go +++ b/example/fileupload/generated.go @@ -13,8 +13,8 @@ import ( "github.com/99designs/gqlgen/example/fileupload/model" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/scalars/generated.go b/example/scalars/generated.go index 764f63314c..c28fca3b7d 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -15,8 +15,8 @@ import ( "github.com/99designs/gqlgen/example/scalars/model" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/selection/generated.go b/example/selection/generated.go index 29df5e3048..d6d7733f15 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -13,8 +13,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/selection/selection.go b/example/selection/selection.go index f0b163dd1f..5890d14ab9 100644 --- a/example/selection/selection.go +++ b/example/selection/selection.go @@ -8,7 +8,7 @@ import ( "time" "github.com/99designs/gqlgen/graphql" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type Resolver struct{} diff --git a/example/starwars/generated/exec.go b/example/starwars/generated/exec.go index c51b74bd58..e5757e6f31 100644 --- a/example/starwars/generated/exec.go +++ b/example/starwars/generated/exec.go @@ -15,8 +15,8 @@ import ( "github.com/99designs/gqlgen/example/starwars/models" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/todo/generated.go b/example/todo/generated.go index e3c2a40b13..ed03217ac2 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -13,8 +13,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/example/type-system-extension/generated.go b/example/type-system-extension/generated.go index d6e052d240..29b423d813 100644 --- a/example/type-system-extension/generated.go +++ b/example/type-system-extension/generated.go @@ -13,8 +13,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/go.mod b/go.mod index f09a35e2a6..d143c3bf8a 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,12 @@ go 1.12 require ( github.com/agnivade/levenshtein v1.0.3 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-chi/chi v3.3.2+incompatible github.com/gogo/protobuf v1.0.0 // indirect github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f // indirect github.com/gorilla/mux v1.6.1 // indirect github.com/gorilla/websocket v1.2.0 github.com/hashicorp/golang-lru v0.5.0 - github.com/kr/pretty v0.1.0 // indirect github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 github.com/matryer/moq v0.0.0-20200106131100-75d0ddfc0007 github.com/mattn/go-colorable v0.1.4 @@ -23,13 +21,12 @@ require ( github.com/rs/cors v1.6.0 github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371 // indirect github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0 // indirect - github.com/stretchr/testify v1.3.0 + github.com/stretchr/testify v1.4.0 github.com/urfave/cli v1.20.0 github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e - github.com/vektah/gqlparser v1.3.2-0.20200209091329-fcdc57498356 + github.com/vektah/gqlparser/v2 v2.0.1 golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589 - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect - gopkg.in/yaml.v2 v2.2.2 + gopkg.in/yaml.v2 v2.2.4 sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755 sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67 // indirect ) diff --git a/go.sum b/go.sum index c1fd80c800..265be01063 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rs/cors v1.6.0 h1:G9tHG9lebljV9mfp9SNPDL36nCDxmo3zTlAf1YgvzmI= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371 h1:SWV2fHctRpRrp49VXJ6UZja7gU9QLHwRpIPBN89SKEo= github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0 h1:JJV9CsgM9EC9w2iVkwuz+sMx8yRFe89PJRUrv6hPCIA= @@ -59,14 +59,14 @@ github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJV github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.1 h1:52QO5WkIUcHGIR7EnGagH88x1bUzqGXTC5/1bDTUQ7U= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e h1:+w0Zm/9gaWpEAyDlU1eKOuk5twTjAjuevXqcJJw8hrg= github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= -github.com/vektah/gqlparser v1.3.2-0.20200209091329-fcdc57498356 h1:v9PLvniug2CnIsccJr+eULcGQL0zQ2pgLyxDM18YMCM= -github.com/vektah/gqlparser v1.3.2-0.20200209091329-fcdc57498356/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= +github.com/vektah/gqlparser/v2 v2.0.1 h1:xgl5abVnsd4hkN9rk65OJID9bfcLSMuTaTcZj777q1o= +github.com/vektah/gqlparser/v2 v2.0.1/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -91,10 +91,12 @@ golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589/go.mod h1:TB2adYChydJhpapK golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755 h1:d2maSb13hr/ArmfK3rW+wNUKKfytCol7W1/vDHxMPiE= sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67 h1:e1sMhtVq9AfcEy8AXNb8eSg6gbzfdpYhoNqnPJa+GzI= diff --git a/graphql/context_field.go b/graphql/context_field.go index 416646627f..3c3385042b 100644 --- a/graphql/context_field.go +++ b/graphql/context_field.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type key string diff --git a/graphql/context_field_test.go b/graphql/context_field_test.go index 05e6cd1a74..3bdfe47eae 100644 --- a/graphql/context_field_test.go +++ b/graphql/context_field_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) func TestGetResolverContext(t *testing.T) { diff --git a/graphql/context_operation.go b/graphql/context_operation.go index cf1a279ec7..3d74a806de 100644 --- a/graphql/context_operation.go +++ b/graphql/context_operation.go @@ -4,7 +4,7 @@ import ( "context" "errors" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) // Deprecated: Please update all references to OperationContext instead diff --git a/graphql/context_operation_test.go b/graphql/context_operation_test.go index 1086c237fc..bb4d9212ab 100644 --- a/graphql/context_operation_test.go +++ b/graphql/context_operation_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) func TestGetOperationContext(t *testing.T) { diff --git a/graphql/context_response.go b/graphql/context_response.go index 4031752b87..160dfc77d7 100644 --- a/graphql/context_response.go +++ b/graphql/context_response.go @@ -5,7 +5,7 @@ import ( "fmt" "sync" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) type responseContext struct { diff --git a/graphql/context_response_test.go b/graphql/context_response_test.go index c009d45ab5..aa300229c4 100644 --- a/graphql/context_response_test.go +++ b/graphql/context_response_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser/ast" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/ast" + "github.com/vektah/gqlparser/v2/gqlerror" ) func TestAddError(t *testing.T) { diff --git a/graphql/errcode/codes.go b/graphql/errcode/codes.go index 746d0544fe..774ab7a9ea 100644 --- a/graphql/errcode/codes.go +++ b/graphql/errcode/codes.go @@ -1,7 +1,7 @@ package errcode import ( - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) const ValidationFailed = "GRAPHQL_VALIDATION_FAILED" diff --git a/graphql/error.go b/graphql/error.go index a7a6769bed..201058a2f6 100644 --- a/graphql/error.go +++ b/graphql/error.go @@ -3,7 +3,7 @@ package graphql import ( "context" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) type ErrorPresenterFunc func(ctx context.Context, err error) *gqlerror.Error diff --git a/graphql/executable_schema.go b/graphql/executable_schema.go index 7f0df9104e..7183965ed5 100644 --- a/graphql/executable_schema.go +++ b/graphql/executable_schema.go @@ -6,7 +6,7 @@ import ( "context" "fmt" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type ExecutableSchema interface { diff --git a/graphql/executable_schema_mock.go b/graphql/executable_schema_mock.go index c099de793e..0c021d3d00 100644 --- a/graphql/executable_schema_mock.go +++ b/graphql/executable_schema_mock.go @@ -5,7 +5,7 @@ package graphql import ( "context" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" "sync" ) diff --git a/graphql/handler.go b/graphql/handler.go index 077701cc42..e74af2f039 100644 --- a/graphql/handler.go +++ b/graphql/handler.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) type ( diff --git a/graphql/handler/apollotracing/tracer.go b/graphql/handler/apollotracing/tracer.go index c1478a518d..ac3c66a0d6 100644 --- a/graphql/handler/apollotracing/tracer.go +++ b/graphql/handler/apollotracing/tracer.go @@ -6,7 +6,7 @@ import ( "time" "github.com/99designs/gqlgen/graphql" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type ( diff --git a/graphql/handler/apollotracing/tracer_test.go b/graphql/handler/apollotracing/tracer_test.go index fa52c387c2..f83cfc415f 100644 --- a/graphql/handler/apollotracing/tracer_test.go +++ b/graphql/handler/apollotracing/tracer_test.go @@ -16,8 +16,8 @@ import ( "github.com/99designs/gqlgen/graphql/handler/transport" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser/ast" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/ast" + "github.com/vektah/gqlparser/v2/gqlerror" ) func TestApolloTracing(t *testing.T) { diff --git a/graphql/handler/executor.go b/graphql/handler/executor.go index 9bc0b2ab40..2402284196 100644 --- a/graphql/handler/executor.go +++ b/graphql/handler/executor.go @@ -5,10 +5,10 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/errcode" - "github.com/vektah/gqlparser/ast" - "github.com/vektah/gqlparser/gqlerror" - "github.com/vektah/gqlparser/parser" - "github.com/vektah/gqlparser/validator" + "github.com/vektah/gqlparser/v2/ast" + "github.com/vektah/gqlparser/v2/gqlerror" + "github.com/vektah/gqlparser/v2/parser" + "github.com/vektah/gqlparser/v2/validator" ) type executor struct { diff --git a/graphql/handler/extension/apq.go b/graphql/handler/extension/apq.go index 1ea0389fe0..83f4c1bfc8 100644 --- a/graphql/handler/extension/apq.go +++ b/graphql/handler/extension/apq.go @@ -8,7 +8,7 @@ import ( "github.com/99designs/gqlgen/graphql/errcode" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" "github.com/99designs/gqlgen/graphql" "github.com/mitchellh/mapstructure" diff --git a/graphql/handler/extension/complexity.go b/graphql/handler/extension/complexity.go index 30a7a3ff4c..2d853802bf 100644 --- a/graphql/handler/extension/complexity.go +++ b/graphql/handler/extension/complexity.go @@ -7,7 +7,7 @@ import ( "github.com/99designs/gqlgen/complexity" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/errcode" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) const errComplexityLimit = "COMPLEXITY_LIMIT_EXCEEDED" diff --git a/graphql/handler/extension/introspection.go b/graphql/handler/extension/introspection.go index 6cfc8bace5..acc5db2fbc 100644 --- a/graphql/handler/extension/introspection.go +++ b/graphql/handler/extension/introspection.go @@ -4,7 +4,7 @@ import ( "context" "github.com/99designs/gqlgen/graphql" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) // EnableIntrospection enables clients to reflect all of the types available on the graph. diff --git a/graphql/handler/server.go b/graphql/handler/server.go index 042bd588a2..61671f8905 100644 --- a/graphql/handler/server.go +++ b/graphql/handler/server.go @@ -11,7 +11,7 @@ import ( "github.com/99designs/gqlgen/graphql/handler/extension" "github.com/99designs/gqlgen/graphql/handler/lru" "github.com/99designs/gqlgen/graphql/handler/transport" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) type ( diff --git a/graphql/handler/server_test.go b/graphql/handler/server_test.go index a431a14288..6202a0a2f7 100644 --- a/graphql/handler/server_test.go +++ b/graphql/handler/server_test.go @@ -12,9 +12,9 @@ import ( "github.com/99designs/gqlgen/graphql/handler/transport" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser/ast" - "github.com/vektah/gqlparser/gqlerror" - "github.com/vektah/gqlparser/parser" + "github.com/vektah/gqlparser/v2/ast" + "github.com/vektah/gqlparser/v2/gqlerror" + "github.com/vektah/gqlparser/v2/parser" ) func TestServer(t *testing.T) { diff --git a/graphql/handler/testserver/testserver.go b/graphql/handler/testserver/testserver.go index a434091474..3e0f0e1b86 100644 --- a/graphql/handler/testserver/testserver.go +++ b/graphql/handler/testserver/testserver.go @@ -7,8 +7,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/handler" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // New provides a server for use in tests that isn't relying on generated code. It isnt a perfect reproduction of diff --git a/graphql/handler/transport/error.go b/graphql/handler/transport/error.go index e03481c9c0..b1aeaf144d 100644 --- a/graphql/handler/transport/error.go +++ b/graphql/handler/transport/error.go @@ -6,7 +6,7 @@ import ( "net/http" "github.com/99designs/gqlgen/graphql" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) // SendError sends a best effort error to a raw response writer. It assumes the client can understand the standard diff --git a/graphql/handler/transport/http_form_test.go b/graphql/handler/transport/http_form_test.go index b41e216e55..0a2d5c006a 100644 --- a/graphql/handler/transport/http_form_test.go +++ b/graphql/handler/transport/http_form_test.go @@ -13,8 +13,8 @@ import ( "github.com/99designs/gqlgen/graphql/handler" "github.com/99designs/gqlgen/graphql/handler/transport" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) func TestFileUpload(t *testing.T) { diff --git a/graphql/handler/transport/http_get.go b/graphql/handler/transport/http_get.go index 8cec6a6213..35d9a58be4 100644 --- a/graphql/handler/transport/http_get.go +++ b/graphql/handler/transport/http_get.go @@ -8,8 +8,8 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/errcode" - "github.com/vektah/gqlparser/ast" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/ast" + "github.com/vektah/gqlparser/v2/gqlerror" ) // GET implements the GET side of the default HTTP transport diff --git a/graphql/handler/transport/util.go b/graphql/handler/transport/util.go index d2de366430..ce845c1964 100644 --- a/graphql/handler/transport/util.go +++ b/graphql/handler/transport/util.go @@ -6,7 +6,7 @@ import ( "io" "github.com/99designs/gqlgen/graphql" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) func writeJson(w io.Writer, response *graphql.Response) { diff --git a/graphql/handler/transport/websocket.go b/graphql/handler/transport/websocket.go index 57552afb80..a59574f545 100644 --- a/graphql/handler/transport/websocket.go +++ b/graphql/handler/transport/websocket.go @@ -13,7 +13,7 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/errcode" "github.com/gorilla/websocket" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) const ( diff --git a/graphql/handler/transport/websocket_test.go b/graphql/handler/transport/websocket_test.go index 8cc984398f..15bf451509 100644 --- a/graphql/handler/transport/websocket_test.go +++ b/graphql/handler/transport/websocket_test.go @@ -17,8 +17,8 @@ import ( "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) func TestWebsocket(t *testing.T) { diff --git a/graphql/introspection/introspection.go b/graphql/introspection/introspection.go index ca0b065f83..5239c92839 100644 --- a/graphql/introspection/introspection.go +++ b/graphql/introspection/introspection.go @@ -1,7 +1,7 @@ // introspection implements the spec defined in https://github.com/facebook/graphql/blob/master/spec/Section%204%20--%20Introspection.md#schema-introspection package introspection -import "github.com/vektah/gqlparser/ast" +import "github.com/vektah/gqlparser/v2/ast" type ( Directive struct { diff --git a/graphql/introspection/schema.go b/graphql/introspection/schema.go index a57272d525..044e91d6e9 100644 --- a/graphql/introspection/schema.go +++ b/graphql/introspection/schema.go @@ -3,7 +3,7 @@ package introspection import ( "strings" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type Schema struct { diff --git a/graphql/introspection/type.go b/graphql/introspection/type.go index 9aceebdc95..60d491dc3b 100644 --- a/graphql/introspection/type.go +++ b/graphql/introspection/type.go @@ -3,7 +3,7 @@ package introspection import ( "strings" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type Type struct { diff --git a/graphql/introspection/type_test.go b/graphql/introspection/type_test.go index 7259e02cad..1f3b910276 100644 --- a/graphql/introspection/type_test.go +++ b/graphql/introspection/type_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) func TestType(t *testing.T) { diff --git a/graphql/jsonw_test.go b/graphql/jsonw_test.go index 856f1b9cdd..1bba9fcf37 100644 --- a/graphql/jsonw_test.go +++ b/graphql/jsonw_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) func TestJsonWriter(t *testing.T) { diff --git a/graphql/recovery.go b/graphql/recovery.go index d2cf911428..5c3c1027eb 100644 --- a/graphql/recovery.go +++ b/graphql/recovery.go @@ -7,7 +7,7 @@ import ( "os" "runtime/debug" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) type RecoverFunc func(ctx context.Context, err interface{}) (userMessage error) diff --git a/graphql/response.go b/graphql/response.go index 6fe55d56dc..0d36049a33 100644 --- a/graphql/response.go +++ b/graphql/response.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) // Errors are intentionally serialized first based on the advice in diff --git a/integration/generated.go b/integration/generated.go index e8516821fe..d5c3d89853 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -14,8 +14,8 @@ import ( "github.com/99designs/gqlgen/graphql/introspection" models "github.com/99designs/gqlgen/integration/models-go" "github.com/99designs/gqlgen/integration/remote_api" - "github.com/vektah/gqlparser" - "github.com/vektah/gqlparser/ast" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** diff --git a/integration/server/server.go b/integration/server/server.go index 63f2eca37d..b7b66ebd8d 100644 --- a/integration/server/server.go +++ b/integration/server/server.go @@ -13,7 +13,7 @@ import ( "github.com/99designs/gqlgen/graphql/playground" "github.com/99designs/gqlgen/integration" "github.com/pkg/errors" - "github.com/vektah/gqlparser/gqlerror" + "github.com/vektah/gqlparser/v2/gqlerror" ) const defaultPort = "8080" diff --git a/plugin/federation/federation.go b/plugin/federation/federation.go index 58f503494c..40e812a7bb 100644 --- a/plugin/federation/federation.go +++ b/plugin/federation/federation.go @@ -5,7 +5,7 @@ import ( "sort" "strings" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" "github.com/99designs/gqlgen/codegen" "github.com/99designs/gqlgen/codegen/config" diff --git a/plugin/modelgen/models.go b/plugin/modelgen/models.go index afcf65d69a..82bbdcc5ca 100644 --- a/plugin/modelgen/models.go +++ b/plugin/modelgen/models.go @@ -8,7 +8,7 @@ import ( "github.com/99designs/gqlgen/codegen/config" "github.com/99designs/gqlgen/codegen/templates" "github.com/99designs/gqlgen/plugin" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type BuildMutateHook = func(b *ModelBuild) *ModelBuild diff --git a/plugin/modelgen/models.gotpl b/plugin/modelgen/models.gotpl index a4579f8761..e58d5b21a4 100644 --- a/plugin/modelgen/models.gotpl +++ b/plugin/modelgen/models.gotpl @@ -7,8 +7,8 @@ {{ reserveImport "errors" }} {{ reserveImport "bytes" }} -{{ reserveImport "github.com/vektah/gqlparser" }} -{{ reserveImport "github.com/vektah/gqlparser/ast" }} +{{ reserveImport "github.com/vektah/gqlparser/v2" }} +{{ reserveImport "github.com/vektah/gqlparser/v2/ast" }} {{ reserveImport "github.com/99designs/gqlgen/graphql" }} {{ reserveImport "github.com/99designs/gqlgen/graphql/introspection" }} diff --git a/plugin/plugin.go b/plugin/plugin.go index 3ab5970c27..7de36bd8cd 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -5,7 +5,7 @@ package plugin import ( "github.com/99designs/gqlgen/codegen" "github.com/99designs/gqlgen/codegen/config" - "github.com/vektah/gqlparser/ast" + "github.com/vektah/gqlparser/v2/ast" ) type Plugin interface { diff --git a/plugin/resolvergen/resolver.gotpl b/plugin/resolvergen/resolver.gotpl index 3894ef745e..4e18e3bebe 100644 --- a/plugin/resolvergen/resolver.gotpl +++ b/plugin/resolvergen/resolver.gotpl @@ -7,8 +7,8 @@ {{ reserveImport "errors" }} {{ reserveImport "bytes" }} -{{ reserveImport "github.com/vektah/gqlparser" }} -{{ reserveImport "github.com/vektah/gqlparser/ast" }} +{{ reserveImport "github.com/vektah/gqlparser/v2" }} +{{ reserveImport "github.com/vektah/gqlparser/v2/ast" }} {{ reserveImport "github.com/99designs/gqlgen/graphql" }} {{ reserveImport "github.com/99designs/gqlgen/graphql/introspection" }} diff --git a/plugin/stubgen/stubs.gotpl b/plugin/stubgen/stubs.gotpl index 63df84767c..6b4291e4e9 100644 --- a/plugin/stubgen/stubs.gotpl +++ b/plugin/stubgen/stubs.gotpl @@ -7,8 +7,8 @@ {{ reserveImport "errors" }} {{ reserveImport "bytes" }} -{{ reserveImport "github.com/vektah/gqlparser" }} -{{ reserveImport "github.com/vektah/gqlparser/ast" }} +{{ reserveImport "github.com/vektah/gqlparser/v2" }} +{{ reserveImport "github.com/vektah/gqlparser/v2/ast" }} {{ reserveImport "github.com/99designs/gqlgen/graphql" }} {{ reserveImport "github.com/99designs/gqlgen/graphql/introspection" }}