From 02c0b909dad23bf301cc006cf8ef0a99a259bdb9 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Wed, 8 Mar 2023 06:24:17 +0000 Subject: [PATCH] chore(deps): bump github.com/99designs/gqlgen from 0.17.25 to 0.17.26 Bumps [github.com/99designs/gqlgen](https://github.com/99designs/gqlgen) from 0.17.25 to 0.17.26. - [Release notes](https://github.com/99designs/gqlgen/releases) - [Changelog](https://github.com/99designs/gqlgen/blob/master/CHANGELOG.md) - [Commits](https://github.com/99designs/gqlgen/compare/v0.17.25...v0.17.26) --- go.mod | 2 +- go.sum | 4 ++-- graph/generated/generated.go | 23 +++++++++++++++++++++++ graph/schema.resolvers.go | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index b7de75e..a0e3aec 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module gitlab.com/unboundsoftware/schemas go 1.19 require ( - github.com/99designs/gqlgen v0.17.25 + github.com/99designs/gqlgen v0.17.26 github.com/Khan/genqlient v0.5.0 github.com/alecthomas/kong v0.7.1 github.com/apex/log v1.9.0 diff --git a/go.sum b/go.sum index ab65db9..cf917f8 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/99designs/gqlgen v0.17.2/go.mod h1:K5fzLKwtph+FFgh9j7nFbRUdBKvTcGnsta51fsMTn3o= -github.com/99designs/gqlgen v0.17.25 h1:5CAocr5i+dqY0lUR+Xu0InU81Ax/g+xsxKwOU8Glqy0= -github.com/99designs/gqlgen v0.17.25/go.mod h1:i4rEatMrzzu6RXaHydq1nmEPZkb3bKQsnxNRHS4DQB4= +github.com/99designs/gqlgen v0.17.26 h1:fxgSTbPf1G30uWAWSoHd+9gSNMagmP04k58ThJ1/ikQ= +github.com/99designs/gqlgen v0.17.26/go.mod h1:i4rEatMrzzu6RXaHydq1nmEPZkb3bKQsnxNRHS4DQB4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= diff --git a/graph/generated/generated.go b/graph/generated/generated.go index 26c19f6..56bb665 100644 --- a/graph/generated/generated.go +++ b/graph/generated/generated.go @@ -9,6 +9,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "time" "github.com/99designs/gqlgen/graphql" @@ -484,6 +485,7 @@ func (ec *executionContext) _Mutation_updateSubGraph(ctx context.Context, field }) if err != nil { ec.Error(ctx, err) + return graphql.Null } if resTmp == nil { if !graphql.HasFieldError(ctx, fc) { @@ -574,6 +576,7 @@ func (ec *executionContext) _Query_subGraphs(ctx context.Context, field graphql. }) if err != nil { ec.Error(ctx, err) + return graphql.Null } if resTmp == nil { if !graphql.HasFieldError(ctx, fc) { @@ -664,6 +667,7 @@ func (ec *executionContext) _Query_supergraph(ctx context.Context, field graphql }) if err != nil { ec.Error(ctx, err) + return graphql.Null } if resTmp == nil { if !graphql.HasFieldError(ctx, fc) { @@ -718,6 +722,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }) if err != nil { ec.Error(ctx, err) + return graphql.Null } if resTmp == nil { return graphql.Null @@ -791,6 +796,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }) if err != nil { ec.Error(ctx, err) + return graphql.Null } if resTmp == nil { return graphql.Null @@ -3238,6 +3244,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) }) out := graphql.NewFieldSet(fields) + var invalids uint32 for i, field := range fields { innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ Object: field.Name, @@ -3253,11 +3260,17 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return ec._Mutation_updateSubGraph(ctx, field) }) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } } out.Dispatch() + if invalids > 0 { + return graphql.Null + } return out } @@ -3270,6 +3283,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }) out := graphql.NewFieldSet(fields) + var invalids uint32 for i, field := range fields { innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ Object: field.Name, @@ -3289,6 +3303,9 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } }() res = ec._Query_subGraphs(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -3309,6 +3326,9 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } }() res = ec._Query_supergraph(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res } @@ -3336,6 +3356,9 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } } out.Dispatch() + if invalids > 0 { + return graphql.Null + } return out } diff --git a/graph/schema.resolvers.go b/graph/schema.resolvers.go index 79f51ef..8389a53 100644 --- a/graph/schema.resolvers.go +++ b/graph/schema.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.25 +// Code generated by github.com/99designs/gqlgen version v0.17.26 import ( "context"