From 7b3c00b6c5f00fee81e4e11f0cd403642ed34945 Mon Sep 17 00:00:00 2001 From: Parth Patel <88045217+pxp928@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:48:17 -0400 Subject: [PATCH] update gqlgen and gqlparser (#939) * update gqlgen and gqlparser Signed-off-by: pxp928 * fix deps.dev unit test Signed-off-by: pxp928 --------- Signed-off-by: pxp928 --- go.mod | 6 +- go.sum | 14 +- .../graphql/generated/artifact.generated.go | 419 ++++++++---------- .../graphql/generated/builder.generated.go | 28 +- .../graphql/generated/certifyBad.generated.go | 40 +- .../generated/certifyGood.generated.go | 40 +- .../generated/certifyScorecard.generated.go | 106 +++-- .../certifyVEXStatement.generated.go | 60 ++- .../generated/certifyVuln.generated.go | 106 +++-- .../graphql/generated/cve.generated.go | 32 +- .../graphql/generated/ghsa.generated.go | 28 +- .../graphql/generated/hasSBOM.generated.go | 83 ++-- .../graphql/generated/hasSLSA.generated.go | 110 +++-- .../generated/hasSourceAt.generated.go | 48 +- .../graphql/generated/hashEqual.generated.go | 40 +- .../generated/isDependency.generated.go | 52 ++- .../generated/isOccurrence.generated.go | 44 +- .../generated/isVulnerability.generated.go | 44 +- .../graphql/generated/osv.generated.go | 28 +- .../graphql/generated/package.generated.go | 156 ++++--- .../graphql/generated/pkgEqual.generated.go | 40 +- .../graphql/generated/prelude.generated.go | 241 +++++----- .../graphql/generated/root_.generated.go | 58 ++- .../graphql/generated/source.generated.go | 94 ++-- .../graphql/resolvers/artifact.resolvers.go | 2 +- .../graphql/resolvers/builder.resolvers.go | 2 +- .../graphql/resolvers/certifyBad.resolvers.go | 2 +- .../resolvers/certifyGood.resolvers.go | 2 +- .../resolvers/certifyScorecard.resolvers.go | 2 +- .../certifyVEXStatement.resolvers.go | 2 +- .../resolvers/certifyVuln.resolvers.go | 2 +- .../graphql/resolvers/cve.resolvers.go | 2 +- .../graphql/resolvers/ghsa.resolvers.go | 2 +- .../graphql/resolvers/hasSBOM.resolvers.go | 2 +- .../graphql/resolvers/hasSLSA.resolvers.go | 2 +- .../resolvers/hasSourceAt.resolvers.go | 2 +- .../graphql/resolvers/hashEqual.resolvers.go | 2 +- .../resolvers/isDependency.resolvers.go | 2 +- .../resolvers/isOccurrence.resolvers.go | 2 +- .../resolvers/isVulnerability.resolvers.go | 2 +- .../graphql/resolvers/osv.resolvers.go | 2 +- .../graphql/resolvers/package.resolvers.go | 2 +- .../graphql/resolvers/path.resolvers.go | 2 +- .../graphql/resolvers/pkgEqual.resolvers.go | 2 +- .../graphql/resolvers/source.resolvers.go | 2 +- 45 files changed, 1072 insertions(+), 887 deletions(-) diff --git a/go.mod b/go.mod index f8d4017054..454d72e6c6 100644 --- a/go.mod +++ b/go.mod @@ -123,7 +123,7 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/robfig/cron v1.2.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/sergi/go-diff v1.2.0 // indirect + github.com/sergi/go-diff v1.3.1 // indirect github.com/shurcooL/githubv4 v0.0.0-20201206200315-234843c633fa // indirect github.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a // indirect github.com/sirupsen/logrus v1.9.2 // indirect @@ -159,7 +159,7 @@ require ( ) require ( - github.com/99designs/gqlgen v0.17.31 + github.com/99designs/gqlgen v0.17.32 github.com/CycloneDX/cyclonedx-go v0.7.1 github.com/Khan/genqlient v0.6.0 github.com/Masterminds/semver v1.5.0 @@ -184,7 +184,7 @@ require ( github.com/sigstore/sigstore v1.6.5 github.com/spdx/tools-golang v0.5.2 github.com/spf13/viper v1.16.0 - github.com/vektah/gqlparser/v2 v2.5.1 + github.com/vektah/gqlparser/v2 v2.5.3 golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 1a69a9604f..c803451142 100644 --- a/go.sum +++ b/go.sum @@ -420,8 +420,8 @@ contrib.go.opencensus.io/exporter/aws v0.0.0-20200617204711-c478e41e60e9/go.mod contrib.go.opencensus.io/exporter/stackdriver v0.13.14/go.mod h1:5pSSGY0Bhuk7waTHuDf4aQ8D2DrhgETRo9fy6k3Xlzc= contrib.go.opencensus.io/integrations/ocsql v0.1.7/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/99designs/gqlgen v0.17.31 h1:VncSQ82VxieHkea8tz11p7h/zSbvHSxSDZfywqWt158= -github.com/99designs/gqlgen v0.17.31/go.mod h1:i4rEatMrzzu6RXaHydq1nmEPZkb3bKQsnxNRHS4DQB4= +github.com/99designs/gqlgen v0.17.32 h1:yX5On31oZ8I4dAfgZeeR/A8L9SWk+nD+cF8Aao4vmHs= +github.com/99designs/gqlgen v0.17.32/go.mod h1:5j5Ak84e9FTYtH3aaNhK+FoYzXdUAY9CahQcWDqOwR8= github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= github.com/Azure/azure-amqp-common-go/v3 v3.2.3/go.mod h1:7rPmbSfszeovxGfc5fSAXE4ehlXQZHpMja2OtxC2Tas= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= @@ -532,7 +532,6 @@ github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/ github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -1883,9 +1882,8 @@ github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvW github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/secure-systems-lab/go-securesystemslib v0.6.0 h1:T65atpAVCJQK14UA57LMdZGpHi4QYSH/9FZyNGqMYIA= github.com/secure-systems-lab/go-securesystemslib v0.6.0/go.mod h1:8Mtpo9JKks/qhPG4HGZ2LGMvrPbzuxwfz/f/zLfEWkk= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI= github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE= github.com/shoenig/test v0.6.0/go.mod h1:xYtyGBC5Q3kzCNyJg/SjgNpfAa2kvmgA0i5+lQso8x0= @@ -2016,8 +2014,8 @@ github.com/urfave/cli/v2 v2.25.5 h1:d0NIAyhh5shGscroL7ek/Ya9QYQE0KNabJgiUinIQkc= github.com/urfave/cli/v2 v2.25.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck= github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY= -github.com/vektah/gqlparser/v2 v2.5.1 h1:ZGu+bquAY23jsxDRcYpWjttRZrUz07LbiY77gUOHcr4= -github.com/vektah/gqlparser/v2 v2.5.1/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs= +github.com/vektah/gqlparser/v2 v2.5.3 h1:goUwv4+blhtwR3GwefadPVI4ubYc/WZSypljWMQa6IE= +github.com/vektah/gqlparser/v2 v2.5.3/go.mod h1:z8xXUff237NntSuH8mLFijZ+1tjV1swDbpDqjJmk6ME= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= diff --git a/pkg/assembler/graphql/generated/artifact.generated.go b/pkg/assembler/graphql/generated/artifact.generated.go index b4b06cebfe..4f01b8dcff 100644 --- a/pkg/assembler/graphql/generated/artifact.generated.go +++ b/pkg/assembler/graphql/generated/artifact.generated.go @@ -4341,41 +4341,48 @@ var artifactImplementors = []string{"Artifact", "PackageSourceOrArtifact", "Pack func (ec *executionContext) _Artifact(ctx context.Context, sel ast.SelectionSet, obj *model.Artifact) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, artifactImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Artifact") case "id": - out.Values[i] = ec._Artifact_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "algorithm": - out.Values[i] = ec._Artifact_algorithm(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "digest": - out.Values[i] = ec._Artifact_digest(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -4388,7 +4395,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) }) out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ Object: field.Name, @@ -4399,202 +4406,172 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "ingestArtifact": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestArtifact(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestBuilder": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestBuilder(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestCertifyBad": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestCertifyBad(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestCertifyGood": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestCertifyGood(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "certifyScorecard": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_certifyScorecard(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestVEXStatement": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestVEXStatement(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestVulnerability": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestVulnerability(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestCVE": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestCVE(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestGHSA": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestGHSA(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestHasSBOM": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestHasSBOM(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestSLSA": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestSLSA(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestMaterials": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestMaterials(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestHasSourceAt": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestHasSourceAt(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestHashEqual": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestHashEqual(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestDependency": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestDependency(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestOccurrence": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestOccurrence(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestIsVulnerability": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestIsVulnerability(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestOSV": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestOSV(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestPackage": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestPackage(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestPkgEqual": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestPkgEqual(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ingestSource": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_ingestSource(ctx, field) }) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -4607,7 +4584,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }) out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ Object: field.Name, @@ -4620,7 +4597,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "artifacts": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4628,22 +4605,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_artifacts(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "builders": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4651,22 +4627,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_builders(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "CertifyBad": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4674,22 +4649,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_CertifyBad(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "CertifyGood": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4697,22 +4671,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_CertifyGood(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "scorecards": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4720,22 +4693,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_scorecards(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "CertifyVEXStatement": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4743,22 +4715,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_CertifyVEXStatement(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "CertifyVuln": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4766,22 +4737,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_CertifyVuln(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "cve": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4789,22 +4759,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_cve(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "ghsa": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4812,22 +4781,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_ghsa(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "HasSBOM": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4835,22 +4803,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_HasSBOM(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "HasSLSA": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4858,22 +4825,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_HasSLSA(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "HasSourceAt": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4881,22 +4847,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_HasSourceAt(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "HashEqual": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4904,22 +4869,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_HashEqual(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "IsDependency": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4927,22 +4891,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_IsDependency(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "IsOccurrence": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4950,22 +4913,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_IsOccurrence(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "IsVulnerability": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4973,22 +4935,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_IsVulnerability(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "osv": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4996,22 +4957,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_osv(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "packages": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5019,22 +4979,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_packages(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "path": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5042,22 +5001,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_path(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "neighbors": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5065,22 +5023,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_neighbors(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "node": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5088,22 +5045,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_node(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "nodes": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5111,22 +5067,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_nodes(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "PkgEqual": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5134,22 +5089,21 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_PkgEqual(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "sources": field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5157,38 +5111,45 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_sources(ctx, field) if res == graphql.Null { - atomic.AddUint32(&invalids, 1) + atomic.AddUint32(&fs.Invalids, 1) } return res } rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "__type": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___type(ctx, field) }) - case "__schema": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___schema(ctx, field) }) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/builder.generated.go b/pkg/assembler/graphql/generated/builder.generated.go index 43b295e981..7ebe47e0e9 100644 --- a/pkg/assembler/graphql/generated/builder.generated.go +++ b/pkg/assembler/graphql/generated/builder.generated.go @@ -7,6 +7,7 @@ import ( "errors" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -198,34 +199,43 @@ var builderImplementors = []string{"Builder", "Node"} func (ec *executionContext) _Builder(ctx context.Context, sel ast.SelectionSet, obj *model.Builder) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, builderImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Builder") case "id": - out.Values[i] = ec._Builder_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "uri": - out.Values[i] = ec._Builder_uri(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/certifyBad.generated.go b/pkg/assembler/graphql/generated/certifyBad.generated.go index de3ff19573..971838f288 100644 --- a/pkg/assembler/graphql/generated/certifyBad.generated.go +++ b/pkg/assembler/graphql/generated/certifyBad.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -529,55 +530,58 @@ var certifyBadImplementors = []string{"CertifyBad", "Node"} func (ec *executionContext) _CertifyBad(ctx context.Context, sel ast.SelectionSet, obj *model.CertifyBad) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, certifyBadImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("CertifyBad") case "id": - out.Values[i] = ec._CertifyBad_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "subject": - out.Values[i] = ec._CertifyBad_subject(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "justification": - out.Values[i] = ec._CertifyBad_justification(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._CertifyBad_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._CertifyBad_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/certifyGood.generated.go b/pkg/assembler/graphql/generated/certifyGood.generated.go index 06614d6920..4c16ca5ecf 100644 --- a/pkg/assembler/graphql/generated/certifyGood.generated.go +++ b/pkg/assembler/graphql/generated/certifyGood.generated.go @@ -7,6 +7,7 @@ import ( "errors" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -375,55 +376,58 @@ var certifyGoodImplementors = []string{"CertifyGood", "Node"} func (ec *executionContext) _CertifyGood(ctx context.Context, sel ast.SelectionSet, obj *model.CertifyGood) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, certifyGoodImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("CertifyGood") case "id": - out.Values[i] = ec._CertifyGood_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "subject": - out.Values[i] = ec._CertifyGood_subject(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "justification": - out.Values[i] = ec._CertifyGood_justification(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._CertifyGood_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._CertifyGood_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/certifyScorecard.generated.go b/pkg/assembler/graphql/generated/certifyScorecard.generated.go index e7ef5d5ba9..79063240fb 100644 --- a/pkg/assembler/graphql/generated/certifyScorecard.generated.go +++ b/pkg/assembler/graphql/generated/certifyScorecard.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "time" "github.com/99designs/gqlgen/graphql" @@ -867,41 +868,48 @@ var certifyScorecardImplementors = []string{"CertifyScorecard", "Node"} func (ec *executionContext) _CertifyScorecard(ctx context.Context, sel ast.SelectionSet, obj *model.CertifyScorecard) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, certifyScorecardImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("CertifyScorecard") case "id": - out.Values[i] = ec._CertifyScorecard_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "source": - out.Values[i] = ec._CertifyScorecard_source(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "scorecard": - out.Values[i] = ec._CertifyScorecard_scorecard(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -909,69 +917,68 @@ var scorecardImplementors = []string{"Scorecard"} func (ec *executionContext) _Scorecard(ctx context.Context, sel ast.SelectionSet, obj *model.Scorecard) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, scorecardImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Scorecard") case "checks": - out.Values[i] = ec._Scorecard_checks(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "aggregateScore": - out.Values[i] = ec._Scorecard_aggregateScore(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "timeScanned": - out.Values[i] = ec._Scorecard_timeScanned(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "scorecardVersion": - out.Values[i] = ec._Scorecard_scorecardVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "scorecardCommit": - out.Values[i] = ec._Scorecard_scorecardCommit(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._Scorecard_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._Scorecard_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -979,34 +986,43 @@ var scorecardCheckImplementors = []string{"ScorecardCheck"} func (ec *executionContext) _ScorecardCheck(ctx context.Context, sel ast.SelectionSet, obj *model.ScorecardCheck) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, scorecardCheckImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("ScorecardCheck") case "check": - out.Values[i] = ec._ScorecardCheck_check(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "score": - out.Values[i] = ec._ScorecardCheck_score(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/certifyVEXStatement.generated.go b/pkg/assembler/graphql/generated/certifyVEXStatement.generated.go index b04023f00d..a550f0f983 100644 --- a/pkg/assembler/graphql/generated/certifyVEXStatement.generated.go +++ b/pkg/assembler/graphql/generated/certifyVEXStatement.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "time" "github.com/99designs/gqlgen/graphql" @@ -777,90 +778,83 @@ var certifyVEXStatementImplementors = []string{"CertifyVEXStatement", "Node"} func (ec *executionContext) _CertifyVEXStatement(ctx context.Context, sel ast.SelectionSet, obj *model.CertifyVEXStatement) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, certifyVEXStatementImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("CertifyVEXStatement") case "id": - out.Values[i] = ec._CertifyVEXStatement_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "subject": - out.Values[i] = ec._CertifyVEXStatement_subject(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "vulnerability": - out.Values[i] = ec._CertifyVEXStatement_vulnerability(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "status": - out.Values[i] = ec._CertifyVEXStatement_status(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "vexJustification": - out.Values[i] = ec._CertifyVEXStatement_vexJustification(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "statement": - out.Values[i] = ec._CertifyVEXStatement_statement(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "statusNotes": - out.Values[i] = ec._CertifyVEXStatement_statusNotes(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "knownSince": - out.Values[i] = ec._CertifyVEXStatement_knownSince(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._CertifyVEXStatement_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._CertifyVEXStatement_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/certifyVuln.generated.go b/pkg/assembler/graphql/generated/certifyVuln.generated.go index 598ab09980..a92f1432e0 100644 --- a/pkg/assembler/graphql/generated/certifyVuln.generated.go +++ b/pkg/assembler/graphql/generated/certifyVuln.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "time" "github.com/99designs/gqlgen/graphql" @@ -939,48 +940,53 @@ var certifyVulnImplementors = []string{"CertifyVuln", "Node"} func (ec *executionContext) _CertifyVuln(ctx context.Context, sel ast.SelectionSet, obj *model.CertifyVuln) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, certifyVulnImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("CertifyVuln") case "id": - out.Values[i] = ec._CertifyVuln_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "package": - out.Values[i] = ec._CertifyVuln_package(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "vulnerability": - out.Values[i] = ec._CertifyVuln_vulnerability(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "metadata": - out.Values[i] = ec._CertifyVuln_metadata(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -988,27 +994,38 @@ var noVulnImplementors = []string{"NoVuln", "Vulnerability", "Node"} func (ec *executionContext) _NoVuln(ctx context.Context, sel ast.SelectionSet, obj *model.NoVuln) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, noVulnImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("NoVuln") case "id": - out.Values[i] = ec._NoVuln_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -1016,69 +1033,68 @@ var vulnerabilityMetaDataImplementors = []string{"VulnerabilityMetaData"} func (ec *executionContext) _VulnerabilityMetaData(ctx context.Context, sel ast.SelectionSet, obj *model.VulnerabilityMetaData) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, vulnerabilityMetaDataImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("VulnerabilityMetaData") case "timeScanned": - out.Values[i] = ec._VulnerabilityMetaData_timeScanned(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "dbUri": - out.Values[i] = ec._VulnerabilityMetaData_dbUri(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "dbVersion": - out.Values[i] = ec._VulnerabilityMetaData_dbVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "scannerUri": - out.Values[i] = ec._VulnerabilityMetaData_scannerUri(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "scannerVersion": - out.Values[i] = ec._VulnerabilityMetaData_scannerVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._VulnerabilityMetaData_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._VulnerabilityMetaData_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/cve.generated.go b/pkg/assembler/graphql/generated/cve.generated.go index c8b160f431..13e9083c2b 100644 --- a/pkg/assembler/graphql/generated/cve.generated.go +++ b/pkg/assembler/graphql/generated/cve.generated.go @@ -7,6 +7,7 @@ import ( "errors" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -260,41 +261,48 @@ var cVEImplementors = []string{"CVE", "Vulnerability", "CveOrGhsa", "Node"} func (ec *executionContext) _CVE(ctx context.Context, sel ast.SelectionSet, obj *model.Cve) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, cVEImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("CVE") case "id": - out.Values[i] = ec._CVE_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "year": - out.Values[i] = ec._CVE_year(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "cveId": - out.Values[i] = ec._CVE_cveId(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/ghsa.generated.go b/pkg/assembler/graphql/generated/ghsa.generated.go index 0e69e0d77a..8834af06f1 100644 --- a/pkg/assembler/graphql/generated/ghsa.generated.go +++ b/pkg/assembler/graphql/generated/ghsa.generated.go @@ -7,6 +7,7 @@ import ( "errors" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -198,34 +199,43 @@ var gHSAImplementors = []string{"GHSA", "Vulnerability", "CveOrGhsa", "Node"} func (ec *executionContext) _GHSA(ctx context.Context, sel ast.SelectionSet, obj *model.Ghsa) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, gHSAImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("GHSA") case "id": - out.Values[i] = ec._GHSA_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "ghsaId": - out.Values[i] = ec._GHSA_ghsaId(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/hasSBOM.generated.go b/pkg/assembler/graphql/generated/hasSBOM.generated.go index 79489addaf..697eb40d94 100644 --- a/pkg/assembler/graphql/generated/hasSBOM.generated.go +++ b/pkg/assembler/graphql/generated/hasSBOM.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -798,34 +799,43 @@ var annotationImplementors = []string{"Annotation"} func (ec *executionContext) _Annotation(ctx context.Context, sel ast.SelectionSet, obj *model.Annotation) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, annotationImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Annotation") case "key": - out.Values[i] = ec._Annotation_key(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "value": - out.Values[i] = ec._Annotation_value(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -833,83 +843,78 @@ var hasSBOMImplementors = []string{"HasSBOM", "Node"} func (ec *executionContext) _HasSBOM(ctx context.Context, sel ast.SelectionSet, obj *model.HasSbom) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, hasSBOMImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("HasSBOM") case "id": - out.Values[i] = ec._HasSBOM_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "subject": - out.Values[i] = ec._HasSBOM_subject(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "uri": - out.Values[i] = ec._HasSBOM_uri(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "algorithm": - out.Values[i] = ec._HasSBOM_algorithm(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "digest": - out.Values[i] = ec._HasSBOM_digest(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "downloadLocation": - out.Values[i] = ec._HasSBOM_downloadLocation(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "annotations": - out.Values[i] = ec._HasSBOM_annotations(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._HasSBOM_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._HasSBOM_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/hasSLSA.generated.go b/pkg/assembler/graphql/generated/hasSLSA.generated.go index 0a3407cc21..8a831df4e5 100644 --- a/pkg/assembler/graphql/generated/hasSLSA.generated.go +++ b/pkg/assembler/graphql/generated/hasSLSA.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "time" "github.com/99designs/gqlgen/graphql" @@ -985,41 +986,48 @@ var hasSLSAImplementors = []string{"HasSLSA", "Node"} func (ec *executionContext) _HasSLSA(ctx context.Context, sel ast.SelectionSet, obj *model.HasSlsa) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, hasSLSAImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("HasSLSA") case "id": - out.Values[i] = ec._HasSLSA_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "subject": - out.Values[i] = ec._HasSLSA_subject(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "slsa": - out.Values[i] = ec._HasSLSA_slsa(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -1027,77 +1035,72 @@ var sLSAImplementors = []string{"SLSA"} func (ec *executionContext) _SLSA(ctx context.Context, sel ast.SelectionSet, obj *model.Slsa) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, sLSAImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("SLSA") case "builtFrom": - out.Values[i] = ec._SLSA_builtFrom(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "builtBy": - out.Values[i] = ec._SLSA_builtBy(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "buildType": - out.Values[i] = ec._SLSA_buildType(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "slsaPredicate": - out.Values[i] = ec._SLSA_slsaPredicate(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "slsaVersion": - out.Values[i] = ec._SLSA_slsaVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "startedOn": - out.Values[i] = ec._SLSA_startedOn(ctx, field, obj) - case "finishedOn": - out.Values[i] = ec._SLSA_finishedOn(ctx, field, obj) - case "origin": - out.Values[i] = ec._SLSA_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._SLSA_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -1105,34 +1108,43 @@ var sLSAPredicateImplementors = []string{"SLSAPredicate"} func (ec *executionContext) _SLSAPredicate(ctx context.Context, sel ast.SelectionSet, obj *model.SLSAPredicate) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, sLSAPredicateImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("SLSAPredicate") case "key": - out.Values[i] = ec._SLSAPredicate_key(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "value": - out.Values[i] = ec._SLSAPredicate_value(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/hasSourceAt.generated.go b/pkg/assembler/graphql/generated/hasSourceAt.generated.go index a51447160e..041b299a2b 100644 --- a/pkg/assembler/graphql/generated/hasSourceAt.generated.go +++ b/pkg/assembler/graphql/generated/hasSourceAt.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "time" "github.com/99designs/gqlgen/graphql" @@ -508,69 +509,68 @@ var hasSourceAtImplementors = []string{"HasSourceAt", "Node"} func (ec *executionContext) _HasSourceAt(ctx context.Context, sel ast.SelectionSet, obj *model.HasSourceAt) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, hasSourceAtImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("HasSourceAt") case "id": - out.Values[i] = ec._HasSourceAt_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "package": - out.Values[i] = ec._HasSourceAt_package(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "source": - out.Values[i] = ec._HasSourceAt_source(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "knownSince": - out.Values[i] = ec._HasSourceAt_knownSince(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "justification": - out.Values[i] = ec._HasSourceAt_justification(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._HasSourceAt_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._HasSourceAt_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/hashEqual.generated.go b/pkg/assembler/graphql/generated/hashEqual.generated.go index 7d47f65953..29467c0291 100644 --- a/pkg/assembler/graphql/generated/hashEqual.generated.go +++ b/pkg/assembler/graphql/generated/hashEqual.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -384,55 +385,58 @@ var hashEqualImplementors = []string{"HashEqual", "Node"} func (ec *executionContext) _HashEqual(ctx context.Context, sel ast.SelectionSet, obj *model.HashEqual) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, hashEqualImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("HashEqual") case "id": - out.Values[i] = ec._HashEqual_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "artifacts": - out.Values[i] = ec._HashEqual_artifacts(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "justification": - out.Values[i] = ec._HashEqual_justification(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._HashEqual_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._HashEqual_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/isDependency.generated.go b/pkg/assembler/graphql/generated/isDependency.generated.go index 56d0c0c377..36de626634 100644 --- a/pkg/assembler/graphql/generated/isDependency.generated.go +++ b/pkg/assembler/graphql/generated/isDependency.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -625,76 +626,73 @@ var isDependencyImplementors = []string{"IsDependency", "Node"} func (ec *executionContext) _IsDependency(ctx context.Context, sel ast.SelectionSet, obj *model.IsDependency) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, isDependencyImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("IsDependency") case "id": - out.Values[i] = ec._IsDependency_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "package": - out.Values[i] = ec._IsDependency_package(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "dependentPackage": - out.Values[i] = ec._IsDependency_dependentPackage(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "versionRange": - out.Values[i] = ec._IsDependency_versionRange(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "dependencyType": - out.Values[i] = ec._IsDependency_dependencyType(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "justification": - out.Values[i] = ec._IsDependency_justification(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._IsDependency_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._IsDependency_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/isOccurrence.generated.go b/pkg/assembler/graphql/generated/isOccurrence.generated.go index 75c03dae5a..f3e0e037fb 100644 --- a/pkg/assembler/graphql/generated/isOccurrence.generated.go +++ b/pkg/assembler/graphql/generated/isOccurrence.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -536,62 +537,63 @@ var isOccurrenceImplementors = []string{"IsOccurrence", "Node"} func (ec *executionContext) _IsOccurrence(ctx context.Context, sel ast.SelectionSet, obj *model.IsOccurrence) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, isOccurrenceImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("IsOccurrence") case "id": - out.Values[i] = ec._IsOccurrence_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "subject": - out.Values[i] = ec._IsOccurrence_subject(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "artifact": - out.Values[i] = ec._IsOccurrence_artifact(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "justification": - out.Values[i] = ec._IsOccurrence_justification(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._IsOccurrence_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._IsOccurrence_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/isVulnerability.generated.go b/pkg/assembler/graphql/generated/isVulnerability.generated.go index 547b84aedc..43d99f6de0 100644 --- a/pkg/assembler/graphql/generated/isVulnerability.generated.go +++ b/pkg/assembler/graphql/generated/isVulnerability.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -534,62 +535,63 @@ var isVulnerabilityImplementors = []string{"IsVulnerability", "Node"} func (ec *executionContext) _IsVulnerability(ctx context.Context, sel ast.SelectionSet, obj *model.IsVulnerability) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, isVulnerabilityImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("IsVulnerability") case "id": - out.Values[i] = ec._IsVulnerability_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "osv": - out.Values[i] = ec._IsVulnerability_osv(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "vulnerability": - out.Values[i] = ec._IsVulnerability_vulnerability(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "justification": - out.Values[i] = ec._IsVulnerability_justification(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._IsVulnerability_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._IsVulnerability_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/osv.generated.go b/pkg/assembler/graphql/generated/osv.generated.go index 65ac516cd5..b9de10979c 100644 --- a/pkg/assembler/graphql/generated/osv.generated.go +++ b/pkg/assembler/graphql/generated/osv.generated.go @@ -7,6 +7,7 @@ import ( "errors" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -198,34 +199,43 @@ var oSVImplementors = []string{"OSV", "Vulnerability", "Node"} func (ec *executionContext) _OSV(ctx context.Context, sel ast.SelectionSet, obj *model.Osv) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, oSVImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("OSV") case "id": - out.Values[i] = ec._OSV_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "osvId": - out.Values[i] = ec._OSV_osvId(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/package.generated.go b/pkg/assembler/graphql/generated/package.generated.go index 8a67ecc2b5..91f36703b3 100644 --- a/pkg/assembler/graphql/generated/package.generated.go +++ b/pkg/assembler/graphql/generated/package.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -998,41 +999,48 @@ var packageImplementors = []string{"Package", "PackageSourceOrArtifact", "Packag func (ec *executionContext) _Package(ctx context.Context, sel ast.SelectionSet, obj *model.Package) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, packageImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Package") case "id": - out.Values[i] = ec._Package_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "type": - out.Values[i] = ec._Package_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "namespaces": - out.Values[i] = ec._Package_namespaces(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -1040,41 +1048,48 @@ var packageNameImplementors = []string{"PackageName"} func (ec *executionContext) _PackageName(ctx context.Context, sel ast.SelectionSet, obj *model.PackageName) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, packageNameImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("PackageName") case "id": - out.Values[i] = ec._PackageName_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "name": - out.Values[i] = ec._PackageName_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "versions": - out.Values[i] = ec._PackageName_versions(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -1082,41 +1097,48 @@ var packageNamespaceImplementors = []string{"PackageNamespace"} func (ec *executionContext) _PackageNamespace(ctx context.Context, sel ast.SelectionSet, obj *model.PackageNamespace) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, packageNamespaceImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("PackageNamespace") case "id": - out.Values[i] = ec._PackageNamespace_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "namespace": - out.Values[i] = ec._PackageNamespace_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "names": - out.Values[i] = ec._PackageNamespace_names(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -1124,34 +1146,43 @@ var packageQualifierImplementors = []string{"PackageQualifier"} func (ec *executionContext) _PackageQualifier(ctx context.Context, sel ast.SelectionSet, obj *model.PackageQualifier) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, packageQualifierImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("PackageQualifier") case "key": - out.Values[i] = ec._PackageQualifier_key(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "value": - out.Values[i] = ec._PackageQualifier_value(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -1159,48 +1190,53 @@ var packageVersionImplementors = []string{"PackageVersion"} func (ec *executionContext) _PackageVersion(ctx context.Context, sel ast.SelectionSet, obj *model.PackageVersion) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, packageVersionImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("PackageVersion") case "id": - out.Values[i] = ec._PackageVersion_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "version": - out.Values[i] = ec._PackageVersion_version(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "qualifiers": - out.Values[i] = ec._PackageVersion_qualifiers(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "subpath": - out.Values[i] = ec._PackageVersion_subpath(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/pkgEqual.generated.go b/pkg/assembler/graphql/generated/pkgEqual.generated.go index a5a601ff63..c5c7ee26f2 100644 --- a/pkg/assembler/graphql/generated/pkgEqual.generated.go +++ b/pkg/assembler/graphql/generated/pkgEqual.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -384,55 +385,58 @@ var pkgEqualImplementors = []string{"PkgEqual", "Node"} func (ec *executionContext) _PkgEqual(ctx context.Context, sel ast.SelectionSet, obj *model.PkgEqual) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, pkgEqualImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("PkgEqual") case "id": - out.Values[i] = ec._PkgEqual_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "packages": - out.Values[i] = ec._PkgEqual_packages(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "justification": - out.Values[i] = ec._PkgEqual_justification(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "origin": - out.Values[i] = ec._PkgEqual_origin(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "collector": - out.Values[i] = ec._PkgEqual_collector(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/prelude.generated.go b/pkg/assembler/graphql/generated/prelude.generated.go index da236a6c26..1caff8e422 100644 --- a/pkg/assembler/graphql/generated/prelude.generated.go +++ b/pkg/assembler/graphql/generated/prelude.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" @@ -20,6 +21,30 @@ import ( // region ***************************** args.gotpl ***************************** +func (ec *executionContext) dir_defer_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *bool + if tmp, ok := rawArgs["if"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("if")) + arg0, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["if"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["label"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("label")) + arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["label"] = arg1 + return args, nil +} + func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -1843,52 +1868,55 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - out.Values[i] = ec.___Directive_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "description": - out.Values[i] = ec.___Directive_description(ctx, field, obj) - case "locations": - out.Values[i] = ec.___Directive_locations(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "args": - out.Values[i] = ec.___Directive_args(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "isRepeatable": - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -1896,42 +1924,47 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - out.Values[i] = ec.___EnumValue_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "description": - out.Values[i] = ec.___EnumValue_description(ctx, field, obj) - case "isDeprecated": - out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "deprecationReason": - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -1939,56 +1972,57 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - out.Values[i] = ec.___Field_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "description": - out.Values[i] = ec.___Field_description(ctx, field, obj) - case "args": - out.Values[i] = ec.___Field_args(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "type": - out.Values[i] = ec.___Field_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "isDeprecated": - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "deprecationReason": - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -1996,42 +2030,47 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - out.Values[i] = ec.___InputValue_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "description": - out.Values[i] = ec.___InputValue_description(ctx, field, obj) - case "type": - out.Values[i] = ec.___InputValue_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "defaultValue": - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -2039,53 +2078,54 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - out.Values[i] = ec.___Schema_description(ctx, field, obj) - case "types": - out.Values[i] = ec.___Schema_types(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "queryType": - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "mutationType": - out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) - case "subscriptionType": - out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) - case "directives": - out.Values[i] = ec.___Schema_directives(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -2093,63 +2133,56 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - out.Values[i] = ec.___Type_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "name": - out.Values[i] = ec.___Type_name(ctx, field, obj) - case "description": - out.Values[i] = ec.___Type_description(ctx, field, obj) - case "fields": - out.Values[i] = ec.___Type_fields(ctx, field, obj) - case "interfaces": - out.Values[i] = ec.___Type_interfaces(ctx, field, obj) - case "possibleTypes": - out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) - case "enumValues": - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) - case "inputFields": - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) - case "ofType": - out.Values[i] = ec.___Type_ofType(ctx, field, obj) - case "specifiedByURL": - out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/generated/root_.generated.go b/pkg/assembler/graphql/generated/root_.generated.go index fae9e6b259..2c6a373100 100644 --- a/pkg/assembler/graphql/generated/root_.generated.go +++ b/pkg/assembler/graphql/generated/root_.generated.go @@ -6,6 +6,7 @@ import ( "bytes" "context" "errors" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" @@ -343,7 +344,7 @@ func (e *executableSchema) Schema() *ast.Schema { } func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { - ec := executionContext{nil, e} + ec := executionContext{nil, e, 0, 0, nil} _ = ec switch typeName + "." + field { @@ -1894,7 +1895,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e} + ec := executionContext{rc, e, 0, 0, make(chan graphql.DeferredResult)} inputUnmarshalMap := graphql.BuildUnmarshalerMap( ec.unmarshalInputAnnotationInputSpec, ec.unmarshalInputAnnotationSpec, @@ -1962,18 +1963,33 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { switch rc.Operation.Operation { case ast.Query: return func(ctx context.Context) *graphql.Response { - if !first { - return nil + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, rc.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } } - first = false - ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) - data := ec._Query(ctx, rc.Operation.SelectionSet) var buf bytes.Buffer data.MarshalGQL(&buf) - - return &graphql.Response{ - Data: buf.Bytes(), + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext } + + return &response } case ast.Mutation: return func(ctx context.Context) *graphql.Response { @@ -1999,6 +2015,28 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { type executionContext struct { *graphql.OperationContext *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() } func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { diff --git a/pkg/assembler/graphql/generated/source.generated.go b/pkg/assembler/graphql/generated/source.generated.go index 80a4c6c5b9..a3e9435ad5 100644 --- a/pkg/assembler/graphql/generated/source.generated.go +++ b/pkg/assembler/graphql/generated/source.generated.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "sync" + "sync/atomic" "github.com/99designs/gqlgen/graphql" "github.com/guacsec/guac/pkg/assembler/graphql/model" @@ -642,41 +643,48 @@ var sourceImplementors = []string{"Source", "PackageSourceOrArtifact", "PackageO func (ec *executionContext) _Source(ctx context.Context, sel ast.SelectionSet, obj *model.Source) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, sourceImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Source") case "id": - out.Values[i] = ec._Source_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "type": - out.Values[i] = ec._Source_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "namespaces": - out.Values[i] = ec._Source_namespaces(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -684,42 +692,47 @@ var sourceNameImplementors = []string{"SourceName"} func (ec *executionContext) _SourceName(ctx context.Context, sel ast.SelectionSet, obj *model.SourceName) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, sourceNameImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("SourceName") case "id": - out.Values[i] = ec._SourceName_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "name": - out.Values[i] = ec._SourceName_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "tag": - out.Values[i] = ec._SourceName_tag(ctx, field, obj) - case "commit": - out.Values[i] = ec._SourceName_commit(ctx, field, obj) - default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } @@ -727,41 +740,48 @@ var sourceNamespaceImplementors = []string{"SourceNamespace"} func (ec *executionContext) _SourceNamespace(ctx context.Context, sel ast.SelectionSet, obj *model.SourceNamespace) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, sourceNamespaceImplementors) + out := graphql.NewFieldSet(fields) - var invalids uint32 + deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("SourceNamespace") case "id": - out.Values[i] = ec._SourceNamespace_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "namespace": - out.Values[i] = ec._SourceNamespace_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } case "names": - out.Values[i] = ec._SourceNamespace_names(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ + out.Invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) } } - out.Dispatch() - if invalids > 0 { + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + return out } diff --git a/pkg/assembler/graphql/resolvers/artifact.resolvers.go b/pkg/assembler/graphql/resolvers/artifact.resolvers.go index ab1751c0a5..3a377a00d2 100644 --- a/pkg/assembler/graphql/resolvers/artifact.resolvers.go +++ b/pkg/assembler/graphql/resolvers/artifact.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/builder.resolvers.go b/pkg/assembler/graphql/resolvers/builder.resolvers.go index 4cbd885f26..c9ee976afc 100644 --- a/pkg/assembler/graphql/resolvers/builder.resolvers.go +++ b/pkg/assembler/graphql/resolvers/builder.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/certifyBad.resolvers.go b/pkg/assembler/graphql/resolvers/certifyBad.resolvers.go index 4b508800c1..0950bd282c 100644 --- a/pkg/assembler/graphql/resolvers/certifyBad.resolvers.go +++ b/pkg/assembler/graphql/resolvers/certifyBad.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/certifyGood.resolvers.go b/pkg/assembler/graphql/resolvers/certifyGood.resolvers.go index 089a4f654c..d10e2e9a6e 100644 --- a/pkg/assembler/graphql/resolvers/certifyGood.resolvers.go +++ b/pkg/assembler/graphql/resolvers/certifyGood.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/certifyScorecard.resolvers.go b/pkg/assembler/graphql/resolvers/certifyScorecard.resolvers.go index 5bbbb3b5b8..5a25dddeb5 100644 --- a/pkg/assembler/graphql/resolvers/certifyScorecard.resolvers.go +++ b/pkg/assembler/graphql/resolvers/certifyScorecard.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/certifyVEXStatement.resolvers.go b/pkg/assembler/graphql/resolvers/certifyVEXStatement.resolvers.go index a717f9281d..b7122b735f 100644 --- a/pkg/assembler/graphql/resolvers/certifyVEXStatement.resolvers.go +++ b/pkg/assembler/graphql/resolvers/certifyVEXStatement.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/certifyVuln.resolvers.go b/pkg/assembler/graphql/resolvers/certifyVuln.resolvers.go index 13ffdebe72..56c1a1eaf4 100644 --- a/pkg/assembler/graphql/resolvers/certifyVuln.resolvers.go +++ b/pkg/assembler/graphql/resolvers/certifyVuln.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/cve.resolvers.go b/pkg/assembler/graphql/resolvers/cve.resolvers.go index 4014eaea13..4ccc9be947 100644 --- a/pkg/assembler/graphql/resolvers/cve.resolvers.go +++ b/pkg/assembler/graphql/resolvers/cve.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/ghsa.resolvers.go b/pkg/assembler/graphql/resolvers/ghsa.resolvers.go index 10855a4824..bec0267cda 100644 --- a/pkg/assembler/graphql/resolvers/ghsa.resolvers.go +++ b/pkg/assembler/graphql/resolvers/ghsa.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/hasSBOM.resolvers.go b/pkg/assembler/graphql/resolvers/hasSBOM.resolvers.go index ae4be9d9f9..8e74407afb 100644 --- a/pkg/assembler/graphql/resolvers/hasSBOM.resolvers.go +++ b/pkg/assembler/graphql/resolvers/hasSBOM.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/hasSLSA.resolvers.go b/pkg/assembler/graphql/resolvers/hasSLSA.resolvers.go index a8a4dad476..b891bb156f 100644 --- a/pkg/assembler/graphql/resolvers/hasSLSA.resolvers.go +++ b/pkg/assembler/graphql/resolvers/hasSLSA.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/hasSourceAt.resolvers.go b/pkg/assembler/graphql/resolvers/hasSourceAt.resolvers.go index e075908206..fff614f967 100644 --- a/pkg/assembler/graphql/resolvers/hasSourceAt.resolvers.go +++ b/pkg/assembler/graphql/resolvers/hasSourceAt.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/hashEqual.resolvers.go b/pkg/assembler/graphql/resolvers/hashEqual.resolvers.go index bbf9b6733b..efd75ad26d 100644 --- a/pkg/assembler/graphql/resolvers/hashEqual.resolvers.go +++ b/pkg/assembler/graphql/resolvers/hashEqual.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/isDependency.resolvers.go b/pkg/assembler/graphql/resolvers/isDependency.resolvers.go index 6bb14f09bd..4cb0561e4c 100644 --- a/pkg/assembler/graphql/resolvers/isDependency.resolvers.go +++ b/pkg/assembler/graphql/resolvers/isDependency.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/isOccurrence.resolvers.go b/pkg/assembler/graphql/resolvers/isOccurrence.resolvers.go index c34dc9fc85..ca08d8487b 100644 --- a/pkg/assembler/graphql/resolvers/isOccurrence.resolvers.go +++ b/pkg/assembler/graphql/resolvers/isOccurrence.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/isVulnerability.resolvers.go b/pkg/assembler/graphql/resolvers/isVulnerability.resolvers.go index e48044974f..c41f67fdc7 100644 --- a/pkg/assembler/graphql/resolvers/isVulnerability.resolvers.go +++ b/pkg/assembler/graphql/resolvers/isVulnerability.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/osv.resolvers.go b/pkg/assembler/graphql/resolvers/osv.resolvers.go index f7b8601a50..8274eadc3d 100644 --- a/pkg/assembler/graphql/resolvers/osv.resolvers.go +++ b/pkg/assembler/graphql/resolvers/osv.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/package.resolvers.go b/pkg/assembler/graphql/resolvers/package.resolvers.go index 08b3729e1c..a864ccf836 100644 --- a/pkg/assembler/graphql/resolvers/package.resolvers.go +++ b/pkg/assembler/graphql/resolvers/package.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/path.resolvers.go b/pkg/assembler/graphql/resolvers/path.resolvers.go index 9941a20661..2481cb6302 100644 --- a/pkg/assembler/graphql/resolvers/path.resolvers.go +++ b/pkg/assembler/graphql/resolvers/path.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/pkgEqual.resolvers.go b/pkg/assembler/graphql/resolvers/pkgEqual.resolvers.go index 1a0b738876..14446f6952 100644 --- a/pkg/assembler/graphql/resolvers/pkgEqual.resolvers.go +++ b/pkg/assembler/graphql/resolvers/pkgEqual.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context" diff --git a/pkg/assembler/graphql/resolvers/source.resolvers.go b/pkg/assembler/graphql/resolvers/source.resolvers.go index 8f2701848a..9abd301db5 100644 --- a/pkg/assembler/graphql/resolvers/source.resolvers.go +++ b/pkg/assembler/graphql/resolvers/source.resolvers.go @@ -2,7 +2,7 @@ package resolvers // 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.31 +// Code generated by github.com/99designs/gqlgen version v0.17.32 import ( "context"