diff --git a/go.mod b/go.mod index c4f3bff..4374eea 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module gitea.unbound.se/unboundsoftware/schemas go 1.25 require ( - github.com/99designs/gqlgen v0.17.86 + github.com/99designs/gqlgen v0.17.87 github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/Khan/genqlient v0.8.1 github.com/alecthomas/kong v1.14.0 @@ -43,7 +43,7 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.4.0 // indirect + github.com/go-viper/mapstructure/v2 v2.5.0 // indirect github.com/goccy/go-json v0.10.5 // indirect github.com/goccy/go-yaml v1.19.2 // indirect github.com/gorilla/websocket v1.5.1 // indirect @@ -69,7 +69,7 @@ require ( github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/tidwall/sjson v1.2.5 // indirect - github.com/urfave/cli/v3 v3.6.1 // indirect + github.com/urfave/cli/v3 v3.6.2 // indirect github.com/valyala/fastjson v1.6.7 // indirect github.com/wundergraph/astjson v1.0.0 // indirect github.com/wundergraph/go-arena v1.1.0 // indirect @@ -78,12 +78,12 @@ require ( go.opentelemetry.io/otel/metric v1.40.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/mod v0.32.0 // indirect - golang.org/x/net v0.49.0 // indirect + golang.org/x/mod v0.33.0 // indirect + golang.org/x/net v0.50.0 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.41.0 // indirect golang.org/x/text v0.34.0 // indirect - golang.org/x/tools v0.41.0 // indirect + golang.org/x/tools v0.42.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect google.golang.org/grpc v1.78.0 // indirect diff --git a/go.sum b/go.sum index 2d83a77..a30c6e3 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= -github.com/99designs/gqlgen v0.17.86 h1:C8N3UTa5heXX6twl+b0AJyGkTwYL6dNmFrgZNLRcU6w= -github.com/99designs/gqlgen v0.17.86/go.mod h1:KTrPl+vHA1IUzNlh4EYkl7+tcErL3MgKnhHrBcV74Fw= +github.com/99designs/gqlgen v0.17.87 h1:pSnCIMhBQezAE8bc1GNmfdLXFmnWtWl1GRDFEE/nHP8= +github.com/99designs/gqlgen v0.17.87/go.mod h1:fK05f1RqSNfQpd4CfW5qk/810Tqi4/56Wf6Nem0khAg= github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/Khan/genqlient v0.8.1 h1:wtOCc8N9rNynRLXN3k3CnfzheCUNKBcvXmVv5zt6WCs= @@ -57,8 +57,8 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo= github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU= -github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= -github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= +github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= @@ -187,8 +187,8 @@ github.com/tj/go-buffer v1.1.0/go.mod h1:iyiJpfFcR2B9sXu7KvjbT9fpM4mOelRSDTbntVj github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= -github.com/urfave/cli/v3 v3.6.1 h1:j8Qq8NyUawj/7rTYdBGrxcH7A/j7/G8Q5LhWEW4G3Mo= -github.com/urfave/cli/v3 v3.6.1/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso= +github.com/urfave/cli/v3 v3.6.2 h1:lQuqiPrZ1cIz8hz+HcrG0TNZFxU70dPZ3Yl+pSrH9A8= +github.com/urfave/cli/v3 v3.6.2/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso= github.com/valyala/fastjson v1.6.7 h1:ZE4tRy0CIkh+qDc5McjatheGX2czdn8slQjomexVpBM= github.com/valyala/fastjson v1.6.7/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/vektah/gqlparser/v2 v2.5.32 h1:k9QPJd4sEDTL+qB4ncPLflqTJ3MmjB9SrVzJrawpFSc= @@ -245,13 +245,13 @@ golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o= golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= -golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= -golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= +golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= +golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= -golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= +golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= +golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= @@ -266,8 +266,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= -golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= +golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= +golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 h1:merA0rdPeUV3YIIfHHcH4qBkiQAc1nfCKSI7lB4cV2M= diff --git a/graph/generated/generated.go b/graph/generated/generated.go index a9bc206..5131963 100644 --- a/graph/generated/generated.go +++ b/graph/generated/generated.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "strconv" - "sync" "sync/atomic" "time" @@ -24,20 +23,10 @@ import ( // NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { - return &executableSchema{ - schema: cfg.Schema, - resolvers: cfg.Resolvers, - directives: cfg.Directives, - complexity: cfg.Complexity, - } + return &executableSchema{SchemaData: cfg.Schema, Resolvers: cfg.Resolvers, Directives: cfg.Directives, ComplexityRoot: cfg.Complexity} } -type Config struct { - Schema *ast.Schema - Resolvers ResolverRoot - Directives DirectiveRoot - Complexity ComplexityRoot -} +type Config = graphql.Config[ResolverRoot, DirectiveRoot, ComplexityRoot] type ResolverRoot interface { Mutation() MutationResolver @@ -139,70 +128,65 @@ type SubscriptionResolver interface { SchemaUpdates(ctx context.Context, ref string) (<-chan *model.SchemaUpdate, error) } -type executableSchema struct { - schema *ast.Schema - resolvers ResolverRoot - directives DirectiveRoot - complexity ComplexityRoot -} +type executableSchema graphql.ExecutableSchemaState[ResolverRoot, DirectiveRoot, ComplexityRoot] func (e *executableSchema) Schema() *ast.Schema { - if e.schema != nil { - return e.schema + if e.SchemaData != nil { + return e.SchemaData } return parsedSchema } func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) { - ec := executionContext{nil, e, 0, 0, nil} + ec := newExecutionContext(nil, e, nil) _ = ec switch typeName + "." + field { case "APIKey.id": - if e.complexity.APIKey.ID == nil { + if e.ComplexityRoot.APIKey.ID == nil { break } - return e.complexity.APIKey.ID(childComplexity), true + return e.ComplexityRoot.APIKey.ID(childComplexity), true case "APIKey.key": - if e.complexity.APIKey.Key == nil { + if e.ComplexityRoot.APIKey.Key == nil { break } - return e.complexity.APIKey.Key(childComplexity), true + return e.ComplexityRoot.APIKey.Key(childComplexity), true case "APIKey.name": - if e.complexity.APIKey.Name == nil { + if e.ComplexityRoot.APIKey.Name == nil { break } - return e.complexity.APIKey.Name(childComplexity), true + return e.ComplexityRoot.APIKey.Name(childComplexity), true case "APIKey.organization": - if e.complexity.APIKey.Organization == nil { + if e.ComplexityRoot.APIKey.Organization == nil { break } - return e.complexity.APIKey.Organization(childComplexity), true + return e.ComplexityRoot.APIKey.Organization(childComplexity), true case "APIKey.publish": - if e.complexity.APIKey.Publish == nil { + if e.ComplexityRoot.APIKey.Publish == nil { break } - return e.complexity.APIKey.Publish(childComplexity), true + return e.ComplexityRoot.APIKey.Publish(childComplexity), true case "APIKey.read": - if e.complexity.APIKey.Read == nil { + if e.ComplexityRoot.APIKey.Read == nil { break } - return e.complexity.APIKey.Read(childComplexity), true + return e.ComplexityRoot.APIKey.Read(childComplexity), true case "APIKey.refs": - if e.complexity.APIKey.Refs == nil { + if e.ComplexityRoot.APIKey.Refs == nil { break } - return e.complexity.APIKey.Refs(childComplexity), true + return e.ComplexityRoot.APIKey.Refs(childComplexity), true case "Mutation.addAPIKey": - if e.complexity.Mutation.AddAPIKey == nil { + if e.ComplexityRoot.Mutation.AddAPIKey == nil { break } @@ -211,9 +195,9 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return 0, false } - return e.complexity.Mutation.AddAPIKey(childComplexity, args["input"].(*model.InputAPIKey)), true + return e.ComplexityRoot.Mutation.AddAPIKey(childComplexity, args["input"].(*model.InputAPIKey)), true case "Mutation.addOrganization": - if e.complexity.Mutation.AddOrganization == nil { + if e.ComplexityRoot.Mutation.AddOrganization == nil { break } @@ -222,9 +206,9 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return 0, false } - return e.complexity.Mutation.AddOrganization(childComplexity, args["name"].(string)), true + return e.ComplexityRoot.Mutation.AddOrganization(childComplexity, args["name"].(string)), true case "Mutation.addUserToOrganization": - if e.complexity.Mutation.AddUserToOrganization == nil { + if e.ComplexityRoot.Mutation.AddUserToOrganization == nil { break } @@ -233,9 +217,9 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return 0, false } - return e.complexity.Mutation.AddUserToOrganization(childComplexity, args["organizationId"].(string), args["userId"].(string)), true + return e.ComplexityRoot.Mutation.AddUserToOrganization(childComplexity, args["organizationId"].(string), args["userId"].(string)), true case "Mutation.removeAPIKey": - if e.complexity.Mutation.RemoveAPIKey == nil { + if e.ComplexityRoot.Mutation.RemoveAPIKey == nil { break } @@ -244,9 +228,9 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return 0, false } - return e.complexity.Mutation.RemoveAPIKey(childComplexity, args["organizationId"].(string), args["keyName"].(string)), true + return e.ComplexityRoot.Mutation.RemoveAPIKey(childComplexity, args["organizationId"].(string), args["keyName"].(string)), true case "Mutation.removeOrganization": - if e.complexity.Mutation.RemoveOrganization == nil { + if e.ComplexityRoot.Mutation.RemoveOrganization == nil { break } @@ -255,9 +239,9 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return 0, false } - return e.complexity.Mutation.RemoveOrganization(childComplexity, args["organizationId"].(string)), true + return e.ComplexityRoot.Mutation.RemoveOrganization(childComplexity, args["organizationId"].(string)), true case "Mutation.updateSubGraph": - if e.complexity.Mutation.UpdateSubGraph == nil { + if e.ComplexityRoot.Mutation.UpdateSubGraph == nil { break } @@ -266,41 +250,42 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return 0, false } - return e.complexity.Mutation.UpdateSubGraph(childComplexity, args["input"].(model.InputSubGraph)), true + return e.ComplexityRoot.Mutation.UpdateSubGraph(childComplexity, args["input"].(model.InputSubGraph)), true case "Organization.apiKeys": - if e.complexity.Organization.APIKeys == nil { + if e.ComplexityRoot.Organization.APIKeys == nil { break } - return e.complexity.Organization.APIKeys(childComplexity), true + return e.ComplexityRoot.Organization.APIKeys(childComplexity), true case "Organization.id": - if e.complexity.Organization.ID == nil { + if e.ComplexityRoot.Organization.ID == nil { break } - return e.complexity.Organization.ID(childComplexity), true + return e.ComplexityRoot.Organization.ID(childComplexity), true case "Organization.name": - if e.complexity.Organization.Name == nil { + if e.ComplexityRoot.Organization.Name == nil { break } - return e.complexity.Organization.Name(childComplexity), true + return e.ComplexityRoot.Organization.Name(childComplexity), true case "Organization.users": - if e.complexity.Organization.Users == nil { + if e.ComplexityRoot.Organization.Users == nil { break } - return e.complexity.Organization.Users(childComplexity), true + return e.ComplexityRoot.Organization.Users(childComplexity), true case "Query.allOrganizations": - if e.complexity.Query.AllOrganizations == nil { + if e.ComplexityRoot.Query.AllOrganizations == nil { break } - return e.complexity.Query.AllOrganizations(childComplexity), true + return e.ComplexityRoot.Query.AllOrganizations(childComplexity), true + case "Query.latestSchema": - if e.complexity.Query.LatestSchema == nil { + if e.ComplexityRoot.Query.LatestSchema == nil { break } @@ -309,15 +294,15 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return 0, false } - return e.complexity.Query.LatestSchema(childComplexity, args["ref"].(string)), true + return e.ComplexityRoot.Query.LatestSchema(childComplexity, args["ref"].(string)), true case "Query.organizations": - if e.complexity.Query.Organizations == nil { + if e.ComplexityRoot.Query.Organizations == nil { break } - return e.complexity.Query.Organizations(childComplexity), true + return e.ComplexityRoot.Query.Organizations(childComplexity), true case "Query.supergraph": - if e.complexity.Query.Supergraph == nil { + if e.ComplexityRoot.Query.Supergraph == nil { break } @@ -326,103 +311,103 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return 0, false } - return e.complexity.Query.Supergraph(childComplexity, args["ref"].(string), args["isAfter"].(*string)), true + return e.ComplexityRoot.Query.Supergraph(childComplexity, args["ref"].(string), args["isAfter"].(*string)), true case "SchemaUpdate.cosmoRouterConfig": - if e.complexity.SchemaUpdate.CosmoRouterConfig == nil { + if e.ComplexityRoot.SchemaUpdate.CosmoRouterConfig == nil { break } - return e.complexity.SchemaUpdate.CosmoRouterConfig(childComplexity), true + return e.ComplexityRoot.SchemaUpdate.CosmoRouterConfig(childComplexity), true case "SchemaUpdate.id": - if e.complexity.SchemaUpdate.ID == nil { + if e.ComplexityRoot.SchemaUpdate.ID == nil { break } - return e.complexity.SchemaUpdate.ID(childComplexity), true + return e.ComplexityRoot.SchemaUpdate.ID(childComplexity), true case "SchemaUpdate.ref": - if e.complexity.SchemaUpdate.Ref == nil { + if e.ComplexityRoot.SchemaUpdate.Ref == nil { break } - return e.complexity.SchemaUpdate.Ref(childComplexity), true + return e.ComplexityRoot.SchemaUpdate.Ref(childComplexity), true case "SchemaUpdate.subGraphs": - if e.complexity.SchemaUpdate.SubGraphs == nil { + if e.ComplexityRoot.SchemaUpdate.SubGraphs == nil { break } - return e.complexity.SchemaUpdate.SubGraphs(childComplexity), true + return e.ComplexityRoot.SchemaUpdate.SubGraphs(childComplexity), true case "SubGraph.changedAt": - if e.complexity.SubGraph.ChangedAt == nil { + if e.ComplexityRoot.SubGraph.ChangedAt == nil { break } - return e.complexity.SubGraph.ChangedAt(childComplexity), true + return e.ComplexityRoot.SubGraph.ChangedAt(childComplexity), true case "SubGraph.changedBy": - if e.complexity.SubGraph.ChangedBy == nil { + if e.ComplexityRoot.SubGraph.ChangedBy == nil { break } - return e.complexity.SubGraph.ChangedBy(childComplexity), true + return e.ComplexityRoot.SubGraph.ChangedBy(childComplexity), true case "SubGraph.id": - if e.complexity.SubGraph.ID == nil { + if e.ComplexityRoot.SubGraph.ID == nil { break } - return e.complexity.SubGraph.ID(childComplexity), true + return e.ComplexityRoot.SubGraph.ID(childComplexity), true case "SubGraph.sdl": - if e.complexity.SubGraph.Sdl == nil { + if e.ComplexityRoot.SubGraph.Sdl == nil { break } - return e.complexity.SubGraph.Sdl(childComplexity), true + return e.ComplexityRoot.SubGraph.Sdl(childComplexity), true case "SubGraph.service": - if e.complexity.SubGraph.Service == nil { + if e.ComplexityRoot.SubGraph.Service == nil { break } - return e.complexity.SubGraph.Service(childComplexity), true + return e.ComplexityRoot.SubGraph.Service(childComplexity), true case "SubGraph.url": - if e.complexity.SubGraph.URL == nil { + if e.ComplexityRoot.SubGraph.URL == nil { break } - return e.complexity.SubGraph.URL(childComplexity), true + return e.ComplexityRoot.SubGraph.URL(childComplexity), true case "SubGraph.wsUrl": - if e.complexity.SubGraph.WsURL == nil { + if e.ComplexityRoot.SubGraph.WsURL == nil { break } - return e.complexity.SubGraph.WsURL(childComplexity), true + return e.ComplexityRoot.SubGraph.WsURL(childComplexity), true case "SubGraphs.id": - if e.complexity.SubGraphs.ID == nil { + if e.ComplexityRoot.SubGraphs.ID == nil { break } - return e.complexity.SubGraphs.ID(childComplexity), true + return e.ComplexityRoot.SubGraphs.ID(childComplexity), true case "SubGraphs.minDelaySeconds": - if e.complexity.SubGraphs.MinDelaySeconds == nil { + if e.ComplexityRoot.SubGraphs.MinDelaySeconds == nil { break } - return e.complexity.SubGraphs.MinDelaySeconds(childComplexity), true + return e.ComplexityRoot.SubGraphs.MinDelaySeconds(childComplexity), true case "SubGraphs.sdl": - if e.complexity.SubGraphs.Sdl == nil { + if e.ComplexityRoot.SubGraphs.Sdl == nil { break } - return e.complexity.SubGraphs.Sdl(childComplexity), true + return e.ComplexityRoot.SubGraphs.Sdl(childComplexity), true case "SubGraphs.subGraphs": - if e.complexity.SubGraphs.SubGraphs == nil { + if e.ComplexityRoot.SubGraphs.SubGraphs == nil { break } - return e.complexity.SubGraphs.SubGraphs(childComplexity), true + return e.ComplexityRoot.SubGraphs.SubGraphs(childComplexity), true case "Subscription.schemaUpdates": - if e.complexity.Subscription.SchemaUpdates == nil { + if e.ComplexityRoot.Subscription.SchemaUpdates == nil { break } @@ -431,27 +416,27 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return 0, false } - return e.complexity.Subscription.SchemaUpdates(childComplexity, args["ref"].(string)), true + return e.ComplexityRoot.Subscription.SchemaUpdates(childComplexity, args["ref"].(string)), true case "Unchanged.id": - if e.complexity.Unchanged.ID == nil { + if e.ComplexityRoot.Unchanged.ID == nil { break } - return e.complexity.Unchanged.ID(childComplexity), true + return e.ComplexityRoot.Unchanged.ID(childComplexity), true case "Unchanged.minDelaySeconds": - if e.complexity.Unchanged.MinDelaySeconds == nil { + if e.ComplexityRoot.Unchanged.MinDelaySeconds == nil { break } - return e.complexity.Unchanged.MinDelaySeconds(childComplexity), true + return e.ComplexityRoot.Unchanged.MinDelaySeconds(childComplexity), true case "User.id": - if e.complexity.User.ID == nil { + if e.ComplexityRoot.User.ID == nil { break } - return e.complexity.User.ID(childComplexity), true + return e.ComplexityRoot.User.ID(childComplexity), true } return 0, false @@ -459,7 +444,7 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { opCtx := graphql.GetOperationContext(ctx) - ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} + ec := newExecutionContext(opCtx, e, make(chan graphql.DeferredResult)) inputUnmarshalMap := graphql.BuildUnmarshalerMap( ec.unmarshalInputInputAPIKey, ec.unmarshalInputInputSubGraph, @@ -476,9 +461,9 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) data = ec._Query(ctx, opCtx.Operation.SelectionSet) } else { - if atomic.LoadInt32(&ec.pendingDeferred) > 0 { - result := <-ec.deferredResults - atomic.AddInt32(&ec.pendingDeferred, -1) + 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 @@ -490,8 +475,8 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { var buf bytes.Buffer data.MarshalGQL(&buf) response.Data = buf.Bytes() - if atomic.LoadInt32(&ec.deferred) > 0 { - hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + if atomic.LoadInt32(&ec.Deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.PendingDeferred) > 0 response.HasNext = &hasNext } @@ -536,44 +521,22 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { } type executionContext struct { - *graphql.OperationContext - *executableSchema - deferred int32 - pendingDeferred int32 - deferredResults chan graphql.DeferredResult + *graphql.ExecutionContextState[ResolverRoot, DirectiveRoot, ComplexityRoot] } -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) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") +func newExecutionContext( + opCtx *graphql.OperationContext, + execSchema *executableSchema, + deferredResults chan graphql.DeferredResult, +) executionContext { + return executionContext{ + ExecutionContextState: graphql.NewExecutionContextState[ResolverRoot, DirectiveRoot, ComplexityRoot]( + opCtx, + (*graphql.ExecutableSchemaState[ResolverRoot, DirectiveRoot, ComplexityRoot])(execSchema), + parsedSchema, + deferredResults, + ), } - return introspection.WrapSchema(ec.Schema()), nil -} - -func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil } var sources = []*ast.Source{ @@ -1090,7 +1053,7 @@ func (ec *executionContext) _Mutation_addOrganization(ctx context.Context, field ec.fieldContext_Mutation_addOrganization, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Mutation().AddOrganization(ctx, fc.Args["name"].(string)) + return ec.Resolvers.Mutation().AddOrganization(ctx, fc.Args["name"].(string)) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -1101,11 +1064,11 @@ func (ec *executionContext) _Mutation_addOrganization(ctx context.Context, field var zeroVal *model.Organization return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal *model.Organization return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, user, nil) + return ec.Directives.Auth(ctx, nil, directive0, user, nil) } next = directive1 @@ -1159,7 +1122,7 @@ func (ec *executionContext) _Mutation_addUserToOrganization(ctx context.Context, ec.fieldContext_Mutation_addUserToOrganization, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Mutation().AddUserToOrganization(ctx, fc.Args["organizationId"].(string), fc.Args["userId"].(string)) + return ec.Resolvers.Mutation().AddUserToOrganization(ctx, fc.Args["organizationId"].(string), fc.Args["userId"].(string)) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -1170,11 +1133,11 @@ func (ec *executionContext) _Mutation_addUserToOrganization(ctx context.Context, var zeroVal *model.Organization return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal *model.Organization return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, user, nil) + return ec.Directives.Auth(ctx, nil, directive0, user, nil) } next = directive1 @@ -1228,7 +1191,7 @@ func (ec *executionContext) _Mutation_addAPIKey(ctx context.Context, field graph ec.fieldContext_Mutation_addAPIKey, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Mutation().AddAPIKey(ctx, fc.Args["input"].(*model.InputAPIKey)) + return ec.Resolvers.Mutation().AddAPIKey(ctx, fc.Args["input"].(*model.InputAPIKey)) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -1239,11 +1202,11 @@ func (ec *executionContext) _Mutation_addAPIKey(ctx context.Context, field graph var zeroVal *model.APIKey return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal *model.APIKey return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, user, nil) + return ec.Directives.Auth(ctx, nil, directive0, user, nil) } next = directive1 @@ -1303,7 +1266,7 @@ func (ec *executionContext) _Mutation_removeAPIKey(ctx context.Context, field gr ec.fieldContext_Mutation_removeAPIKey, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Mutation().RemoveAPIKey(ctx, fc.Args["organizationId"].(string), fc.Args["keyName"].(string)) + return ec.Resolvers.Mutation().RemoveAPIKey(ctx, fc.Args["organizationId"].(string), fc.Args["keyName"].(string)) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -1314,11 +1277,11 @@ func (ec *executionContext) _Mutation_removeAPIKey(ctx context.Context, field gr var zeroVal *model.Organization return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal *model.Organization return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, user, nil) + return ec.Directives.Auth(ctx, nil, directive0, user, nil) } next = directive1 @@ -1372,7 +1335,7 @@ func (ec *executionContext) _Mutation_removeOrganization(ctx context.Context, fi ec.fieldContext_Mutation_removeOrganization, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Mutation().RemoveOrganization(ctx, fc.Args["organizationId"].(string)) + return ec.Resolvers.Mutation().RemoveOrganization(ctx, fc.Args["organizationId"].(string)) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -1383,11 +1346,11 @@ func (ec *executionContext) _Mutation_removeOrganization(ctx context.Context, fi var zeroVal bool return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal bool return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, user, nil) + return ec.Directives.Auth(ctx, nil, directive0, user, nil) } next = directive1 @@ -1431,7 +1394,7 @@ func (ec *executionContext) _Mutation_updateSubGraph(ctx context.Context, field ec.fieldContext_Mutation_updateSubGraph, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Mutation().UpdateSubGraph(ctx, fc.Args["input"].(model.InputSubGraph)) + return ec.Resolvers.Mutation().UpdateSubGraph(ctx, fc.Args["input"].(model.InputSubGraph)) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -1442,11 +1405,11 @@ func (ec *executionContext) _Mutation_updateSubGraph(ctx context.Context, field var zeroVal *model.SubGraph return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal *model.SubGraph return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, nil, organization) + return ec.Directives.Auth(ctx, nil, directive0, nil, organization) } next = directive1 @@ -1641,7 +1604,7 @@ func (ec *executionContext) _Query_organizations(ctx context.Context, field grap field, ec.fieldContext_Query_organizations, func(ctx context.Context) (any, error) { - return ec.resolvers.Query().Organizations(ctx) + return ec.Resolvers.Query().Organizations(ctx) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -1652,11 +1615,11 @@ func (ec *executionContext) _Query_organizations(ctx context.Context, field grap var zeroVal []*model.Organization return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal []*model.Organization return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, user, nil) + return ec.Directives.Auth(ctx, nil, directive0, user, nil) } next = directive1 @@ -1698,7 +1661,7 @@ func (ec *executionContext) _Query_allOrganizations(ctx context.Context, field g field, ec.fieldContext_Query_allOrganizations, func(ctx context.Context) (any, error) { - return ec.resolvers.Query().AllOrganizations(ctx) + return ec.Resolvers.Query().AllOrganizations(ctx) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -1709,11 +1672,11 @@ func (ec *executionContext) _Query_allOrganizations(ctx context.Context, field g var zeroVal []*model.Organization return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal []*model.Organization return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, user, nil) + return ec.Directives.Auth(ctx, nil, directive0, user, nil) } next = directive1 @@ -1756,7 +1719,7 @@ func (ec *executionContext) _Query_supergraph(ctx context.Context, field graphql ec.fieldContext_Query_supergraph, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Query().Supergraph(ctx, fc.Args["ref"].(string), fc.Args["isAfter"].(*string)) + return ec.Resolvers.Query().Supergraph(ctx, fc.Args["ref"].(string), fc.Args["isAfter"].(*string)) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -1772,11 +1735,11 @@ func (ec *executionContext) _Query_supergraph(ctx context.Context, field graphql var zeroVal model.Supergraph return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal model.Supergraph return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, user, organization) + return ec.Directives.Auth(ctx, nil, directive0, user, organization) } next = directive1 @@ -1820,7 +1783,7 @@ func (ec *executionContext) _Query_latestSchema(ctx context.Context, field graph ec.fieldContext_Query_latestSchema, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Query().LatestSchema(ctx, fc.Args["ref"].(string)) + return ec.Resolvers.Query().LatestSchema(ctx, fc.Args["ref"].(string)) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -1836,11 +1799,11 @@ func (ec *executionContext) _Query_latestSchema(ctx context.Context, field graph var zeroVal *model.SchemaUpdate return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal *model.SchemaUpdate return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, user, organization) + return ec.Directives.Auth(ctx, nil, directive0, user, organization) } next = directive1 @@ -1894,7 +1857,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col ec.fieldContext_Query___type, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.introspectType(fc.Args["name"].(string)) + return ec.IntrospectType(fc.Args["name"].(string)) }, nil, ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType, @@ -1958,7 +1921,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C field, ec.fieldContext_Query___schema, func(ctx context.Context) (any, error) { - return ec.introspectSchema() + return ec.IntrospectSchema() }, nil, ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema, @@ -2469,7 +2432,7 @@ func (ec *executionContext) _Subscription_schemaUpdates(ctx context.Context, fie ec.fieldContext_Subscription_schemaUpdates, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Subscription().SchemaUpdates(ctx, fc.Args["ref"].(string)) + return ec.Resolvers.Subscription().SchemaUpdates(ctx, fc.Args["ref"].(string)) }, func(ctx context.Context, next graphql.Resolver) graphql.Resolver { directive0 := next @@ -2480,11 +2443,11 @@ func (ec *executionContext) _Subscription_schemaUpdates(ctx context.Context, fie var zeroVal *model.SchemaUpdate return zeroVal, err } - if ec.directives.Auth == nil { + if ec.Directives.Auth == nil { var zeroVal *model.SchemaUpdate return zeroVal, errors.New("directive auth is not implemented") } - return ec.directives.Auth(ctx, nil, directive0, nil, organization) + return ec.Directives.Auth(ctx, nil, directive0, nil, organization) } next = directive1 @@ -4114,7 +4077,6 @@ func (ec *executionContext) unmarshalInputInputAPIKey(ctx context.Context, obj a it.Publish = data } } - return it, nil } @@ -4169,7 +4131,6 @@ func (ec *executionContext) unmarshalInputInputSubGraph(ctx context.Context, obj it.Sdl = data } } - return it, nil } @@ -4260,10 +4221,10 @@ func (ec *executionContext) _APIKey(ctx context.Context, sel ast.SelectionSet, o return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4344,10 +4305,10 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4398,10 +4359,10 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4536,10 +4497,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4587,10 +4548,10 @@ func (ec *executionContext) _SchemaUpdate(ctx context.Context, sel ast.Selection return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4650,10 +4611,10 @@ func (ec *executionContext) _SubGraph(ctx context.Context, sel ast.SelectionSet, return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4704,10 +4665,10 @@ func (ec *executionContext) _SubGraphs(ctx context.Context, sel ast.SelectionSet return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4768,10 +4729,10 @@ func (ec *executionContext) _Unchanged(ctx context.Context, sel ast.SelectionSet return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4807,10 +4768,10 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4863,10 +4824,10 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4911,10 +4872,10 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -4969,10 +4930,10 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -5024,10 +4985,10 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -5079,10 +5040,10 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -5138,10 +5099,10 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return graphql.Null } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + atomic.AddInt32(&ec.Deferred, int32(len(deferred))) for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ + ec.ProcessDeferredGroup(graphql.DeferredGroup{ Label: label, Path: graphql.GetPath(ctx), FieldSet: dfs, @@ -5161,39 +5122,11 @@ func (ec *executionContext) marshalNAPIKey2giteaᚗunboundᚗseᚋunboundsoftwar } func (ec *executionContext) marshalNAPIKey2ᚕᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐAPIKeyᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.APIKey) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNAPIKey2ᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐAPIKey(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalNAPIKey2ᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐAPIKey(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5272,39 +5205,11 @@ func (ec *executionContext) marshalNOrganization2giteaᚗunboundᚗseᚋunbounds } func (ec *executionContext) marshalNOrganization2ᚕᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐOrganizationᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Organization) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNOrganization2ᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐOrganization(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalNOrganization2ᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐOrganization(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5390,39 +5295,11 @@ func (ec *executionContext) marshalNSubGraph2giteaᚗunboundᚗseᚋunboundsoftw } func (ec *executionContext) marshalNSubGraph2ᚕᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐSubGraphᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.SubGraph) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNSubGraph2ᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐSubGraph(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalNSubGraph2ᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐSubGraph(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5470,39 +5347,11 @@ func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel as } func (ec *executionContext) marshalNUser2ᚕᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐUserᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.User) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNUser2ᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐUser(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalNUser2ᚖgiteaᚗunboundᚗseᚋunboundsoftwareᚋschemasᚋgraphᚋmodelᚐUser(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5528,39 +5377,11 @@ func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlge } func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5603,39 +5424,11 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte } func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5659,39 +5452,11 @@ func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlg } func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5707,39 +5472,11 @@ func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋg } func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5836,39 +5573,11 @@ func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgq if v == nil { return graphql.Null } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5883,39 +5592,11 @@ func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgen if v == nil { return graphql.Null } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5930,39 +5611,11 @@ func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋg if v == nil { return graphql.Null } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null { @@ -5984,39 +5637,11 @@ func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen if v == nil { return graphql.Null } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + }) for _, e := range ret { if e == graphql.Null {