From 74455673aff6399c35afea4cf90679d602c1fd81 Mon Sep 17 00:00:00 2001 From: an1l4 <1995anila@gmail.com> Date: Mon, 29 Apr 2024 12:30:04 +0530 Subject: [PATCH] clean up repo by removing graphqlserver textfile composefile --- Dockerfile | 11 - docker-compose.yaml | 148 - dockerfiles/graphqlserver/Dockerfile | 11 - graphqlserver/gqlgen.yml | 87 - graphqlserver/graph/generated.go | 19952 ---------------------- graphqlserver/graph/model/models_gen.go | 293 - graphqlserver/graph/resolver.go | 17 - graphqlserver/graph/schema.graphqls | 327 - graphqlserver/graph/schema.resolvers.go | 1040 -- graphqlserver/graph/utils.go | 158 - graphqlserver/server.go | 70 - steps-to-test.txt | 164 - 12 files changed, 22278 deletions(-) delete mode 100644 Dockerfile delete mode 100644 docker-compose.yaml delete mode 100644 dockerfiles/graphqlserver/Dockerfile delete mode 100644 graphqlserver/gqlgen.yml delete mode 100644 graphqlserver/graph/generated.go delete mode 100644 graphqlserver/graph/model/models_gen.go delete mode 100644 graphqlserver/graph/resolver.go delete mode 100644 graphqlserver/graph/schema.graphqls delete mode 100644 graphqlserver/graph/schema.resolvers.go delete mode 100644 graphqlserver/graph/utils.go delete mode 100644 graphqlserver/server.go delete mode 100644 steps-to-test.txt diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 740b2c36..00000000 --- a/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM golang:1.19 AS builder -WORKDIR / -COPY ./ ./ - -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o ./build/graphqlserver graphqlserver/server.go - -FROM scratch -COPY --from=builder ./build/graphqlserver server - -USER 65532:65532 -ENTRYPOINT ["/server"] diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index d3271f13..00000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,148 +0,0 @@ -version: '3' - -services: - docker-registry: - image: registry:2 - ports: - - '5001:5000' - volumes: - - ./docker-registry-config.yaml:/etc/docker/registry/config.yml - networks: - - ch_ntw - - ch_server: - image: clickhouse/clickhouse-server:23.6.2.18 - ports: - - '8123:8123' - - '9000:9000' - volumes: - - ./ch_server_db:/var/lib/clickhouse - networks: - - ch_ntw - - nats: - image: nats:latest - command: - - '--jetstream' - - '--http_port' - - '8222' - environment: - NATS_HTTP_PORT_NUMBER: 8222 - expose: - - '4222' - ports: - - '8222:8222' - - '4222:4222' - networks: - - ch_ntw - - grafana: - image: grafana/grafana - ports: - - 3000:3000 - networks: - - ch_ntw - - kubvizagent: - entrypoint: '/k8smetrics_agent' - build: - context: ./ - dockerfile: dockerfiles/agent/kubviz/Dockerfile - restart: always - environment: - NATS_TOKEN: 'UfmrJOYwYCCsgQvxvcfJ3BdI6c8WBbnD' - NATS_ADDRESS: 'nats://nats:4222' - CLUSTER_NAME: 'Kubviz' - CONFIG_LOCATION: '/etc/myapp/civo' - # ports: - # - '8090:8090' - deploy: - resources: - limits: - cpus: '0.50' - memory: 256M - reservations: - cpus: '0.25' - memory: 64M - networks: - - ch_ntw - - gitagent: - entrypoint: '/agent' - build: - context: ./ - dockerfile: dockerfiles/agent/git/Dockerfile - restart: always - environment: - NATS_TOKEN: 'UfmrJOYwYCCsgQvxvcfJ3BdI6c8WBbnD' - NATS_ADDRESS: 'nats://nats:4222' - CLUSTER_NAME: 'Kubviz' - PORT: '8090' - ports: - - '8090:8090' - deploy: - resources: - limits: - cpus: '0.50' - memory: 256M - reservations: - cpus: '0.25' - memory: 64M - networks: - - ch_ntw - - containeragent: - entrypoint: '/agent' - build: - context: ./ - dockerfile: dockerfiles/agent/container/Dockerfile - restart: always - environment: - NATS_TOKEN: 'UfmrJOYwYCCsgQvxvcfJ3BdI6c8WBbnD' - NATS_ADDRESS: 'nats://nats:4222' - CLUSTER_NAME: 'Kubviz' - PORT: '8091' - ports: - - '8091:8091' - deploy: - resources: - limits: - cpus: '0.50' - memory: 256M - reservations: - cpus: '0.25' - memory: 64M - networks: - - ch_ntw - - client: - entrypoint: '/k8smetrics_client' - build: - context: ./ - dockerfile: dockerfiles/client/Dockerfile - restart: always - environment: - NATS_TOKEN: 'UfmrJOYwYCCsgQvxvcfJ3BdI6c8WBbnD' - NATS_ADDRESS: 'nats://nats:4222' - DB_ADDRESS: 'ch_server' - DB_PORT: '9000' - depends_on: - - containeragent - - gitagent - - kubvizagent - # ports: - # - '8091:8091' - deploy: - resources: - limits: - cpus: '0.50' - memory: 256M - reservations: - cpus: '0.25' - memory: 64M - networks: - - ch_ntw - -networks: - ch_ntw: - driver: bridge diff --git a/dockerfiles/graphqlserver/Dockerfile b/dockerfiles/graphqlserver/Dockerfile deleted file mode 100644 index 740b2c36..00000000 --- a/dockerfiles/graphqlserver/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM golang:1.19 AS builder -WORKDIR / -COPY ./ ./ - -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o ./build/graphqlserver graphqlserver/server.go - -FROM scratch -COPY --from=builder ./build/graphqlserver server - -USER 65532:65532 -ENTRYPOINT ["/server"] diff --git a/graphqlserver/gqlgen.yml b/graphqlserver/gqlgen.yml deleted file mode 100644 index fcbd0dc5..00000000 --- a/graphqlserver/gqlgen.yml +++ /dev/null @@ -1,87 +0,0 @@ -# Where are all the schema files located? globs are supported eg src/**/*.graphqls -schema: - - graph/*.graphqls - -# Where should the generated server code go? -exec: - filename: graph/generated.go - package: graph - -# Uncomment to enable federation -# federation: -# filename: graph/federation.go -# package: graph - -# Where should any generated models go? -model: - filename: graph/model/models_gen.go - package: model - -# Where should the resolver implementations go? -resolver: - layout: follow-schema - dir: graph - package: graph - filename_template: "{name}.resolvers.go" - # Optional: turn on to not generate template comments above resolvers - # omit_template_comment: false - -# Optional: turn on use ` + "`" + `gqlgen:"fieldName"` + "`" + ` tags in your models -# struct_tag: json - -# Optional: turn on to use []Thing instead of []*Thing -# omit_slice_element_pointers: false - -# Optional: turn on to omit Is() methods to interface and unions -# omit_interface_checks : true - -# Optional: turn on to skip generation of ComplexityRoot struct content and Complexity function -# omit_complexity: false - -# Optional: turn on to not generate any file notice comments in generated files -# omit_gqlgen_file_notice: false - -# Optional: turn on to exclude the gqlgen version in the generated file notice. No effect if `omit_gqlgen_file_notice` is true. -# omit_gqlgen_version_in_file_notice: false - -# Optional: turn off to make struct-type struct fields not use pointers -# e.g. type Thing struct { FieldA OtherThing } instead of { FieldA *OtherThing } -# struct_fields_always_pointers: true - -# Optional: turn off to make resolvers return values instead of pointers for structs -# resolvers_always_return_pointers: true - -# Optional: turn on to return pointers instead of values in unmarshalInput -# return_pointers_in_unmarshalinput: false - -# Optional: wrap nullable input fields with Omittable -# nullable_input_omittable: true - -# Optional: set to speed up generation time by not performing a final validation pass. -# skip_validation: true - -# Optional: set to skip running `go mod tidy` when generating server code -# skip_mod_tidy: true - -# gqlgen will search for any type names in the schema in these go packages -# if they match it will use them, otherwise it will generate them. -autobind: -# - "github.com/intelops/kubviz/graphqlserver/graph/model" - -# This section declares type mapping between the GraphQL and go type systems -# -# The first line in each type will be used as defaults for resolver arguments and -# modelgen, the others will be allowed when binding to fields. Configure them to -# your liking -models: - ID: - model: - - github.com/99designs/gqlgen/graphql.ID - - github.com/99designs/gqlgen/graphql.Int - - github.com/99designs/gqlgen/graphql.Int64 - - github.com/99designs/gqlgen/graphql.Int32 - Int: - model: - - github.com/99designs/gqlgen/graphql.Int - - github.com/99designs/gqlgen/graphql.Int64 - - github.com/99designs/gqlgen/graphql.Int32 diff --git a/graphqlserver/graph/generated.go b/graphqlserver/graph/generated.go deleted file mode 100644 index 7a1d76b0..00000000 --- a/graphqlserver/graph/generated.go +++ /dev/null @@ -1,19952 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package graph - -import ( - "bytes" - "context" - "embed" - "errors" - "fmt" - "strconv" - "sync" - "sync/atomic" - - "github.com/99designs/gqlgen/graphql" - "github.com/99designs/gqlgen/graphql/introspection" - "github.com/intelops/kubviz/graphqlserver/graph/model" - gqlparser "github.com/vektah/gqlparser/v2" - "github.com/vektah/gqlparser/v2/ast" -) - -// region ************************** generated!.gotpl ************************** - -// 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, - } -} - -type Config struct { - Schema *ast.Schema - Resolvers ResolverRoot - Directives DirectiveRoot - Complexity ComplexityRoot -} - -type ResolverRoot interface { - Query() QueryResolver -} - -type DirectiveRoot struct { -} - -type ComplexityRoot struct { - Cluster struct { - Name func(childComplexity int) int - } - - ClusterAPIsCount struct { - ClusterName func(childComplexity int) int - Count func(childComplexity int) int - } - - ClusterDeletedAPICount struct { - ClusterName func(childComplexity int) int - DeletedAPICount func(childComplexity int) int - } - - ClusterDeprecatedAPICount struct { - ClusterName func(childComplexity int) int - DeprecatedAPICount func(childComplexity int) int - } - - ClusterNamespaceMisconfigCount struct { - ClusterName func(childComplexity int) int - MisconfigCount func(childComplexity int) int - Namespace func(childComplexity int) int - } - - ClusterNamespaceOutdatedCount struct { - ClusterName func(childComplexity int) int - Namespace func(childComplexity int) int - OutdatedCount func(childComplexity int) int - } - - ClusterNamespaceResourceCount struct { - ClusterName func(childComplexity int) int - Namespace func(childComplexity int) int - ResourceCount func(childComplexity int) int - } - - ClusterNamespaceVulCount struct { - ClusterName func(childComplexity int) int - Namespace func(childComplexity int) int - VulCount func(childComplexity int) int - } - - DeletedAPI struct { - ClusterName func(childComplexity int) int - Deleted func(childComplexity int) int - EventTime func(childComplexity int) int - ExpiryDate func(childComplexity int) int - Group func(childComplexity int) int - Kind func(childComplexity int) int - Name func(childComplexity int) int - ObjectName func(childComplexity int) int - Scope func(childComplexity int) int - Version func(childComplexity int) int - } - - DeprecatedAPI struct { - ClusterName func(childComplexity int) int - Deprecated func(childComplexity int) int - Description func(childComplexity int) int - EventTime func(childComplexity int) int - ExpiryDate func(childComplexity int) int - Kind func(childComplexity int) int - ObjectName func(childComplexity int) int - Scope func(childComplexity int) int - } - - Event struct { - ClusterName func(childComplexity int) int - Event func(childComplexity int) int - EventTime func(childComplexity int) int - ExpiryDate func(childComplexity int) int - FirstTime func(childComplexity int) int - Host func(childComplexity int) int - ID func(childComplexity int) int - ImageName func(childComplexity int) int - Kind func(childComplexity int) int - LastTime func(childComplexity int) int - Message func(childComplexity int) int - Name func(childComplexity int) int - Namespace func(childComplexity int) int - OpType func(childComplexity int) int - Reason func(childComplexity int) int - } - - GetAllResource struct { - Age func(childComplexity int) int - ClusterName func(childComplexity int) int - EventTime func(childComplexity int) int - ExpiryDate func(childComplexity int) int - Kind func(childComplexity int) int - Namespace func(childComplexity int) int - Resource func(childComplexity int) int - } - - KubeScore struct { - APIVersion func(childComplexity int) int - ClusterName func(childComplexity int) int - Description func(childComplexity int) int - EventTime func(childComplexity int) int - FileName func(childComplexity int) int - FileRow func(childComplexity int) int - ID func(childComplexity int) int - Kind func(childComplexity int) int - Name func(childComplexity int) int - Namespace func(childComplexity int) int - ObjectName func(childComplexity int) int - Path func(childComplexity int) int - Summary func(childComplexity int) int - TargetType func(childComplexity int) int - } - - Kubescore struct { - APIVersion func(childComplexity int) int - ClusterName func(childComplexity int) int - Description func(childComplexity int) int - EventTime func(childComplexity int) int - FileName func(childComplexity int) int - FileRow func(childComplexity int) int - ID func(childComplexity int) int - Kind func(childComplexity int) int - Name func(childComplexity int) int - Namespace func(childComplexity int) int - ObjectName func(childComplexity int) int - Path func(childComplexity int) int - Summary func(childComplexity int) int - TargetType func(childComplexity int) int - } - - Misconfiguration struct { - ClusterName func(childComplexity int) int - EventTime func(childComplexity int) int - ExpiryDate func(childComplexity int) int - ExportedAt func(childComplexity int) int - ID func(childComplexity int) int - Kind func(childComplexity int) int - MisconfigAvdid func(childComplexity int) int - MisconfigDesc func(childComplexity int) int - MisconfigID func(childComplexity int) int - MisconfigMsg func(childComplexity int) int - MisconfigQuery func(childComplexity int) int - MisconfigResolution func(childComplexity int) int - MisconfigSeverity func(childComplexity int) int - MisconfigStatus func(childComplexity int) int - MisconfigTitle func(childComplexity int) int - MisconfigType func(childComplexity int) int - Name func(childComplexity int) int - Namespace func(childComplexity int) int - } - - Namespace struct { - Name func(childComplexity int) int - } - - NamespaceData struct { - KubeScores func(childComplexity int) int - Namespace func(childComplexity int) int - OutdatedImages func(childComplexity int) int - Resources func(childComplexity int) int - } - - OutdatedImage struct { - ClusterName func(childComplexity int) int - CurrentImage func(childComplexity int) int - CurrentTag func(childComplexity int) int - EventTime func(childComplexity int) int - LatestVersion func(childComplexity int) int - Namespace func(childComplexity int) int - Pod func(childComplexity int) int - VersionsBehind func(childComplexity int) int - } - - Query struct { - AllClusterDeletedAPIsCounts func(childComplexity int) int - AllClusterDeprecatedAPIsCounts func(childComplexity int) int - AllClusterNamespaceOutdatedCounts func(childComplexity int) int - AllClusterNamespaceResourceCounts func(childComplexity int) int - AllDeletedAPIs func(childComplexity int) int - AllDeprecatedAPIs func(childComplexity int) int - AllEvents func(childComplexity int) int - AllGetAllResources func(childComplexity int) int - AllKubeScores func(childComplexity int) int - AllRakkess func(childComplexity int) int - AllTrivyImages func(childComplexity int) int - AllTrivyMisconfigs func(childComplexity int) int - AllTrivySBOMs func(childComplexity int) int - AllTrivyVuls func(childComplexity int) int - DeletedAPICount func(childComplexity int, clusterName string) int - DeletedAPIs func(childComplexity int, clusterName string) int - DeprecatedAPICount func(childComplexity int, clusterName string) int - DeprecatedAPIs func(childComplexity int, clusterName string) int - EventsByClusterAndNamespace func(childComplexity int, clusterName string, namespace string) int - GetAllResources func(childComplexity int, clusterName string, namespace string) int - Kubescores func(childComplexity int, clustername string, namespace string) int - Misconfigurations func(childComplexity int, clusterName string, namespace string) int - OutdatedImagesByClusterAndNamespace func(childComplexity int, clusterName string, namespace string) int - OutdatedImagesCount func(childComplexity int, clusterName string, namespace string) int - TrivyImageCount func(childComplexity int, clusterName string) int - TrivyImages func(childComplexity int, clusterName string) int - TrivyMisconfigCount func(childComplexity int, clusterName string, namespace string) int - TrivySBOMs func(childComplexity int, clusterName string) int - TrivyVulCount func(childComplexity int, clusterName string, namespace string) int - UniqueClusters func(childComplexity int) int - UniqueNamespaces func(childComplexity int, clusterName string) int - Vulnerabilities func(childComplexity int, clusterName string, namespace string) int - } - - Rakkess struct { - ClusterName func(childComplexity int) int - Create func(childComplexity int) int - Delete func(childComplexity int) int - EventTime func(childComplexity int) int - ExpiryDate func(childComplexity int) int - List func(childComplexity int) int - Name func(childComplexity int) int - Update func(childComplexity int) int - } - - Resource struct { - Age func(childComplexity int) int - ClusterName func(childComplexity int) int - EventTime func(childComplexity int) int - Kind func(childComplexity int) int - Namespace func(childComplexity int) int - Resource func(childComplexity int) int - } - - TrivyImage struct { - ArtifactName func(childComplexity int) int - ClusterName func(childComplexity int) int - ExpiryDate func(childComplexity int) int - ID func(childComplexity int) int - VulFixedVersion func(childComplexity int) int - VulID func(childComplexity int) int - VulInstalledVersion func(childComplexity int) int - VulLastModifiedDate func(childComplexity int) int - VulPkgID func(childComplexity int) int - VulPkgName func(childComplexity int) int - VulPublishedDate func(childComplexity int) int - VulSeverity func(childComplexity int) int - VulTitle func(childComplexity int) int - } - - TrivyImageCount struct { - ClusterName func(childComplexity int) int - ImageCount func(childComplexity int) int - } - - TrivyMisconfig struct { - ClusterName func(childComplexity int) int - EventTime func(childComplexity int) int - ExpiryDate func(childComplexity int) int - ID func(childComplexity int) int - Kind func(childComplexity int) int - MisconfigAvdid func(childComplexity int) int - MisconfigDesc func(childComplexity int) int - MisconfigID func(childComplexity int) int - MisconfigMsg func(childComplexity int) int - MisconfigQuery func(childComplexity int) int - MisconfigResolution func(childComplexity int) int - MisconfigSeverity func(childComplexity int) int - MisconfigStatus func(childComplexity int) int - MisconfigTitle func(childComplexity int) int - MisconfigType func(childComplexity int) int - Name func(childComplexity int) int - Namespace func(childComplexity int) int - } - - TrivySBOM struct { - BomFormat func(childComplexity int) int - BomRef func(childComplexity int) int - ClusterName func(childComplexity int) int - ExpiryDate func(childComplexity int) int - ID func(childComplexity int) int - ImageName func(childComplexity int) int - PackageName func(childComplexity int) int - PackageURL func(childComplexity int) int - SerialNumber func(childComplexity int) int - Version func(childComplexity int) int - } - - TrivyVul struct { - ClusterName func(childComplexity int) int - ExpiryDate func(childComplexity int) int - ID func(childComplexity int) int - Kind func(childComplexity int) int - Name func(childComplexity int) int - Namespace func(childComplexity int) int - VulFixedVersion func(childComplexity int) int - VulID func(childComplexity int) int - VulInstalledVersion func(childComplexity int) int - VulLastModifiedDate func(childComplexity int) int - VulPkgID func(childComplexity int) int - VulPkgName func(childComplexity int) int - VulPkgPath func(childComplexity int) int - VulPublishedDate func(childComplexity int) int - VulSeverity func(childComplexity int) int - VulTitle func(childComplexity int) int - VulVendorIds func(childComplexity int) int - } - - Vulnerability struct { - ClusterName func(childComplexity int) int - ExpiryDate func(childComplexity int) int - ExportedAt func(childComplexity int) int - ID func(childComplexity int) int - Kind func(childComplexity int) int - Name func(childComplexity int) int - Namespace func(childComplexity int) int - VulFixedVersion func(childComplexity int) int - VulID func(childComplexity int) int - VulInstalledVersion func(childComplexity int) int - VulLastModifiedDate func(childComplexity int) int - VulPkgID func(childComplexity int) int - VulPkgName func(childComplexity int) int - VulPkgPath func(childComplexity int) int - VulPublishedDate func(childComplexity int) int - VulSeverity func(childComplexity int) int - VulTitle func(childComplexity int) int - VulVendorIds func(childComplexity int) int - } -} - -type QueryResolver interface { - AllEvents(ctx context.Context) ([]*model.Event, error) - AllRakkess(ctx context.Context) ([]*model.Rakkess, error) - AllDeprecatedAPIs(ctx context.Context) ([]*model.DeprecatedAPI, error) - AllDeletedAPIs(ctx context.Context) ([]*model.DeletedAPI, error) - AllGetAllResources(ctx context.Context) ([]*model.GetAllResource, error) - AllTrivySBOMs(ctx context.Context) ([]*model.TrivySbom, error) - AllTrivyImages(ctx context.Context) ([]*model.TrivyImage, error) - AllKubeScores(ctx context.Context) ([]*model.Kubescore, error) - AllTrivyVuls(ctx context.Context) ([]*model.TrivyVul, error) - AllTrivyMisconfigs(ctx context.Context) ([]*model.TrivyMisconfig, error) - UniqueNamespaces(ctx context.Context, clusterName string) ([]*model.Namespace, error) - UniqueClusters(ctx context.Context) ([]*model.Cluster, error) - OutdatedImagesByClusterAndNamespace(ctx context.Context, clusterName string, namespace string) ([]*model.OutdatedImage, error) - OutdatedImagesCount(ctx context.Context, clusterName string, namespace string) (int, error) - AllClusterNamespaceOutdatedCounts(ctx context.Context) ([]*model.ClusterNamespaceOutdatedCount, error) - AllClusterDeprecatedAPIsCounts(ctx context.Context) ([]*model.ClusterAPIsCount, error) - AllClusterDeletedAPIsCounts(ctx context.Context) ([]*model.ClusterAPIsCount, error) - AllClusterNamespaceResourceCounts(ctx context.Context) ([]*model.ClusterNamespaceResourceCount, error) - EventsByClusterAndNamespace(ctx context.Context, clusterName string, namespace string) ([]*model.Event, error) - Vulnerabilities(ctx context.Context, clusterName string, namespace string) ([]*model.Vulnerability, error) - Misconfigurations(ctx context.Context, clusterName string, namespace string) ([]*model.Misconfiguration, error) - Kubescores(ctx context.Context, clustername string, namespace string) ([]*model.KubeScore, error) - GetAllResources(ctx context.Context, clusterName string, namespace string) ([]*model.GetAllResource, error) - TrivyImages(ctx context.Context, clusterName string) ([]*model.TrivyImage, error) - DeprecatedAPIs(ctx context.Context, clusterName string) ([]*model.DeprecatedAPI, error) - DeletedAPIs(ctx context.Context, clusterName string) ([]*model.DeletedAPI, error) - TrivySBOMs(ctx context.Context, clusterName string) ([]*model.TrivySbom, error) - TrivyVulCount(ctx context.Context, clusterName string, namespace string) (*model.ClusterNamespaceVulCount, error) - TrivyMisconfigCount(ctx context.Context, clusterName string, namespace string) (*model.ClusterNamespaceMisconfigCount, error) - DeletedAPICount(ctx context.Context, clusterName string) (*model.ClusterDeletedAPICount, error) - TrivyImageCount(ctx context.Context, clusterName string) (*model.TrivyImageCount, error) - DeprecatedAPICount(ctx context.Context, clusterName string) (*model.ClusterDeprecatedAPICount, error) -} - -type executableSchema struct { - schema *ast.Schema - resolvers ResolverRoot - directives DirectiveRoot - complexity ComplexityRoot -} - -func (e *executableSchema) Schema() *ast.Schema { - if e.schema != nil { - return e.schema - } - return parsedSchema -} - -func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { - ec := executionContext{nil, e, 0, 0, nil} - _ = ec - switch typeName + "." + field { - - case "Cluster.name": - if e.complexity.Cluster.Name == nil { - break - } - - return e.complexity.Cluster.Name(childComplexity), true - - case "ClusterAPIsCount.clusterName": - if e.complexity.ClusterAPIsCount.ClusterName == nil { - break - } - - return e.complexity.ClusterAPIsCount.ClusterName(childComplexity), true - - case "ClusterAPIsCount.count": - if e.complexity.ClusterAPIsCount.Count == nil { - break - } - - return e.complexity.ClusterAPIsCount.Count(childComplexity), true - - case "ClusterDeletedAPICount.clusterName": - if e.complexity.ClusterDeletedAPICount.ClusterName == nil { - break - } - - return e.complexity.ClusterDeletedAPICount.ClusterName(childComplexity), true - - case "ClusterDeletedAPICount.deletedAPICount": - if e.complexity.ClusterDeletedAPICount.DeletedAPICount == nil { - break - } - - return e.complexity.ClusterDeletedAPICount.DeletedAPICount(childComplexity), true - - case "ClusterDeprecatedAPICount.clusterName": - if e.complexity.ClusterDeprecatedAPICount.ClusterName == nil { - break - } - - return e.complexity.ClusterDeprecatedAPICount.ClusterName(childComplexity), true - - case "ClusterDeprecatedAPICount.deprecatedAPICount": - if e.complexity.ClusterDeprecatedAPICount.DeprecatedAPICount == nil { - break - } - - return e.complexity.ClusterDeprecatedAPICount.DeprecatedAPICount(childComplexity), true - - case "ClusterNamespaceMisconfigCount.clusterName": - if e.complexity.ClusterNamespaceMisconfigCount.ClusterName == nil { - break - } - - return e.complexity.ClusterNamespaceMisconfigCount.ClusterName(childComplexity), true - - case "ClusterNamespaceMisconfigCount.misconfigCount": - if e.complexity.ClusterNamespaceMisconfigCount.MisconfigCount == nil { - break - } - - return e.complexity.ClusterNamespaceMisconfigCount.MisconfigCount(childComplexity), true - - case "ClusterNamespaceMisconfigCount.namespace": - if e.complexity.ClusterNamespaceMisconfigCount.Namespace == nil { - break - } - - return e.complexity.ClusterNamespaceMisconfigCount.Namespace(childComplexity), true - - case "ClusterNamespaceOutdatedCount.clusterName": - if e.complexity.ClusterNamespaceOutdatedCount.ClusterName == nil { - break - } - - return e.complexity.ClusterNamespaceOutdatedCount.ClusterName(childComplexity), true - - case "ClusterNamespaceOutdatedCount.namespace": - if e.complexity.ClusterNamespaceOutdatedCount.Namespace == nil { - break - } - - return e.complexity.ClusterNamespaceOutdatedCount.Namespace(childComplexity), true - - case "ClusterNamespaceOutdatedCount.outdatedCount": - if e.complexity.ClusterNamespaceOutdatedCount.OutdatedCount == nil { - break - } - - return e.complexity.ClusterNamespaceOutdatedCount.OutdatedCount(childComplexity), true - - case "ClusterNamespaceResourceCount.clusterName": - if e.complexity.ClusterNamespaceResourceCount.ClusterName == nil { - break - } - - return e.complexity.ClusterNamespaceResourceCount.ClusterName(childComplexity), true - - case "ClusterNamespaceResourceCount.namespace": - if e.complexity.ClusterNamespaceResourceCount.Namespace == nil { - break - } - - return e.complexity.ClusterNamespaceResourceCount.Namespace(childComplexity), true - - case "ClusterNamespaceResourceCount.resourceCount": - if e.complexity.ClusterNamespaceResourceCount.ResourceCount == nil { - break - } - - return e.complexity.ClusterNamespaceResourceCount.ResourceCount(childComplexity), true - - case "ClusterNamespaceVulCount.clusterName": - if e.complexity.ClusterNamespaceVulCount.ClusterName == nil { - break - } - - return e.complexity.ClusterNamespaceVulCount.ClusterName(childComplexity), true - - case "ClusterNamespaceVulCount.namespace": - if e.complexity.ClusterNamespaceVulCount.Namespace == nil { - break - } - - return e.complexity.ClusterNamespaceVulCount.Namespace(childComplexity), true - - case "ClusterNamespaceVulCount.vulCount": - if e.complexity.ClusterNamespaceVulCount.VulCount == nil { - break - } - - return e.complexity.ClusterNamespaceVulCount.VulCount(childComplexity), true - - case "DeletedAPI.ClusterName": - if e.complexity.DeletedAPI.ClusterName == nil { - break - } - - return e.complexity.DeletedAPI.ClusterName(childComplexity), true - - case "DeletedAPI.Deleted": - if e.complexity.DeletedAPI.Deleted == nil { - break - } - - return e.complexity.DeletedAPI.Deleted(childComplexity), true - - case "DeletedAPI.EventTime": - if e.complexity.DeletedAPI.EventTime == nil { - break - } - - return e.complexity.DeletedAPI.EventTime(childComplexity), true - - case "DeletedAPI.ExpiryDate": - if e.complexity.DeletedAPI.ExpiryDate == nil { - break - } - - return e.complexity.DeletedAPI.ExpiryDate(childComplexity), true - - case "DeletedAPI.Group": - if e.complexity.DeletedAPI.Group == nil { - break - } - - return e.complexity.DeletedAPI.Group(childComplexity), true - - case "DeletedAPI.Kind": - if e.complexity.DeletedAPI.Kind == nil { - break - } - - return e.complexity.DeletedAPI.Kind(childComplexity), true - - case "DeletedAPI.Name": - if e.complexity.DeletedAPI.Name == nil { - break - } - - return e.complexity.DeletedAPI.Name(childComplexity), true - - case "DeletedAPI.ObjectName": - if e.complexity.DeletedAPI.ObjectName == nil { - break - } - - return e.complexity.DeletedAPI.ObjectName(childComplexity), true - - case "DeletedAPI.Scope": - if e.complexity.DeletedAPI.Scope == nil { - break - } - - return e.complexity.DeletedAPI.Scope(childComplexity), true - - case "DeletedAPI.Version": - if e.complexity.DeletedAPI.Version == nil { - break - } - - return e.complexity.DeletedAPI.Version(childComplexity), true - - case "DeprecatedAPI.ClusterName": - if e.complexity.DeprecatedAPI.ClusterName == nil { - break - } - - return e.complexity.DeprecatedAPI.ClusterName(childComplexity), true - - case "DeprecatedAPI.Deprecated": - if e.complexity.DeprecatedAPI.Deprecated == nil { - break - } - - return e.complexity.DeprecatedAPI.Deprecated(childComplexity), true - - case "DeprecatedAPI.Description": - if e.complexity.DeprecatedAPI.Description == nil { - break - } - - return e.complexity.DeprecatedAPI.Description(childComplexity), true - - case "DeprecatedAPI.EventTime": - if e.complexity.DeprecatedAPI.EventTime == nil { - break - } - - return e.complexity.DeprecatedAPI.EventTime(childComplexity), true - - case "DeprecatedAPI.ExpiryDate": - if e.complexity.DeprecatedAPI.ExpiryDate == nil { - break - } - - return e.complexity.DeprecatedAPI.ExpiryDate(childComplexity), true - - case "DeprecatedAPI.Kind": - if e.complexity.DeprecatedAPI.Kind == nil { - break - } - - return e.complexity.DeprecatedAPI.Kind(childComplexity), true - - case "DeprecatedAPI.ObjectName": - if e.complexity.DeprecatedAPI.ObjectName == nil { - break - } - - return e.complexity.DeprecatedAPI.ObjectName(childComplexity), true - - case "DeprecatedAPI.Scope": - if e.complexity.DeprecatedAPI.Scope == nil { - break - } - - return e.complexity.DeprecatedAPI.Scope(childComplexity), true - - case "Event.ClusterName": - if e.complexity.Event.ClusterName == nil { - break - } - - return e.complexity.Event.ClusterName(childComplexity), true - - case "Event.Event": - if e.complexity.Event.Event == nil { - break - } - - return e.complexity.Event.Event(childComplexity), true - - case "Event.EventTime": - if e.complexity.Event.EventTime == nil { - break - } - - return e.complexity.Event.EventTime(childComplexity), true - - case "Event.ExpiryDate": - if e.complexity.Event.ExpiryDate == nil { - break - } - - return e.complexity.Event.ExpiryDate(childComplexity), true - - case "Event.FirstTime": - if e.complexity.Event.FirstTime == nil { - break - } - - return e.complexity.Event.FirstTime(childComplexity), true - - case "Event.Host": - if e.complexity.Event.Host == nil { - break - } - - return e.complexity.Event.Host(childComplexity), true - - case "Event.Id": - if e.complexity.Event.ID == nil { - break - } - - return e.complexity.Event.ID(childComplexity), true - - case "Event.ImageName": - if e.complexity.Event.ImageName == nil { - break - } - - return e.complexity.Event.ImageName(childComplexity), true - - case "Event.Kind": - if e.complexity.Event.Kind == nil { - break - } - - return e.complexity.Event.Kind(childComplexity), true - - case "Event.LastTime": - if e.complexity.Event.LastTime == nil { - break - } - - return e.complexity.Event.LastTime(childComplexity), true - - case "Event.Message": - if e.complexity.Event.Message == nil { - break - } - - return e.complexity.Event.Message(childComplexity), true - - case "Event.Name": - if e.complexity.Event.Name == nil { - break - } - - return e.complexity.Event.Name(childComplexity), true - - case "Event.Namespace": - if e.complexity.Event.Namespace == nil { - break - } - - return e.complexity.Event.Namespace(childComplexity), true - - case "Event.OpType": - if e.complexity.Event.OpType == nil { - break - } - - return e.complexity.Event.OpType(childComplexity), true - - case "Event.Reason": - if e.complexity.Event.Reason == nil { - break - } - - return e.complexity.Event.Reason(childComplexity), true - - case "GetAllResource.Age": - if e.complexity.GetAllResource.Age == nil { - break - } - - return e.complexity.GetAllResource.Age(childComplexity), true - - case "GetAllResource.ClusterName": - if e.complexity.GetAllResource.ClusterName == nil { - break - } - - return e.complexity.GetAllResource.ClusterName(childComplexity), true - - case "GetAllResource.EventTime": - if e.complexity.GetAllResource.EventTime == nil { - break - } - - return e.complexity.GetAllResource.EventTime(childComplexity), true - - case "GetAllResource.ExpiryDate": - if e.complexity.GetAllResource.ExpiryDate == nil { - break - } - - return e.complexity.GetAllResource.ExpiryDate(childComplexity), true - - case "GetAllResource.Kind": - if e.complexity.GetAllResource.Kind == nil { - break - } - - return e.complexity.GetAllResource.Kind(childComplexity), true - - case "GetAllResource.Namespace": - if e.complexity.GetAllResource.Namespace == nil { - break - } - - return e.complexity.GetAllResource.Namespace(childComplexity), true - - case "GetAllResource.Resource": - if e.complexity.GetAllResource.Resource == nil { - break - } - - return e.complexity.GetAllResource.Resource(childComplexity), true - - case "KubeScore.apiVersion": - if e.complexity.KubeScore.APIVersion == nil { - break - } - - return e.complexity.KubeScore.APIVersion(childComplexity), true - - case "KubeScore.clusterName": - if e.complexity.KubeScore.ClusterName == nil { - break - } - - return e.complexity.KubeScore.ClusterName(childComplexity), true - - case "KubeScore.description": - if e.complexity.KubeScore.Description == nil { - break - } - - return e.complexity.KubeScore.Description(childComplexity), true - - case "KubeScore.eventTime": - if e.complexity.KubeScore.EventTime == nil { - break - } - - return e.complexity.KubeScore.EventTime(childComplexity), true - - case "KubeScore.fileName": - if e.complexity.KubeScore.FileName == nil { - break - } - - return e.complexity.KubeScore.FileName(childComplexity), true - - case "KubeScore.fileRow": - if e.complexity.KubeScore.FileRow == nil { - break - } - - return e.complexity.KubeScore.FileRow(childComplexity), true - - case "KubeScore.id": - if e.complexity.KubeScore.ID == nil { - break - } - - return e.complexity.KubeScore.ID(childComplexity), true - - case "KubeScore.kind": - if e.complexity.KubeScore.Kind == nil { - break - } - - return e.complexity.KubeScore.Kind(childComplexity), true - - case "KubeScore.name": - if e.complexity.KubeScore.Name == nil { - break - } - - return e.complexity.KubeScore.Name(childComplexity), true - - case "KubeScore.namespace": - if e.complexity.KubeScore.Namespace == nil { - break - } - - return e.complexity.KubeScore.Namespace(childComplexity), true - - case "KubeScore.objectName": - if e.complexity.KubeScore.ObjectName == nil { - break - } - - return e.complexity.KubeScore.ObjectName(childComplexity), true - - case "KubeScore.path": - if e.complexity.KubeScore.Path == nil { - break - } - - return e.complexity.KubeScore.Path(childComplexity), true - - case "KubeScore.summary": - if e.complexity.KubeScore.Summary == nil { - break - } - - return e.complexity.KubeScore.Summary(childComplexity), true - - case "KubeScore.targetType": - if e.complexity.KubeScore.TargetType == nil { - break - } - - return e.complexity.KubeScore.TargetType(childComplexity), true - - case "Kubescore.apiVersion": - if e.complexity.Kubescore.APIVersion == nil { - break - } - - return e.complexity.Kubescore.APIVersion(childComplexity), true - - case "Kubescore.clusterName": - if e.complexity.Kubescore.ClusterName == nil { - break - } - - return e.complexity.Kubescore.ClusterName(childComplexity), true - - case "Kubescore.description": - if e.complexity.Kubescore.Description == nil { - break - } - - return e.complexity.Kubescore.Description(childComplexity), true - - case "Kubescore.eventTime": - if e.complexity.Kubescore.EventTime == nil { - break - } - - return e.complexity.Kubescore.EventTime(childComplexity), true - - case "Kubescore.fileName": - if e.complexity.Kubescore.FileName == nil { - break - } - - return e.complexity.Kubescore.FileName(childComplexity), true - - case "Kubescore.fileRow": - if e.complexity.Kubescore.FileRow == nil { - break - } - - return e.complexity.Kubescore.FileRow(childComplexity), true - - case "Kubescore.id": - if e.complexity.Kubescore.ID == nil { - break - } - - return e.complexity.Kubescore.ID(childComplexity), true - - case "Kubescore.kind": - if e.complexity.Kubescore.Kind == nil { - break - } - - return e.complexity.Kubescore.Kind(childComplexity), true - - case "Kubescore.name": - if e.complexity.Kubescore.Name == nil { - break - } - - return e.complexity.Kubescore.Name(childComplexity), true - - case "Kubescore.namespace": - if e.complexity.Kubescore.Namespace == nil { - break - } - - return e.complexity.Kubescore.Namespace(childComplexity), true - - case "Kubescore.objectName": - if e.complexity.Kubescore.ObjectName == nil { - break - } - - return e.complexity.Kubescore.ObjectName(childComplexity), true - - case "Kubescore.path": - if e.complexity.Kubescore.Path == nil { - break - } - - return e.complexity.Kubescore.Path(childComplexity), true - - case "Kubescore.summary": - if e.complexity.Kubescore.Summary == nil { - break - } - - return e.complexity.Kubescore.Summary(childComplexity), true - - case "Kubescore.targetType": - if e.complexity.Kubescore.TargetType == nil { - break - } - - return e.complexity.Kubescore.TargetType(childComplexity), true - - case "Misconfiguration.clusterName": - if e.complexity.Misconfiguration.ClusterName == nil { - break - } - - return e.complexity.Misconfiguration.ClusterName(childComplexity), true - - case "Misconfiguration.eventTime": - if e.complexity.Misconfiguration.EventTime == nil { - break - } - - return e.complexity.Misconfiguration.EventTime(childComplexity), true - - case "Misconfiguration.expiryDate": - if e.complexity.Misconfiguration.ExpiryDate == nil { - break - } - - return e.complexity.Misconfiguration.ExpiryDate(childComplexity), true - - case "Misconfiguration.exportedAt": - if e.complexity.Misconfiguration.ExportedAt == nil { - break - } - - return e.complexity.Misconfiguration.ExportedAt(childComplexity), true - - case "Misconfiguration.id": - if e.complexity.Misconfiguration.ID == nil { - break - } - - return e.complexity.Misconfiguration.ID(childComplexity), true - - case "Misconfiguration.kind": - if e.complexity.Misconfiguration.Kind == nil { - break - } - - return e.complexity.Misconfiguration.Kind(childComplexity), true - - case "Misconfiguration.misconfigAvdid": - if e.complexity.Misconfiguration.MisconfigAvdid == nil { - break - } - - return e.complexity.Misconfiguration.MisconfigAvdid(childComplexity), true - - case "Misconfiguration.misconfigDesc": - if e.complexity.Misconfiguration.MisconfigDesc == nil { - break - } - - return e.complexity.Misconfiguration.MisconfigDesc(childComplexity), true - - case "Misconfiguration.misconfigId": - if e.complexity.Misconfiguration.MisconfigID == nil { - break - } - - return e.complexity.Misconfiguration.MisconfigID(childComplexity), true - - case "Misconfiguration.misconfigMsg": - if e.complexity.Misconfiguration.MisconfigMsg == nil { - break - } - - return e.complexity.Misconfiguration.MisconfigMsg(childComplexity), true - - case "Misconfiguration.misconfigQuery": - if e.complexity.Misconfiguration.MisconfigQuery == nil { - break - } - - return e.complexity.Misconfiguration.MisconfigQuery(childComplexity), true - - case "Misconfiguration.misconfigResolution": - if e.complexity.Misconfiguration.MisconfigResolution == nil { - break - } - - return e.complexity.Misconfiguration.MisconfigResolution(childComplexity), true - - case "Misconfiguration.misconfigSeverity": - if e.complexity.Misconfiguration.MisconfigSeverity == nil { - break - } - - return e.complexity.Misconfiguration.MisconfigSeverity(childComplexity), true - - case "Misconfiguration.misconfigStatus": - if e.complexity.Misconfiguration.MisconfigStatus == nil { - break - } - - return e.complexity.Misconfiguration.MisconfigStatus(childComplexity), true - - case "Misconfiguration.misconfigTitle": - if e.complexity.Misconfiguration.MisconfigTitle == nil { - break - } - - return e.complexity.Misconfiguration.MisconfigTitle(childComplexity), true - - case "Misconfiguration.misconfigType": - if e.complexity.Misconfiguration.MisconfigType == nil { - break - } - - return e.complexity.Misconfiguration.MisconfigType(childComplexity), true - - case "Misconfiguration.name": - if e.complexity.Misconfiguration.Name == nil { - break - } - - return e.complexity.Misconfiguration.Name(childComplexity), true - - case "Misconfiguration.namespace": - if e.complexity.Misconfiguration.Namespace == nil { - break - } - - return e.complexity.Misconfiguration.Namespace(childComplexity), true - - case "Namespace.name": - if e.complexity.Namespace.Name == nil { - break - } - - return e.complexity.Namespace.Name(childComplexity), true - - case "NamespaceData.kubeScores": - if e.complexity.NamespaceData.KubeScores == nil { - break - } - - return e.complexity.NamespaceData.KubeScores(childComplexity), true - - case "NamespaceData.namespace": - if e.complexity.NamespaceData.Namespace == nil { - break - } - - return e.complexity.NamespaceData.Namespace(childComplexity), true - - case "NamespaceData.outdatedImages": - if e.complexity.NamespaceData.OutdatedImages == nil { - break - } - - return e.complexity.NamespaceData.OutdatedImages(childComplexity), true - - case "NamespaceData.resources": - if e.complexity.NamespaceData.Resources == nil { - break - } - - return e.complexity.NamespaceData.Resources(childComplexity), true - - case "OutdatedImage.clusterName": - if e.complexity.OutdatedImage.ClusterName == nil { - break - } - - return e.complexity.OutdatedImage.ClusterName(childComplexity), true - - case "OutdatedImage.currentImage": - if e.complexity.OutdatedImage.CurrentImage == nil { - break - } - - return e.complexity.OutdatedImage.CurrentImage(childComplexity), true - - case "OutdatedImage.currentTag": - if e.complexity.OutdatedImage.CurrentTag == nil { - break - } - - return e.complexity.OutdatedImage.CurrentTag(childComplexity), true - - case "OutdatedImage.eventTime": - if e.complexity.OutdatedImage.EventTime == nil { - break - } - - return e.complexity.OutdatedImage.EventTime(childComplexity), true - - case "OutdatedImage.latestVersion": - if e.complexity.OutdatedImage.LatestVersion == nil { - break - } - - return e.complexity.OutdatedImage.LatestVersion(childComplexity), true - - case "OutdatedImage.namespace": - if e.complexity.OutdatedImage.Namespace == nil { - break - } - - return e.complexity.OutdatedImage.Namespace(childComplexity), true - - case "OutdatedImage.pod": - if e.complexity.OutdatedImage.Pod == nil { - break - } - - return e.complexity.OutdatedImage.Pod(childComplexity), true - - case "OutdatedImage.versionsBehind": - if e.complexity.OutdatedImage.VersionsBehind == nil { - break - } - - return e.complexity.OutdatedImage.VersionsBehind(childComplexity), true - - case "Query.allClusterDeletedAPIsCounts": - if e.complexity.Query.AllClusterDeletedAPIsCounts == nil { - break - } - - return e.complexity.Query.AllClusterDeletedAPIsCounts(childComplexity), true - - case "Query.allClusterDeprecatedAPIsCounts": - if e.complexity.Query.AllClusterDeprecatedAPIsCounts == nil { - break - } - - return e.complexity.Query.AllClusterDeprecatedAPIsCounts(childComplexity), true - - case "Query.allClusterNamespaceOutdatedCounts": - if e.complexity.Query.AllClusterNamespaceOutdatedCounts == nil { - break - } - - return e.complexity.Query.AllClusterNamespaceOutdatedCounts(childComplexity), true - - case "Query.allClusterNamespaceResourceCounts": - if e.complexity.Query.AllClusterNamespaceResourceCounts == nil { - break - } - - return e.complexity.Query.AllClusterNamespaceResourceCounts(childComplexity), true - - case "Query.allDeletedAPIs": - if e.complexity.Query.AllDeletedAPIs == nil { - break - } - - return e.complexity.Query.AllDeletedAPIs(childComplexity), true - - case "Query.allDeprecatedAPIs": - if e.complexity.Query.AllDeprecatedAPIs == nil { - break - } - - return e.complexity.Query.AllDeprecatedAPIs(childComplexity), true - - case "Query.allEvents": - if e.complexity.Query.AllEvents == nil { - break - } - - return e.complexity.Query.AllEvents(childComplexity), true - - case "Query.allGetAllResources": - if e.complexity.Query.AllGetAllResources == nil { - break - } - - return e.complexity.Query.AllGetAllResources(childComplexity), true - - case "Query.allKubeScores": - if e.complexity.Query.AllKubeScores == nil { - break - } - - return e.complexity.Query.AllKubeScores(childComplexity), true - - case "Query.allRakkess": - if e.complexity.Query.AllRakkess == nil { - break - } - - return e.complexity.Query.AllRakkess(childComplexity), true - - case "Query.allTrivyImages": - if e.complexity.Query.AllTrivyImages == nil { - break - } - - return e.complexity.Query.AllTrivyImages(childComplexity), true - - case "Query.allTrivyMisconfigs": - if e.complexity.Query.AllTrivyMisconfigs == nil { - break - } - - return e.complexity.Query.AllTrivyMisconfigs(childComplexity), true - - case "Query.allTrivySBOMs": - if e.complexity.Query.AllTrivySBOMs == nil { - break - } - - return e.complexity.Query.AllTrivySBOMs(childComplexity), true - - case "Query.allTrivyVuls": - if e.complexity.Query.AllTrivyVuls == nil { - break - } - - return e.complexity.Query.AllTrivyVuls(childComplexity), true - - case "Query.deletedAPICount": - if e.complexity.Query.DeletedAPICount == nil { - break - } - - args, err := ec.field_Query_deletedAPICount_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.DeletedAPICount(childComplexity, args["clusterName"].(string)), true - - case "Query.deletedAPIs": - if e.complexity.Query.DeletedAPIs == nil { - break - } - - args, err := ec.field_Query_deletedAPIs_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.DeletedAPIs(childComplexity, args["clusterName"].(string)), true - - case "Query.deprecatedAPICount": - if e.complexity.Query.DeprecatedAPICount == nil { - break - } - - args, err := ec.field_Query_deprecatedAPICount_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.DeprecatedAPICount(childComplexity, args["clusterName"].(string)), true - - case "Query.deprecatedAPIs": - if e.complexity.Query.DeprecatedAPIs == nil { - break - } - - args, err := ec.field_Query_deprecatedAPIs_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.DeprecatedAPIs(childComplexity, args["clusterName"].(string)), true - - case "Query.eventsByClusterAndNamespace": - if e.complexity.Query.EventsByClusterAndNamespace == nil { - break - } - - args, err := ec.field_Query_eventsByClusterAndNamespace_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.EventsByClusterAndNamespace(childComplexity, args["clusterName"].(string), args["namespace"].(string)), true - - case "Query.getAllResources": - if e.complexity.Query.GetAllResources == nil { - break - } - - args, err := ec.field_Query_getAllResources_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.GetAllResources(childComplexity, args["clusterName"].(string), args["namespace"].(string)), true - - case "Query.kubescores": - if e.complexity.Query.Kubescores == nil { - break - } - - args, err := ec.field_Query_kubescores_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.Kubescores(childComplexity, args["clustername"].(string), args["namespace"].(string)), true - - case "Query.misconfigurations": - if e.complexity.Query.Misconfigurations == nil { - break - } - - args, err := ec.field_Query_misconfigurations_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.Misconfigurations(childComplexity, args["clusterName"].(string), args["namespace"].(string)), true - - case "Query.outdatedImagesByClusterAndNamespace": - if e.complexity.Query.OutdatedImagesByClusterAndNamespace == nil { - break - } - - args, err := ec.field_Query_outdatedImagesByClusterAndNamespace_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.OutdatedImagesByClusterAndNamespace(childComplexity, args["clusterName"].(string), args["namespace"].(string)), true - - case "Query.outdatedImagesCount": - if e.complexity.Query.OutdatedImagesCount == nil { - break - } - - args, err := ec.field_Query_outdatedImagesCount_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.OutdatedImagesCount(childComplexity, args["clusterName"].(string), args["namespace"].(string)), true - - case "Query.trivyImageCount": - if e.complexity.Query.TrivyImageCount == nil { - break - } - - args, err := ec.field_Query_trivyImageCount_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.TrivyImageCount(childComplexity, args["clusterName"].(string)), true - - case "Query.trivyImages": - if e.complexity.Query.TrivyImages == nil { - break - } - - args, err := ec.field_Query_trivyImages_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.TrivyImages(childComplexity, args["clusterName"].(string)), true - - case "Query.trivyMisconfigCount": - if e.complexity.Query.TrivyMisconfigCount == nil { - break - } - - args, err := ec.field_Query_trivyMisconfigCount_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.TrivyMisconfigCount(childComplexity, args["clusterName"].(string), args["namespace"].(string)), true - - case "Query.trivySBOMs": - if e.complexity.Query.TrivySBOMs == nil { - break - } - - args, err := ec.field_Query_trivySBOMs_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.TrivySBOMs(childComplexity, args["clusterName"].(string)), true - - case "Query.trivyVulCount": - if e.complexity.Query.TrivyVulCount == nil { - break - } - - args, err := ec.field_Query_trivyVulCount_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.TrivyVulCount(childComplexity, args["clusterName"].(string), args["namespace"].(string)), true - - case "Query.uniqueClusters": - if e.complexity.Query.UniqueClusters == nil { - break - } - - return e.complexity.Query.UniqueClusters(childComplexity), true - - case "Query.uniqueNamespaces": - if e.complexity.Query.UniqueNamespaces == nil { - break - } - - args, err := ec.field_Query_uniqueNamespaces_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.UniqueNamespaces(childComplexity, args["clusterName"].(string)), true - - case "Query.vulnerabilities": - if e.complexity.Query.Vulnerabilities == nil { - break - } - - args, err := ec.field_Query_vulnerabilities_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.Vulnerabilities(childComplexity, args["clusterName"].(string), args["namespace"].(string)), true - - case "Rakkess.ClusterName": - if e.complexity.Rakkess.ClusterName == nil { - break - } - - return e.complexity.Rakkess.ClusterName(childComplexity), true - - case "Rakkess.Create": - if e.complexity.Rakkess.Create == nil { - break - } - - return e.complexity.Rakkess.Create(childComplexity), true - - case "Rakkess.Delete": - if e.complexity.Rakkess.Delete == nil { - break - } - - return e.complexity.Rakkess.Delete(childComplexity), true - - case "Rakkess.EventTime": - if e.complexity.Rakkess.EventTime == nil { - break - } - - return e.complexity.Rakkess.EventTime(childComplexity), true - - case "Rakkess.ExpiryDate": - if e.complexity.Rakkess.ExpiryDate == nil { - break - } - - return e.complexity.Rakkess.ExpiryDate(childComplexity), true - - case "Rakkess.List": - if e.complexity.Rakkess.List == nil { - break - } - - return e.complexity.Rakkess.List(childComplexity), true - - case "Rakkess.Name": - if e.complexity.Rakkess.Name == nil { - break - } - - return e.complexity.Rakkess.Name(childComplexity), true - - case "Rakkess.Update": - if e.complexity.Rakkess.Update == nil { - break - } - - return e.complexity.Rakkess.Update(childComplexity), true - - case "Resource.age": - if e.complexity.Resource.Age == nil { - break - } - - return e.complexity.Resource.Age(childComplexity), true - - case "Resource.clusterName": - if e.complexity.Resource.ClusterName == nil { - break - } - - return e.complexity.Resource.ClusterName(childComplexity), true - - case "Resource.eventTime": - if e.complexity.Resource.EventTime == nil { - break - } - - return e.complexity.Resource.EventTime(childComplexity), true - - case "Resource.kind": - if e.complexity.Resource.Kind == nil { - break - } - - return e.complexity.Resource.Kind(childComplexity), true - - case "Resource.namespace": - if e.complexity.Resource.Namespace == nil { - break - } - - return e.complexity.Resource.Namespace(childComplexity), true - - case "Resource.resource": - if e.complexity.Resource.Resource == nil { - break - } - - return e.complexity.Resource.Resource(childComplexity), true - - case "TrivyImage.artifactName": - if e.complexity.TrivyImage.ArtifactName == nil { - break - } - - return e.complexity.TrivyImage.ArtifactName(childComplexity), true - - case "TrivyImage.clusterName": - if e.complexity.TrivyImage.ClusterName == nil { - break - } - - return e.complexity.TrivyImage.ClusterName(childComplexity), true - - case "TrivyImage.expiryDate": - if e.complexity.TrivyImage.ExpiryDate == nil { - break - } - - return e.complexity.TrivyImage.ExpiryDate(childComplexity), true - - case "TrivyImage.id": - if e.complexity.TrivyImage.ID == nil { - break - } - - return e.complexity.TrivyImage.ID(childComplexity), true - - case "TrivyImage.vulFixedVersion": - if e.complexity.TrivyImage.VulFixedVersion == nil { - break - } - - return e.complexity.TrivyImage.VulFixedVersion(childComplexity), true - - case "TrivyImage.vulId": - if e.complexity.TrivyImage.VulID == nil { - break - } - - return e.complexity.TrivyImage.VulID(childComplexity), true - - case "TrivyImage.vulInstalledVersion": - if e.complexity.TrivyImage.VulInstalledVersion == nil { - break - } - - return e.complexity.TrivyImage.VulInstalledVersion(childComplexity), true - - case "TrivyImage.vulLastModifiedDate": - if e.complexity.TrivyImage.VulLastModifiedDate == nil { - break - } - - return e.complexity.TrivyImage.VulLastModifiedDate(childComplexity), true - - case "TrivyImage.vulPkgId": - if e.complexity.TrivyImage.VulPkgID == nil { - break - } - - return e.complexity.TrivyImage.VulPkgID(childComplexity), true - - case "TrivyImage.vulPkgName": - if e.complexity.TrivyImage.VulPkgName == nil { - break - } - - return e.complexity.TrivyImage.VulPkgName(childComplexity), true - - case "TrivyImage.vulPublishedDate": - if e.complexity.TrivyImage.VulPublishedDate == nil { - break - } - - return e.complexity.TrivyImage.VulPublishedDate(childComplexity), true - - case "TrivyImage.vulSeverity": - if e.complexity.TrivyImage.VulSeverity == nil { - break - } - - return e.complexity.TrivyImage.VulSeverity(childComplexity), true - - case "TrivyImage.vulTitle": - if e.complexity.TrivyImage.VulTitle == nil { - break - } - - return e.complexity.TrivyImage.VulTitle(childComplexity), true - - case "TrivyImageCount.clusterName": - if e.complexity.TrivyImageCount.ClusterName == nil { - break - } - - return e.complexity.TrivyImageCount.ClusterName(childComplexity), true - - case "TrivyImageCount.ImageCount": - if e.complexity.TrivyImageCount.ImageCount == nil { - break - } - - return e.complexity.TrivyImageCount.ImageCount(childComplexity), true - - case "TrivyMisconfig.clusterName": - if e.complexity.TrivyMisconfig.ClusterName == nil { - break - } - - return e.complexity.TrivyMisconfig.ClusterName(childComplexity), true - - case "TrivyMisconfig.eventTime": - if e.complexity.TrivyMisconfig.EventTime == nil { - break - } - - return e.complexity.TrivyMisconfig.EventTime(childComplexity), true - - case "TrivyMisconfig.expiryDate": - if e.complexity.TrivyMisconfig.ExpiryDate == nil { - break - } - - return e.complexity.TrivyMisconfig.ExpiryDate(childComplexity), true - - case "TrivyMisconfig.id": - if e.complexity.TrivyMisconfig.ID == nil { - break - } - - return e.complexity.TrivyMisconfig.ID(childComplexity), true - - case "TrivyMisconfig.kind": - if e.complexity.TrivyMisconfig.Kind == nil { - break - } - - return e.complexity.TrivyMisconfig.Kind(childComplexity), true - - case "TrivyMisconfig.misconfigAvdid": - if e.complexity.TrivyMisconfig.MisconfigAvdid == nil { - break - } - - return e.complexity.TrivyMisconfig.MisconfigAvdid(childComplexity), true - - case "TrivyMisconfig.misconfigDesc": - if e.complexity.TrivyMisconfig.MisconfigDesc == nil { - break - } - - return e.complexity.TrivyMisconfig.MisconfigDesc(childComplexity), true - - case "TrivyMisconfig.misconfigId": - if e.complexity.TrivyMisconfig.MisconfigID == nil { - break - } - - return e.complexity.TrivyMisconfig.MisconfigID(childComplexity), true - - case "TrivyMisconfig.misconfigMsg": - if e.complexity.TrivyMisconfig.MisconfigMsg == nil { - break - } - - return e.complexity.TrivyMisconfig.MisconfigMsg(childComplexity), true - - case "TrivyMisconfig.misconfigQuery": - if e.complexity.TrivyMisconfig.MisconfigQuery == nil { - break - } - - return e.complexity.TrivyMisconfig.MisconfigQuery(childComplexity), true - - case "TrivyMisconfig.misconfigResolution": - if e.complexity.TrivyMisconfig.MisconfigResolution == nil { - break - } - - return e.complexity.TrivyMisconfig.MisconfigResolution(childComplexity), true - - case "TrivyMisconfig.misconfigSeverity": - if e.complexity.TrivyMisconfig.MisconfigSeverity == nil { - break - } - - return e.complexity.TrivyMisconfig.MisconfigSeverity(childComplexity), true - - case "TrivyMisconfig.misconfigStatus": - if e.complexity.TrivyMisconfig.MisconfigStatus == nil { - break - } - - return e.complexity.TrivyMisconfig.MisconfigStatus(childComplexity), true - - case "TrivyMisconfig.misconfigTitle": - if e.complexity.TrivyMisconfig.MisconfigTitle == nil { - break - } - - return e.complexity.TrivyMisconfig.MisconfigTitle(childComplexity), true - - case "TrivyMisconfig.misconfigType": - if e.complexity.TrivyMisconfig.MisconfigType == nil { - break - } - - return e.complexity.TrivyMisconfig.MisconfigType(childComplexity), true - - case "TrivyMisconfig.name": - if e.complexity.TrivyMisconfig.Name == nil { - break - } - - return e.complexity.TrivyMisconfig.Name(childComplexity), true - - case "TrivyMisconfig.namespace": - if e.complexity.TrivyMisconfig.Namespace == nil { - break - } - - return e.complexity.TrivyMisconfig.Namespace(childComplexity), true - - case "TrivySBOM.bomFormat": - if e.complexity.TrivySBOM.BomFormat == nil { - break - } - - return e.complexity.TrivySBOM.BomFormat(childComplexity), true - - case "TrivySBOM.bomRef": - if e.complexity.TrivySBOM.BomRef == nil { - break - } - - return e.complexity.TrivySBOM.BomRef(childComplexity), true - - case "TrivySBOM.clusterName": - if e.complexity.TrivySBOM.ClusterName == nil { - break - } - - return e.complexity.TrivySBOM.ClusterName(childComplexity), true - - case "TrivySBOM.expiryDate": - if e.complexity.TrivySBOM.ExpiryDate == nil { - break - } - - return e.complexity.TrivySBOM.ExpiryDate(childComplexity), true - - case "TrivySBOM.id": - if e.complexity.TrivySBOM.ID == nil { - break - } - - return e.complexity.TrivySBOM.ID(childComplexity), true - - case "TrivySBOM.imageName": - if e.complexity.TrivySBOM.ImageName == nil { - break - } - - return e.complexity.TrivySBOM.ImageName(childComplexity), true - - case "TrivySBOM.packageName": - if e.complexity.TrivySBOM.PackageName == nil { - break - } - - return e.complexity.TrivySBOM.PackageName(childComplexity), true - - case "TrivySBOM.packageUrl": - if e.complexity.TrivySBOM.PackageURL == nil { - break - } - - return e.complexity.TrivySBOM.PackageURL(childComplexity), true - - case "TrivySBOM.serialNumber": - if e.complexity.TrivySBOM.SerialNumber == nil { - break - } - - return e.complexity.TrivySBOM.SerialNumber(childComplexity), true - - case "TrivySBOM.version": - if e.complexity.TrivySBOM.Version == nil { - break - } - - return e.complexity.TrivySBOM.Version(childComplexity), true - - case "TrivyVul.clusterName": - if e.complexity.TrivyVul.ClusterName == nil { - break - } - - return e.complexity.TrivyVul.ClusterName(childComplexity), true - - case "TrivyVul.expiryDate": - if e.complexity.TrivyVul.ExpiryDate == nil { - break - } - - return e.complexity.TrivyVul.ExpiryDate(childComplexity), true - - case "TrivyVul.id": - if e.complexity.TrivyVul.ID == nil { - break - } - - return e.complexity.TrivyVul.ID(childComplexity), true - - case "TrivyVul.kind": - if e.complexity.TrivyVul.Kind == nil { - break - } - - return e.complexity.TrivyVul.Kind(childComplexity), true - - case "TrivyVul.name": - if e.complexity.TrivyVul.Name == nil { - break - } - - return e.complexity.TrivyVul.Name(childComplexity), true - - case "TrivyVul.namespace": - if e.complexity.TrivyVul.Namespace == nil { - break - } - - return e.complexity.TrivyVul.Namespace(childComplexity), true - - case "TrivyVul.vulFixedVersion": - if e.complexity.TrivyVul.VulFixedVersion == nil { - break - } - - return e.complexity.TrivyVul.VulFixedVersion(childComplexity), true - - case "TrivyVul.vulId": - if e.complexity.TrivyVul.VulID == nil { - break - } - - return e.complexity.TrivyVul.VulID(childComplexity), true - - case "TrivyVul.vulInstalledVersion": - if e.complexity.TrivyVul.VulInstalledVersion == nil { - break - } - - return e.complexity.TrivyVul.VulInstalledVersion(childComplexity), true - - case "TrivyVul.vulLastModifiedDate": - if e.complexity.TrivyVul.VulLastModifiedDate == nil { - break - } - - return e.complexity.TrivyVul.VulLastModifiedDate(childComplexity), true - - case "TrivyVul.vulPkgId": - if e.complexity.TrivyVul.VulPkgID == nil { - break - } - - return e.complexity.TrivyVul.VulPkgID(childComplexity), true - - case "TrivyVul.vulPkgName": - if e.complexity.TrivyVul.VulPkgName == nil { - break - } - - return e.complexity.TrivyVul.VulPkgName(childComplexity), true - - case "TrivyVul.vulPkgPath": - if e.complexity.TrivyVul.VulPkgPath == nil { - break - } - - return e.complexity.TrivyVul.VulPkgPath(childComplexity), true - - case "TrivyVul.vulPublishedDate": - if e.complexity.TrivyVul.VulPublishedDate == nil { - break - } - - return e.complexity.TrivyVul.VulPublishedDate(childComplexity), true - - case "TrivyVul.vulSeverity": - if e.complexity.TrivyVul.VulSeverity == nil { - break - } - - return e.complexity.TrivyVul.VulSeverity(childComplexity), true - - case "TrivyVul.vulTitle": - if e.complexity.TrivyVul.VulTitle == nil { - break - } - - return e.complexity.TrivyVul.VulTitle(childComplexity), true - - case "TrivyVul.vulVendorIds": - if e.complexity.TrivyVul.VulVendorIds == nil { - break - } - - return e.complexity.TrivyVul.VulVendorIds(childComplexity), true - - case "Vulnerability.clusterName": - if e.complexity.Vulnerability.ClusterName == nil { - break - } - - return e.complexity.Vulnerability.ClusterName(childComplexity), true - - case "Vulnerability.expiryDate": - if e.complexity.Vulnerability.ExpiryDate == nil { - break - } - - return e.complexity.Vulnerability.ExpiryDate(childComplexity), true - - case "Vulnerability.exportedAt": - if e.complexity.Vulnerability.ExportedAt == nil { - break - } - - return e.complexity.Vulnerability.ExportedAt(childComplexity), true - - case "Vulnerability.id": - if e.complexity.Vulnerability.ID == nil { - break - } - - return e.complexity.Vulnerability.ID(childComplexity), true - - case "Vulnerability.kind": - if e.complexity.Vulnerability.Kind == nil { - break - } - - return e.complexity.Vulnerability.Kind(childComplexity), true - - case "Vulnerability.name": - if e.complexity.Vulnerability.Name == nil { - break - } - - return e.complexity.Vulnerability.Name(childComplexity), true - - case "Vulnerability.namespace": - if e.complexity.Vulnerability.Namespace == nil { - break - } - - return e.complexity.Vulnerability.Namespace(childComplexity), true - - case "Vulnerability.vulFixedVersion": - if e.complexity.Vulnerability.VulFixedVersion == nil { - break - } - - return e.complexity.Vulnerability.VulFixedVersion(childComplexity), true - - case "Vulnerability.vulId": - if e.complexity.Vulnerability.VulID == nil { - break - } - - return e.complexity.Vulnerability.VulID(childComplexity), true - - case "Vulnerability.vulInstalledVersion": - if e.complexity.Vulnerability.VulInstalledVersion == nil { - break - } - - return e.complexity.Vulnerability.VulInstalledVersion(childComplexity), true - - case "Vulnerability.vulLastModifiedDate": - if e.complexity.Vulnerability.VulLastModifiedDate == nil { - break - } - - return e.complexity.Vulnerability.VulLastModifiedDate(childComplexity), true - - case "Vulnerability.vulPkgId": - if e.complexity.Vulnerability.VulPkgID == nil { - break - } - - return e.complexity.Vulnerability.VulPkgID(childComplexity), true - - case "Vulnerability.vulPkgName": - if e.complexity.Vulnerability.VulPkgName == nil { - break - } - - return e.complexity.Vulnerability.VulPkgName(childComplexity), true - - case "Vulnerability.vulPkgPath": - if e.complexity.Vulnerability.VulPkgPath == nil { - break - } - - return e.complexity.Vulnerability.VulPkgPath(childComplexity), true - - case "Vulnerability.vulPublishedDate": - if e.complexity.Vulnerability.VulPublishedDate == nil { - break - } - - return e.complexity.Vulnerability.VulPublishedDate(childComplexity), true - - case "Vulnerability.vulSeverity": - if e.complexity.Vulnerability.VulSeverity == nil { - break - } - - return e.complexity.Vulnerability.VulSeverity(childComplexity), true - - case "Vulnerability.vulTitle": - if e.complexity.Vulnerability.VulTitle == nil { - break - } - - return e.complexity.Vulnerability.VulTitle(childComplexity), true - - case "Vulnerability.vulVendorIds": - if e.complexity.Vulnerability.VulVendorIds == nil { - break - } - - return e.complexity.Vulnerability.VulVendorIds(childComplexity), true - - } - return 0, false -} - -func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { - rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e, 0, 0, make(chan graphql.DeferredResult)} - inputUnmarshalMap := graphql.BuildUnmarshalerMap() - first := true - - switch rc.Operation.Operation { - case ast.Query: - return func(ctx context.Context) *graphql.Response { - 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 - } - } - var buf bytes.Buffer - data.MarshalGQL(&buf) - response.Data = buf.Bytes() - if atomic.LoadInt32(&ec.deferred) > 0 { - hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 - response.HasNext = &hasNext - } - - return &response - } - - default: - return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) - } -} - -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) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - 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 -} - -//go:embed "schema.graphqls" -var sourcesFS embed.FS - -func sourceData(filename string) string { - data, err := sourcesFS.ReadFile(filename) - if err != nil { - panic(fmt.Sprintf("codegen problem: %s not available", filename)) - } - return string(data) -} - -var sources = []*ast.Source{ - {Name: "schema.graphqls", Input: sourceData("schema.graphqls"), BuiltIn: false}, -} -var parsedSchema = gqlparser.MustLoadSchema(sources...) - -// endregion ************************** generated!.gotpl ************************** - -// region ***************************** args.gotpl ***************************** - -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_deletedAPICount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_deletedAPIs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_deprecatedAPICount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_deprecatedAPIs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_eventsByClusterAndNamespace_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["namespace"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["namespace"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_getAllResources_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["namespace"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["namespace"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_kubescores_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clustername"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clustername")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clustername"] = arg0 - var arg1 string - if tmp, ok := rawArgs["namespace"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["namespace"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_misconfigurations_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["namespace"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["namespace"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_outdatedImagesByClusterAndNamespace_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["namespace"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["namespace"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_outdatedImagesCount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["namespace"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["namespace"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_trivyImageCount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_trivyImages_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_trivyMisconfigCount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["namespace"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["namespace"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_trivySBOMs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_trivyVulCount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["namespace"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["namespace"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_uniqueNamespaces_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_vulnerabilities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["clusterName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["clusterName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["namespace"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["namespace"] = 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{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["includeDeprecated"] = arg0 - return args, nil -} - -func (ec *executionContext) field___Type_fields_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["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["includeDeprecated"] = arg0 - return args, nil -} - -// endregion ***************************** args.gotpl ***************************** - -// region ************************** directives.gotpl ************************** - -// endregion ************************** directives.gotpl ************************** - -// region **************************** field.gotpl ***************************** - -func (ec *executionContext) _Cluster_name(ctx context.Context, field graphql.CollectedField, obj *model.Cluster) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Cluster_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Cluster_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Cluster", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterAPIsCount_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.ClusterAPIsCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterAPIsCount_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterAPIsCount_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterAPIsCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterAPIsCount_count(ctx context.Context, field graphql.CollectedField, obj *model.ClusterAPIsCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterAPIsCount_count(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Count, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterAPIsCount_count(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterAPIsCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterDeletedAPICount_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.ClusterDeletedAPICount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterDeletedAPICount_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterDeletedAPICount_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterDeletedAPICount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterDeletedAPICount_deletedAPICount(ctx context.Context, field graphql.CollectedField, obj *model.ClusterDeletedAPICount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterDeletedAPICount_deletedAPICount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeletedAPICount, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterDeletedAPICount_deletedAPICount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterDeletedAPICount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterDeprecatedAPICount_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.ClusterDeprecatedAPICount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterDeprecatedAPICount_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterDeprecatedAPICount_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterDeprecatedAPICount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterDeprecatedAPICount_deprecatedAPICount(ctx context.Context, field graphql.CollectedField, obj *model.ClusterDeprecatedAPICount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterDeprecatedAPICount_deprecatedAPICount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecatedAPICount, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterDeprecatedAPICount_deprecatedAPICount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterDeprecatedAPICount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceMisconfigCount_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceMisconfigCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceMisconfigCount_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceMisconfigCount_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceMisconfigCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceMisconfigCount_namespace(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceMisconfigCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceMisconfigCount_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceMisconfigCount_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceMisconfigCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceMisconfigCount_misconfigCount(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceMisconfigCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceMisconfigCount_misconfigCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigCount, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceMisconfigCount_misconfigCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceMisconfigCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceOutdatedCount_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceOutdatedCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceOutdatedCount_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceOutdatedCount_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceOutdatedCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceOutdatedCount_namespace(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceOutdatedCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceOutdatedCount_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceOutdatedCount_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceOutdatedCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceOutdatedCount_outdatedCount(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceOutdatedCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceOutdatedCount_outdatedCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OutdatedCount, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceOutdatedCount_outdatedCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceOutdatedCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceResourceCount_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceResourceCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceResourceCount_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceResourceCount_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceResourceCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceResourceCount_namespace(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceResourceCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceResourceCount_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceResourceCount_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceResourceCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceResourceCount_resourceCount(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceResourceCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceResourceCount_resourceCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ResourceCount, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceResourceCount_resourceCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceResourceCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceVulCount_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceVulCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceVulCount_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceVulCount_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceVulCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceVulCount_namespace(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceVulCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceVulCount_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceVulCount_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceVulCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ClusterNamespaceVulCount_vulCount(ctx context.Context, field graphql.CollectedField, obj *model.ClusterNamespaceVulCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ClusterNamespaceVulCount_vulCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulCount, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ClusterNamespaceVulCount_vulCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ClusterNamespaceVulCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeletedAPI_ClusterName(ctx context.Context, field graphql.CollectedField, obj *model.DeletedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeletedAPI_ClusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeletedAPI_ClusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeletedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeletedAPI_ObjectName(ctx context.Context, field graphql.CollectedField, obj *model.DeletedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeletedAPI_ObjectName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeletedAPI_ObjectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeletedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeletedAPI_Group(ctx context.Context, field graphql.CollectedField, obj *model.DeletedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeletedAPI_Group(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Group, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeletedAPI_Group(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeletedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeletedAPI_Kind(ctx context.Context, field graphql.CollectedField, obj *model.DeletedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeletedAPI_Kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeletedAPI_Kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeletedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeletedAPI_Version(ctx context.Context, field graphql.CollectedField, obj *model.DeletedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeletedAPI_Version(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Version, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeletedAPI_Version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeletedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeletedAPI_Name(ctx context.Context, field graphql.CollectedField, obj *model.DeletedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeletedAPI_Name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeletedAPI_Name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeletedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeletedAPI_Deleted(ctx context.Context, field graphql.CollectedField, obj *model.DeletedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeletedAPI_Deleted(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Deleted, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeletedAPI_Deleted(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeletedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeletedAPI_Scope(ctx context.Context, field graphql.CollectedField, obj *model.DeletedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeletedAPI_Scope(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Scope, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeletedAPI_Scope(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeletedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeletedAPI_EventTime(ctx context.Context, field graphql.CollectedField, obj *model.DeletedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeletedAPI_EventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeletedAPI_EventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeletedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeletedAPI_ExpiryDate(ctx context.Context, field graphql.CollectedField, obj *model.DeletedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeletedAPI_ExpiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeletedAPI_ExpiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeletedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeprecatedAPI_ClusterName(ctx context.Context, field graphql.CollectedField, obj *model.DeprecatedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeprecatedAPI_ClusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeprecatedAPI_ClusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeprecatedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeprecatedAPI_ObjectName(ctx context.Context, field graphql.CollectedField, obj *model.DeprecatedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeprecatedAPI_ObjectName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeprecatedAPI_ObjectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeprecatedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeprecatedAPI_Description(ctx context.Context, field graphql.CollectedField, obj *model.DeprecatedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeprecatedAPI_Description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeprecatedAPI_Description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeprecatedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeprecatedAPI_Kind(ctx context.Context, field graphql.CollectedField, obj *model.DeprecatedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeprecatedAPI_Kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeprecatedAPI_Kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeprecatedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeprecatedAPI_Deprecated(ctx context.Context, field graphql.CollectedField, obj *model.DeprecatedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeprecatedAPI_Deprecated(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Deprecated, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeprecatedAPI_Deprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeprecatedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeprecatedAPI_Scope(ctx context.Context, field graphql.CollectedField, obj *model.DeprecatedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeprecatedAPI_Scope(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Scope, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeprecatedAPI_Scope(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeprecatedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeprecatedAPI_EventTime(ctx context.Context, field graphql.CollectedField, obj *model.DeprecatedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeprecatedAPI_EventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeprecatedAPI_EventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeprecatedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DeprecatedAPI_ExpiryDate(ctx context.Context, field graphql.CollectedField, obj *model.DeprecatedAPI) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DeprecatedAPI_ExpiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DeprecatedAPI_ExpiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DeprecatedAPI", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_ClusterName(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_ClusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_ClusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_Id(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_Id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_Id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_EventTime(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_EventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_EventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_OpType(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_OpType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OpType, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_OpType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_Name(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_Name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_Name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_Namespace(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_Namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_Namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_Kind(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_Kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_Kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_Message(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_Message(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Message, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_Message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_Reason(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_Reason(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Reason, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_Reason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_Host(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_Host(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Host, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_Host(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_Event(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_Event(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Event, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_Event(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_ImageName(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_ImageName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ImageName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_ImageName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_FirstTime(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_FirstTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FirstTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_FirstTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_LastTime(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_LastTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.LastTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_LastTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Event_ExpiryDate(ctx context.Context, field graphql.CollectedField, obj *model.Event) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Event_ExpiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Event_ExpiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Event", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _GetAllResource_ClusterName(ctx context.Context, field graphql.CollectedField, obj *model.GetAllResource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GetAllResource_ClusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_GetAllResource_ClusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "GetAllResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _GetAllResource_Namespace(ctx context.Context, field graphql.CollectedField, obj *model.GetAllResource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GetAllResource_Namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_GetAllResource_Namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "GetAllResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _GetAllResource_Kind(ctx context.Context, field graphql.CollectedField, obj *model.GetAllResource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GetAllResource_Kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_GetAllResource_Kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "GetAllResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _GetAllResource_Resource(ctx context.Context, field graphql.CollectedField, obj *model.GetAllResource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GetAllResource_Resource(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Resource, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_GetAllResource_Resource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "GetAllResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _GetAllResource_Age(ctx context.Context, field graphql.CollectedField, obj *model.GetAllResource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GetAllResource_Age(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Age, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_GetAllResource_Age(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "GetAllResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _GetAllResource_EventTime(ctx context.Context, field graphql.CollectedField, obj *model.GetAllResource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GetAllResource_EventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_GetAllResource_EventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "GetAllResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _GetAllResource_ExpiryDate(ctx context.Context, field graphql.CollectedField, obj *model.GetAllResource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GetAllResource_ExpiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_GetAllResource_ExpiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "GetAllResource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_id(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_objectName(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_objectName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_objectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_kind(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_name(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_namespace(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_targetType(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_targetType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TargetType, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_targetType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_description(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_path(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_path(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Path, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_summary(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_summary(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Summary, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_summary(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_fileName(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_fileName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FileName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_fileName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_fileRow(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_fileRow(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FileRow, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_fileRow(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _KubeScore_eventTime(ctx context.Context, field graphql.CollectedField, obj *model.KubeScore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_KubeScore_eventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_KubeScore_eventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "KubeScore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_id(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_objectName(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_objectName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ObjectName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_objectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_kind(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_apiVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_name(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_namespace(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_targetType(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_targetType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TargetType, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_targetType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_description(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_path(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_path(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Path, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_summary(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_summary(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Summary, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_summary(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_fileName(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_fileName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FileName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_fileName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_fileRow(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_fileRow(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FileRow, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_fileRow(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Kubescore_eventTime(ctx context.Context, field graphql.CollectedField, obj *model.Kubescore) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Kubescore_eventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Kubescore_eventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Kubescore", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_id(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_namespace(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_kind(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_name(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_misconfigId(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_misconfigId(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_misconfigId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_misconfigAvdid(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_misconfigAvdid(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigAvdid, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_misconfigAvdid(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_misconfigType(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_misconfigType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigType, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_misconfigType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_misconfigTitle(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_misconfigTitle(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigTitle, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_misconfigTitle(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_misconfigDesc(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_misconfigDesc(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigDesc, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_misconfigDesc(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_misconfigMsg(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_misconfigMsg(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigMsg, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_misconfigMsg(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_misconfigQuery(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_misconfigQuery(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigQuery, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_misconfigQuery(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_misconfigResolution(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_misconfigResolution(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigResolution, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_misconfigResolution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_misconfigSeverity(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_misconfigSeverity(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigSeverity, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_misconfigSeverity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_misconfigStatus(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_misconfigStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_misconfigStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_eventTime(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_eventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_eventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_expiryDate(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_expiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_expiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Misconfiguration_exportedAt(ctx context.Context, field graphql.CollectedField, obj *model.Misconfiguration) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Misconfiguration_exportedAt(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExportedAt, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Misconfiguration_exportedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Misconfiguration", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Namespace_name(ctx context.Context, field graphql.CollectedField, obj *model.Namespace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Namespace_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Namespace_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Namespace", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _NamespaceData_namespace(ctx context.Context, field graphql.CollectedField, obj *model.NamespaceData) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NamespaceData_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_NamespaceData_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NamespaceData", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _NamespaceData_outdatedImages(ctx context.Context, field graphql.CollectedField, obj *model.NamespaceData) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NamespaceData_outdatedImages(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OutdatedImages, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.OutdatedImage) - fc.Result = res - return ec.marshalNOutdatedImage2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐOutdatedImageᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_NamespaceData_outdatedImages(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NamespaceData", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_OutdatedImage_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_OutdatedImage_namespace(ctx, field) - case "pod": - return ec.fieldContext_OutdatedImage_pod(ctx, field) - case "currentImage": - return ec.fieldContext_OutdatedImage_currentImage(ctx, field) - case "currentTag": - return ec.fieldContext_OutdatedImage_currentTag(ctx, field) - case "latestVersion": - return ec.fieldContext_OutdatedImage_latestVersion(ctx, field) - case "versionsBehind": - return ec.fieldContext_OutdatedImage_versionsBehind(ctx, field) - case "eventTime": - return ec.fieldContext_OutdatedImage_eventTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OutdatedImage", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _NamespaceData_kubeScores(ctx context.Context, field graphql.CollectedField, obj *model.NamespaceData) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NamespaceData_kubeScores(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.KubeScores, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.KubeScore) - fc.Result = res - return ec.marshalNKubeScore2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐKubeScoreᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_NamespaceData_kubeScores(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NamespaceData", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_KubeScore_id(ctx, field) - case "clusterName": - return ec.fieldContext_KubeScore_clusterName(ctx, field) - case "objectName": - return ec.fieldContext_KubeScore_objectName(ctx, field) - case "kind": - return ec.fieldContext_KubeScore_kind(ctx, field) - case "apiVersion": - return ec.fieldContext_KubeScore_apiVersion(ctx, field) - case "name": - return ec.fieldContext_KubeScore_name(ctx, field) - case "namespace": - return ec.fieldContext_KubeScore_namespace(ctx, field) - case "targetType": - return ec.fieldContext_KubeScore_targetType(ctx, field) - case "description": - return ec.fieldContext_KubeScore_description(ctx, field) - case "path": - return ec.fieldContext_KubeScore_path(ctx, field) - case "summary": - return ec.fieldContext_KubeScore_summary(ctx, field) - case "fileName": - return ec.fieldContext_KubeScore_fileName(ctx, field) - case "fileRow": - return ec.fieldContext_KubeScore_fileRow(ctx, field) - case "eventTime": - return ec.fieldContext_KubeScore_eventTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type KubeScore", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _NamespaceData_resources(ctx context.Context, field graphql.CollectedField, obj *model.NamespaceData) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NamespaceData_resources(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Resources, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Resource) - fc.Result = res - return ec.marshalNResource2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐResourceᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_NamespaceData_resources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "NamespaceData", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_Resource_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_Resource_namespace(ctx, field) - case "kind": - return ec.fieldContext_Resource_kind(ctx, field) - case "resource": - return ec.fieldContext_Resource_resource(ctx, field) - case "age": - return ec.fieldContext_Resource_age(ctx, field) - case "eventTime": - return ec.fieldContext_Resource_eventTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Resource", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _OutdatedImage_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.OutdatedImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OutdatedImage_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OutdatedImage_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OutdatedImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _OutdatedImage_namespace(ctx context.Context, field graphql.CollectedField, obj *model.OutdatedImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OutdatedImage_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OutdatedImage_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OutdatedImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _OutdatedImage_pod(ctx context.Context, field graphql.CollectedField, obj *model.OutdatedImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OutdatedImage_pod(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Pod, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OutdatedImage_pod(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OutdatedImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _OutdatedImage_currentImage(ctx context.Context, field graphql.CollectedField, obj *model.OutdatedImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OutdatedImage_currentImage(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CurrentImage, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OutdatedImage_currentImage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OutdatedImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _OutdatedImage_currentTag(ctx context.Context, field graphql.CollectedField, obj *model.OutdatedImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OutdatedImage_currentTag(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CurrentTag, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OutdatedImage_currentTag(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OutdatedImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _OutdatedImage_latestVersion(ctx context.Context, field graphql.CollectedField, obj *model.OutdatedImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OutdatedImage_latestVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.LatestVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OutdatedImage_latestVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OutdatedImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _OutdatedImage_versionsBehind(ctx context.Context, field graphql.CollectedField, obj *model.OutdatedImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OutdatedImage_versionsBehind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VersionsBehind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OutdatedImage_versionsBehind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OutdatedImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _OutdatedImage_eventTime(ctx context.Context, field graphql.CollectedField, obj *model.OutdatedImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OutdatedImage_eventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OutdatedImage_eventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OutdatedImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allEvents(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allEvents(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllEvents(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Event) - fc.Result = res - return ec.marshalNEvent2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐEventᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allEvents(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ClusterName": - return ec.fieldContext_Event_ClusterName(ctx, field) - case "Id": - return ec.fieldContext_Event_Id(ctx, field) - case "EventTime": - return ec.fieldContext_Event_EventTime(ctx, field) - case "OpType": - return ec.fieldContext_Event_OpType(ctx, field) - case "Name": - return ec.fieldContext_Event_Name(ctx, field) - case "Namespace": - return ec.fieldContext_Event_Namespace(ctx, field) - case "Kind": - return ec.fieldContext_Event_Kind(ctx, field) - case "Message": - return ec.fieldContext_Event_Message(ctx, field) - case "Reason": - return ec.fieldContext_Event_Reason(ctx, field) - case "Host": - return ec.fieldContext_Event_Host(ctx, field) - case "Event": - return ec.fieldContext_Event_Event(ctx, field) - case "ImageName": - return ec.fieldContext_Event_ImageName(ctx, field) - case "FirstTime": - return ec.fieldContext_Event_FirstTime(ctx, field) - case "LastTime": - return ec.fieldContext_Event_LastTime(ctx, field) - case "ExpiryDate": - return ec.fieldContext_Event_ExpiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allRakkess(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allRakkess(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllRakkess(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Rakkess) - fc.Result = res - return ec.marshalNRakkess2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐRakkessᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allRakkess(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ClusterName": - return ec.fieldContext_Rakkess_ClusterName(ctx, field) - case "Name": - return ec.fieldContext_Rakkess_Name(ctx, field) - case "Create": - return ec.fieldContext_Rakkess_Create(ctx, field) - case "Delete": - return ec.fieldContext_Rakkess_Delete(ctx, field) - case "List": - return ec.fieldContext_Rakkess_List(ctx, field) - case "Update": - return ec.fieldContext_Rakkess_Update(ctx, field) - case "EventTime": - return ec.fieldContext_Rakkess_EventTime(ctx, field) - case "ExpiryDate": - return ec.fieldContext_Rakkess_ExpiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Rakkess", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allDeprecatedAPIs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allDeprecatedAPIs(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllDeprecatedAPIs(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.DeprecatedAPI) - fc.Result = res - return ec.marshalNDeprecatedAPI2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐDeprecatedAPIᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allDeprecatedAPIs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ClusterName": - return ec.fieldContext_DeprecatedAPI_ClusterName(ctx, field) - case "ObjectName": - return ec.fieldContext_DeprecatedAPI_ObjectName(ctx, field) - case "Description": - return ec.fieldContext_DeprecatedAPI_Description(ctx, field) - case "Kind": - return ec.fieldContext_DeprecatedAPI_Kind(ctx, field) - case "Deprecated": - return ec.fieldContext_DeprecatedAPI_Deprecated(ctx, field) - case "Scope": - return ec.fieldContext_DeprecatedAPI_Scope(ctx, field) - case "EventTime": - return ec.fieldContext_DeprecatedAPI_EventTime(ctx, field) - case "ExpiryDate": - return ec.fieldContext_DeprecatedAPI_ExpiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type DeprecatedAPI", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allDeletedAPIs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allDeletedAPIs(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllDeletedAPIs(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.DeletedAPI) - fc.Result = res - return ec.marshalNDeletedAPI2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐDeletedAPIᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allDeletedAPIs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ClusterName": - return ec.fieldContext_DeletedAPI_ClusterName(ctx, field) - case "ObjectName": - return ec.fieldContext_DeletedAPI_ObjectName(ctx, field) - case "Group": - return ec.fieldContext_DeletedAPI_Group(ctx, field) - case "Kind": - return ec.fieldContext_DeletedAPI_Kind(ctx, field) - case "Version": - return ec.fieldContext_DeletedAPI_Version(ctx, field) - case "Name": - return ec.fieldContext_DeletedAPI_Name(ctx, field) - case "Deleted": - return ec.fieldContext_DeletedAPI_Deleted(ctx, field) - case "Scope": - return ec.fieldContext_DeletedAPI_Scope(ctx, field) - case "EventTime": - return ec.fieldContext_DeletedAPI_EventTime(ctx, field) - case "ExpiryDate": - return ec.fieldContext_DeletedAPI_ExpiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type DeletedAPI", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allGetAllResources(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allGetAllResources(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllGetAllResources(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.GetAllResource) - fc.Result = res - return ec.marshalNGetAllResource2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐGetAllResourceᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allGetAllResources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ClusterName": - return ec.fieldContext_GetAllResource_ClusterName(ctx, field) - case "Namespace": - return ec.fieldContext_GetAllResource_Namespace(ctx, field) - case "Kind": - return ec.fieldContext_GetAllResource_Kind(ctx, field) - case "Resource": - return ec.fieldContext_GetAllResource_Resource(ctx, field) - case "Age": - return ec.fieldContext_GetAllResource_Age(ctx, field) - case "EventTime": - return ec.fieldContext_GetAllResource_EventTime(ctx, field) - case "ExpiryDate": - return ec.fieldContext_GetAllResource_ExpiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type GetAllResource", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allTrivySBOMs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allTrivySBOMs(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllTrivySBOMs(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.TrivySbom) - fc.Result = res - return ec.marshalNTrivySBOM2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivySbomᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allTrivySBOMs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_TrivySBOM_id(ctx, field) - case "clusterName": - return ec.fieldContext_TrivySBOM_clusterName(ctx, field) - case "imageName": - return ec.fieldContext_TrivySBOM_imageName(ctx, field) - case "packageName": - return ec.fieldContext_TrivySBOM_packageName(ctx, field) - case "packageUrl": - return ec.fieldContext_TrivySBOM_packageUrl(ctx, field) - case "bomRef": - return ec.fieldContext_TrivySBOM_bomRef(ctx, field) - case "serialNumber": - return ec.fieldContext_TrivySBOM_serialNumber(ctx, field) - case "version": - return ec.fieldContext_TrivySBOM_version(ctx, field) - case "bomFormat": - return ec.fieldContext_TrivySBOM_bomFormat(ctx, field) - case "expiryDate": - return ec.fieldContext_TrivySBOM_expiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TrivySBOM", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allTrivyImages(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allTrivyImages(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllTrivyImages(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.TrivyImage) - fc.Result = res - return ec.marshalNTrivyImage2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyImageᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allTrivyImages(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_TrivyImage_id(ctx, field) - case "clusterName": - return ec.fieldContext_TrivyImage_clusterName(ctx, field) - case "artifactName": - return ec.fieldContext_TrivyImage_artifactName(ctx, field) - case "vulId": - return ec.fieldContext_TrivyImage_vulId(ctx, field) - case "vulPkgId": - return ec.fieldContext_TrivyImage_vulPkgId(ctx, field) - case "vulPkgName": - return ec.fieldContext_TrivyImage_vulPkgName(ctx, field) - case "vulInstalledVersion": - return ec.fieldContext_TrivyImage_vulInstalledVersion(ctx, field) - case "vulFixedVersion": - return ec.fieldContext_TrivyImage_vulFixedVersion(ctx, field) - case "vulTitle": - return ec.fieldContext_TrivyImage_vulTitle(ctx, field) - case "vulSeverity": - return ec.fieldContext_TrivyImage_vulSeverity(ctx, field) - case "vulPublishedDate": - return ec.fieldContext_TrivyImage_vulPublishedDate(ctx, field) - case "vulLastModifiedDate": - return ec.fieldContext_TrivyImage_vulLastModifiedDate(ctx, field) - case "expiryDate": - return ec.fieldContext_TrivyImage_expiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TrivyImage", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allKubeScores(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allKubeScores(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllKubeScores(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Kubescore) - fc.Result = res - return ec.marshalNKubescore2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐKubescoreᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allKubeScores(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Kubescore_id(ctx, field) - case "clusterName": - return ec.fieldContext_Kubescore_clusterName(ctx, field) - case "objectName": - return ec.fieldContext_Kubescore_objectName(ctx, field) - case "kind": - return ec.fieldContext_Kubescore_kind(ctx, field) - case "apiVersion": - return ec.fieldContext_Kubescore_apiVersion(ctx, field) - case "name": - return ec.fieldContext_Kubescore_name(ctx, field) - case "namespace": - return ec.fieldContext_Kubescore_namespace(ctx, field) - case "targetType": - return ec.fieldContext_Kubescore_targetType(ctx, field) - case "description": - return ec.fieldContext_Kubescore_description(ctx, field) - case "path": - return ec.fieldContext_Kubescore_path(ctx, field) - case "summary": - return ec.fieldContext_Kubescore_summary(ctx, field) - case "fileName": - return ec.fieldContext_Kubescore_fileName(ctx, field) - case "fileRow": - return ec.fieldContext_Kubescore_fileRow(ctx, field) - case "eventTime": - return ec.fieldContext_Kubescore_eventTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Kubescore", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allTrivyVuls(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allTrivyVuls(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllTrivyVuls(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.TrivyVul) - fc.Result = res - return ec.marshalNTrivyVul2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyVulᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allTrivyVuls(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_TrivyVul_id(ctx, field) - case "clusterName": - return ec.fieldContext_TrivyVul_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_TrivyVul_namespace(ctx, field) - case "kind": - return ec.fieldContext_TrivyVul_kind(ctx, field) - case "name": - return ec.fieldContext_TrivyVul_name(ctx, field) - case "vulId": - return ec.fieldContext_TrivyVul_vulId(ctx, field) - case "vulVendorIds": - return ec.fieldContext_TrivyVul_vulVendorIds(ctx, field) - case "vulPkgId": - return ec.fieldContext_TrivyVul_vulPkgId(ctx, field) - case "vulPkgName": - return ec.fieldContext_TrivyVul_vulPkgName(ctx, field) - case "vulPkgPath": - return ec.fieldContext_TrivyVul_vulPkgPath(ctx, field) - case "vulInstalledVersion": - return ec.fieldContext_TrivyVul_vulInstalledVersion(ctx, field) - case "vulFixedVersion": - return ec.fieldContext_TrivyVul_vulFixedVersion(ctx, field) - case "vulTitle": - return ec.fieldContext_TrivyVul_vulTitle(ctx, field) - case "vulSeverity": - return ec.fieldContext_TrivyVul_vulSeverity(ctx, field) - case "vulPublishedDate": - return ec.fieldContext_TrivyVul_vulPublishedDate(ctx, field) - case "vulLastModifiedDate": - return ec.fieldContext_TrivyVul_vulLastModifiedDate(ctx, field) - case "expiryDate": - return ec.fieldContext_TrivyVul_expiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TrivyVul", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allTrivyMisconfigs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allTrivyMisconfigs(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllTrivyMisconfigs(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.TrivyMisconfig) - fc.Result = res - return ec.marshalNTrivyMisconfig2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyMisconfigᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allTrivyMisconfigs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_TrivyMisconfig_id(ctx, field) - case "clusterName": - return ec.fieldContext_TrivyMisconfig_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_TrivyMisconfig_namespace(ctx, field) - case "kind": - return ec.fieldContext_TrivyMisconfig_kind(ctx, field) - case "name": - return ec.fieldContext_TrivyMisconfig_name(ctx, field) - case "misconfigId": - return ec.fieldContext_TrivyMisconfig_misconfigId(ctx, field) - case "misconfigAvdid": - return ec.fieldContext_TrivyMisconfig_misconfigAvdid(ctx, field) - case "misconfigType": - return ec.fieldContext_TrivyMisconfig_misconfigType(ctx, field) - case "misconfigTitle": - return ec.fieldContext_TrivyMisconfig_misconfigTitle(ctx, field) - case "misconfigDesc": - return ec.fieldContext_TrivyMisconfig_misconfigDesc(ctx, field) - case "misconfigMsg": - return ec.fieldContext_TrivyMisconfig_misconfigMsg(ctx, field) - case "misconfigQuery": - return ec.fieldContext_TrivyMisconfig_misconfigQuery(ctx, field) - case "misconfigResolution": - return ec.fieldContext_TrivyMisconfig_misconfigResolution(ctx, field) - case "misconfigSeverity": - return ec.fieldContext_TrivyMisconfig_misconfigSeverity(ctx, field) - case "misconfigStatus": - return ec.fieldContext_TrivyMisconfig_misconfigStatus(ctx, field) - case "eventTime": - return ec.fieldContext_TrivyMisconfig_eventTime(ctx, field) - case "expiryDate": - return ec.fieldContext_TrivyMisconfig_expiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TrivyMisconfig", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_uniqueNamespaces(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_uniqueNamespaces(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().UniqueNamespaces(rctx, fc.Args["clusterName"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Namespace) - fc.Result = res - return ec.marshalNNamespace2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐNamespaceᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_uniqueNamespaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Namespace_name(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Namespace", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_uniqueNamespaces_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_uniqueClusters(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_uniqueClusters(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().UniqueClusters(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Cluster) - fc.Result = res - return ec.marshalNCluster2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_uniqueClusters(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Cluster_name(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Cluster", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_outdatedImagesByClusterAndNamespace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_outdatedImagesByClusterAndNamespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().OutdatedImagesByClusterAndNamespace(rctx, fc.Args["clusterName"].(string), fc.Args["namespace"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.OutdatedImage) - fc.Result = res - return ec.marshalNOutdatedImage2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐOutdatedImageᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_outdatedImagesByClusterAndNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_OutdatedImage_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_OutdatedImage_namespace(ctx, field) - case "pod": - return ec.fieldContext_OutdatedImage_pod(ctx, field) - case "currentImage": - return ec.fieldContext_OutdatedImage_currentImage(ctx, field) - case "currentTag": - return ec.fieldContext_OutdatedImage_currentTag(ctx, field) - case "latestVersion": - return ec.fieldContext_OutdatedImage_latestVersion(ctx, field) - case "versionsBehind": - return ec.fieldContext_OutdatedImage_versionsBehind(ctx, field) - case "eventTime": - return ec.fieldContext_OutdatedImage_eventTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OutdatedImage", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_outdatedImagesByClusterAndNamespace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_outdatedImagesCount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_outdatedImagesCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().OutdatedImagesCount(rctx, fc.Args["clusterName"].(string), fc.Args["namespace"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_outdatedImagesCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_outdatedImagesCount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_allClusterNamespaceOutdatedCounts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allClusterNamespaceOutdatedCounts(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllClusterNamespaceOutdatedCounts(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.ClusterNamespaceOutdatedCount) - fc.Result = res - return ec.marshalNClusterNamespaceOutdatedCount2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceOutdatedCountᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allClusterNamespaceOutdatedCounts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_ClusterNamespaceOutdatedCount_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_ClusterNamespaceOutdatedCount_namespace(ctx, field) - case "outdatedCount": - return ec.fieldContext_ClusterNamespaceOutdatedCount_outdatedCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ClusterNamespaceOutdatedCount", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allClusterDeprecatedAPIsCounts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allClusterDeprecatedAPIsCounts(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllClusterDeprecatedAPIsCounts(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.ClusterAPIsCount) - fc.Result = res - return ec.marshalNClusterAPIsCount2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterAPIsCountᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allClusterDeprecatedAPIsCounts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_ClusterAPIsCount_clusterName(ctx, field) - case "count": - return ec.fieldContext_ClusterAPIsCount_count(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ClusterAPIsCount", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allClusterDeletedAPIsCounts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allClusterDeletedAPIsCounts(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllClusterDeletedAPIsCounts(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.ClusterAPIsCount) - fc.Result = res - return ec.marshalNClusterAPIsCount2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterAPIsCountᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allClusterDeletedAPIsCounts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_ClusterAPIsCount_clusterName(ctx, field) - case "count": - return ec.fieldContext_ClusterAPIsCount_count(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ClusterAPIsCount", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_allClusterNamespaceResourceCounts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allClusterNamespaceResourceCounts(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllClusterNamespaceResourceCounts(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.ClusterNamespaceResourceCount) - fc.Result = res - return ec.marshalNClusterNamespaceResourceCount2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceResourceCountᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_allClusterNamespaceResourceCounts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_ClusterNamespaceResourceCount_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_ClusterNamespaceResourceCount_namespace(ctx, field) - case "resourceCount": - return ec.fieldContext_ClusterNamespaceResourceCount_resourceCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ClusterNamespaceResourceCount", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_eventsByClusterAndNamespace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_eventsByClusterAndNamespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().EventsByClusterAndNamespace(rctx, fc.Args["clusterName"].(string), fc.Args["namespace"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Event) - fc.Result = res - return ec.marshalNEvent2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐEventᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_eventsByClusterAndNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ClusterName": - return ec.fieldContext_Event_ClusterName(ctx, field) - case "Id": - return ec.fieldContext_Event_Id(ctx, field) - case "EventTime": - return ec.fieldContext_Event_EventTime(ctx, field) - case "OpType": - return ec.fieldContext_Event_OpType(ctx, field) - case "Name": - return ec.fieldContext_Event_Name(ctx, field) - case "Namespace": - return ec.fieldContext_Event_Namespace(ctx, field) - case "Kind": - return ec.fieldContext_Event_Kind(ctx, field) - case "Message": - return ec.fieldContext_Event_Message(ctx, field) - case "Reason": - return ec.fieldContext_Event_Reason(ctx, field) - case "Host": - return ec.fieldContext_Event_Host(ctx, field) - case "Event": - return ec.fieldContext_Event_Event(ctx, field) - case "ImageName": - return ec.fieldContext_Event_ImageName(ctx, field) - case "FirstTime": - return ec.fieldContext_Event_FirstTime(ctx, field) - case "LastTime": - return ec.fieldContext_Event_LastTime(ctx, field) - case "ExpiryDate": - return ec.fieldContext_Event_ExpiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_eventsByClusterAndNamespace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_vulnerabilities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_vulnerabilities(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Vulnerabilities(rctx, fc.Args["clusterName"].(string), fc.Args["namespace"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Vulnerability) - fc.Result = res - return ec.marshalNVulnerability2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐVulnerabilityᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_vulnerabilities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Vulnerability_id(ctx, field) - case "clusterName": - return ec.fieldContext_Vulnerability_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_Vulnerability_namespace(ctx, field) - case "kind": - return ec.fieldContext_Vulnerability_kind(ctx, field) - case "name": - return ec.fieldContext_Vulnerability_name(ctx, field) - case "vulId": - return ec.fieldContext_Vulnerability_vulId(ctx, field) - case "vulVendorIds": - return ec.fieldContext_Vulnerability_vulVendorIds(ctx, field) - case "vulPkgId": - return ec.fieldContext_Vulnerability_vulPkgId(ctx, field) - case "vulPkgName": - return ec.fieldContext_Vulnerability_vulPkgName(ctx, field) - case "vulPkgPath": - return ec.fieldContext_Vulnerability_vulPkgPath(ctx, field) - case "vulInstalledVersion": - return ec.fieldContext_Vulnerability_vulInstalledVersion(ctx, field) - case "vulFixedVersion": - return ec.fieldContext_Vulnerability_vulFixedVersion(ctx, field) - case "vulTitle": - return ec.fieldContext_Vulnerability_vulTitle(ctx, field) - case "vulSeverity": - return ec.fieldContext_Vulnerability_vulSeverity(ctx, field) - case "vulPublishedDate": - return ec.fieldContext_Vulnerability_vulPublishedDate(ctx, field) - case "vulLastModifiedDate": - return ec.fieldContext_Vulnerability_vulLastModifiedDate(ctx, field) - case "expiryDate": - return ec.fieldContext_Vulnerability_expiryDate(ctx, field) - case "exportedAt": - return ec.fieldContext_Vulnerability_exportedAt(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Vulnerability", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_vulnerabilities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_misconfigurations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_misconfigurations(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Misconfigurations(rctx, fc.Args["clusterName"].(string), fc.Args["namespace"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Misconfiguration) - fc.Result = res - return ec.marshalNMisconfiguration2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐMisconfigurationᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_misconfigurations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Misconfiguration_id(ctx, field) - case "clusterName": - return ec.fieldContext_Misconfiguration_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_Misconfiguration_namespace(ctx, field) - case "kind": - return ec.fieldContext_Misconfiguration_kind(ctx, field) - case "name": - return ec.fieldContext_Misconfiguration_name(ctx, field) - case "misconfigId": - return ec.fieldContext_Misconfiguration_misconfigId(ctx, field) - case "misconfigAvdid": - return ec.fieldContext_Misconfiguration_misconfigAvdid(ctx, field) - case "misconfigType": - return ec.fieldContext_Misconfiguration_misconfigType(ctx, field) - case "misconfigTitle": - return ec.fieldContext_Misconfiguration_misconfigTitle(ctx, field) - case "misconfigDesc": - return ec.fieldContext_Misconfiguration_misconfigDesc(ctx, field) - case "misconfigMsg": - return ec.fieldContext_Misconfiguration_misconfigMsg(ctx, field) - case "misconfigQuery": - return ec.fieldContext_Misconfiguration_misconfigQuery(ctx, field) - case "misconfigResolution": - return ec.fieldContext_Misconfiguration_misconfigResolution(ctx, field) - case "misconfigSeverity": - return ec.fieldContext_Misconfiguration_misconfigSeverity(ctx, field) - case "misconfigStatus": - return ec.fieldContext_Misconfiguration_misconfigStatus(ctx, field) - case "eventTime": - return ec.fieldContext_Misconfiguration_eventTime(ctx, field) - case "expiryDate": - return ec.fieldContext_Misconfiguration_expiryDate(ctx, field) - case "exportedAt": - return ec.fieldContext_Misconfiguration_exportedAt(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Misconfiguration", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_misconfigurations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_kubescores(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_kubescores(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Kubescores(rctx, fc.Args["clustername"].(string), fc.Args["namespace"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.KubeScore) - fc.Result = res - return ec.marshalNKubeScore2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐKubeScoreᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_kubescores(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_KubeScore_id(ctx, field) - case "clusterName": - return ec.fieldContext_KubeScore_clusterName(ctx, field) - case "objectName": - return ec.fieldContext_KubeScore_objectName(ctx, field) - case "kind": - return ec.fieldContext_KubeScore_kind(ctx, field) - case "apiVersion": - return ec.fieldContext_KubeScore_apiVersion(ctx, field) - case "name": - return ec.fieldContext_KubeScore_name(ctx, field) - case "namespace": - return ec.fieldContext_KubeScore_namespace(ctx, field) - case "targetType": - return ec.fieldContext_KubeScore_targetType(ctx, field) - case "description": - return ec.fieldContext_KubeScore_description(ctx, field) - case "path": - return ec.fieldContext_KubeScore_path(ctx, field) - case "summary": - return ec.fieldContext_KubeScore_summary(ctx, field) - case "fileName": - return ec.fieldContext_KubeScore_fileName(ctx, field) - case "fileRow": - return ec.fieldContext_KubeScore_fileRow(ctx, field) - case "eventTime": - return ec.fieldContext_KubeScore_eventTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type KubeScore", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_kubescores_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_getAllResources(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_getAllResources(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().GetAllResources(rctx, fc.Args["clusterName"].(string), fc.Args["namespace"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.GetAllResource) - fc.Result = res - return ec.marshalNGetAllResource2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐGetAllResourceᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_getAllResources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ClusterName": - return ec.fieldContext_GetAllResource_ClusterName(ctx, field) - case "Namespace": - return ec.fieldContext_GetAllResource_Namespace(ctx, field) - case "Kind": - return ec.fieldContext_GetAllResource_Kind(ctx, field) - case "Resource": - return ec.fieldContext_GetAllResource_Resource(ctx, field) - case "Age": - return ec.fieldContext_GetAllResource_Age(ctx, field) - case "EventTime": - return ec.fieldContext_GetAllResource_EventTime(ctx, field) - case "ExpiryDate": - return ec.fieldContext_GetAllResource_ExpiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type GetAllResource", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_getAllResources_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_trivyImages(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_trivyImages(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TrivyImages(rctx, fc.Args["clusterName"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.TrivyImage) - fc.Result = res - return ec.marshalNTrivyImage2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyImageᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_trivyImages(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_TrivyImage_id(ctx, field) - case "clusterName": - return ec.fieldContext_TrivyImage_clusterName(ctx, field) - case "artifactName": - return ec.fieldContext_TrivyImage_artifactName(ctx, field) - case "vulId": - return ec.fieldContext_TrivyImage_vulId(ctx, field) - case "vulPkgId": - return ec.fieldContext_TrivyImage_vulPkgId(ctx, field) - case "vulPkgName": - return ec.fieldContext_TrivyImage_vulPkgName(ctx, field) - case "vulInstalledVersion": - return ec.fieldContext_TrivyImage_vulInstalledVersion(ctx, field) - case "vulFixedVersion": - return ec.fieldContext_TrivyImage_vulFixedVersion(ctx, field) - case "vulTitle": - return ec.fieldContext_TrivyImage_vulTitle(ctx, field) - case "vulSeverity": - return ec.fieldContext_TrivyImage_vulSeverity(ctx, field) - case "vulPublishedDate": - return ec.fieldContext_TrivyImage_vulPublishedDate(ctx, field) - case "vulLastModifiedDate": - return ec.fieldContext_TrivyImage_vulLastModifiedDate(ctx, field) - case "expiryDate": - return ec.fieldContext_TrivyImage_expiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TrivyImage", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_trivyImages_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_deprecatedAPIs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_deprecatedAPIs(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().DeprecatedAPIs(rctx, fc.Args["clusterName"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.DeprecatedAPI) - fc.Result = res - return ec.marshalNDeprecatedAPI2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐDeprecatedAPIᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_deprecatedAPIs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ClusterName": - return ec.fieldContext_DeprecatedAPI_ClusterName(ctx, field) - case "ObjectName": - return ec.fieldContext_DeprecatedAPI_ObjectName(ctx, field) - case "Description": - return ec.fieldContext_DeprecatedAPI_Description(ctx, field) - case "Kind": - return ec.fieldContext_DeprecatedAPI_Kind(ctx, field) - case "Deprecated": - return ec.fieldContext_DeprecatedAPI_Deprecated(ctx, field) - case "Scope": - return ec.fieldContext_DeprecatedAPI_Scope(ctx, field) - case "EventTime": - return ec.fieldContext_DeprecatedAPI_EventTime(ctx, field) - case "ExpiryDate": - return ec.fieldContext_DeprecatedAPI_ExpiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type DeprecatedAPI", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_deprecatedAPIs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_deletedAPIs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_deletedAPIs(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().DeletedAPIs(rctx, fc.Args["clusterName"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.DeletedAPI) - fc.Result = res - return ec.marshalNDeletedAPI2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐDeletedAPIᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_deletedAPIs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ClusterName": - return ec.fieldContext_DeletedAPI_ClusterName(ctx, field) - case "ObjectName": - return ec.fieldContext_DeletedAPI_ObjectName(ctx, field) - case "Group": - return ec.fieldContext_DeletedAPI_Group(ctx, field) - case "Kind": - return ec.fieldContext_DeletedAPI_Kind(ctx, field) - case "Version": - return ec.fieldContext_DeletedAPI_Version(ctx, field) - case "Name": - return ec.fieldContext_DeletedAPI_Name(ctx, field) - case "Deleted": - return ec.fieldContext_DeletedAPI_Deleted(ctx, field) - case "Scope": - return ec.fieldContext_DeletedAPI_Scope(ctx, field) - case "EventTime": - return ec.fieldContext_DeletedAPI_EventTime(ctx, field) - case "ExpiryDate": - return ec.fieldContext_DeletedAPI_ExpiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type DeletedAPI", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_deletedAPIs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_trivySBOMs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_trivySBOMs(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TrivySBOMs(rctx, fc.Args["clusterName"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.TrivySbom) - fc.Result = res - return ec.marshalNTrivySBOM2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivySbomᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_trivySBOMs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_TrivySBOM_id(ctx, field) - case "clusterName": - return ec.fieldContext_TrivySBOM_clusterName(ctx, field) - case "imageName": - return ec.fieldContext_TrivySBOM_imageName(ctx, field) - case "packageName": - return ec.fieldContext_TrivySBOM_packageName(ctx, field) - case "packageUrl": - return ec.fieldContext_TrivySBOM_packageUrl(ctx, field) - case "bomRef": - return ec.fieldContext_TrivySBOM_bomRef(ctx, field) - case "serialNumber": - return ec.fieldContext_TrivySBOM_serialNumber(ctx, field) - case "version": - return ec.fieldContext_TrivySBOM_version(ctx, field) - case "bomFormat": - return ec.fieldContext_TrivySBOM_bomFormat(ctx, field) - case "expiryDate": - return ec.fieldContext_TrivySBOM_expiryDate(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TrivySBOM", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_trivySBOMs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_trivyVulCount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_trivyVulCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TrivyVulCount(rctx, fc.Args["clusterName"].(string), fc.Args["namespace"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.ClusterNamespaceVulCount) - fc.Result = res - return ec.marshalNClusterNamespaceVulCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceVulCount(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_trivyVulCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_ClusterNamespaceVulCount_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_ClusterNamespaceVulCount_namespace(ctx, field) - case "vulCount": - return ec.fieldContext_ClusterNamespaceVulCount_vulCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ClusterNamespaceVulCount", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_trivyVulCount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_trivyMisconfigCount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_trivyMisconfigCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TrivyMisconfigCount(rctx, fc.Args["clusterName"].(string), fc.Args["namespace"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.ClusterNamespaceMisconfigCount) - fc.Result = res - return ec.marshalNClusterNamespaceMisconfigCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceMisconfigCount(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_trivyMisconfigCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_ClusterNamespaceMisconfigCount_clusterName(ctx, field) - case "namespace": - return ec.fieldContext_ClusterNamespaceMisconfigCount_namespace(ctx, field) - case "misconfigCount": - return ec.fieldContext_ClusterNamespaceMisconfigCount_misconfigCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ClusterNamespaceMisconfigCount", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_trivyMisconfigCount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_deletedAPICount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_deletedAPICount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().DeletedAPICount(rctx, fc.Args["clusterName"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.ClusterDeletedAPICount) - fc.Result = res - return ec.marshalNClusterDeletedAPICount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterDeletedAPICount(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_deletedAPICount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_ClusterDeletedAPICount_clusterName(ctx, field) - case "deletedAPICount": - return ec.fieldContext_ClusterDeletedAPICount_deletedAPICount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ClusterDeletedAPICount", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_deletedAPICount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_trivyImageCount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_trivyImageCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TrivyImageCount(rctx, fc.Args["clusterName"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.TrivyImageCount) - fc.Result = res - return ec.marshalNTrivyImageCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyImageCount(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_trivyImageCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_TrivyImageCount_clusterName(ctx, field) - case "ImageCount": - return ec.fieldContext_TrivyImageCount_ImageCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TrivyImageCount", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_trivyImageCount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_deprecatedAPICount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_deprecatedAPICount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().DeprecatedAPICount(rctx, fc.Args["clusterName"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.ClusterDeprecatedAPICount) - fc.Result = res - return ec.marshalNClusterDeprecatedAPICount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterDeprecatedAPICount(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_deprecatedAPICount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "clusterName": - return ec.fieldContext_ClusterDeprecatedAPICount_clusterName(ctx, field) - case "deprecatedAPICount": - return ec.fieldContext_ClusterDeprecatedAPICount_deprecatedAPICount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ClusterDeprecatedAPICount", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_deprecatedAPICount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Schema) - fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "description": - return ec.fieldContext___Schema_description(ctx, field) - case "types": - return ec.fieldContext___Schema_types(ctx, field) - case "queryType": - return ec.fieldContext___Schema_queryType(ctx, field) - case "mutationType": - return ec.fieldContext___Schema_mutationType(ctx, field) - case "subscriptionType": - return ec.fieldContext___Schema_subscriptionType(ctx, field) - case "directives": - return ec.fieldContext___Schema_directives(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Rakkess_ClusterName(ctx context.Context, field graphql.CollectedField, obj *model.Rakkess) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Rakkess_ClusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Rakkess_ClusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Rakkess", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Rakkess_Name(ctx context.Context, field graphql.CollectedField, obj *model.Rakkess) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Rakkess_Name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Rakkess_Name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Rakkess", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Rakkess_Create(ctx context.Context, field graphql.CollectedField, obj *model.Rakkess) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Rakkess_Create(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Create, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Rakkess_Create(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Rakkess", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Rakkess_Delete(ctx context.Context, field graphql.CollectedField, obj *model.Rakkess) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Rakkess_Delete(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Delete, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Rakkess_Delete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Rakkess", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Rakkess_List(ctx context.Context, field graphql.CollectedField, obj *model.Rakkess) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Rakkess_List(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.List, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Rakkess_List(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Rakkess", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Rakkess_Update(ctx context.Context, field graphql.CollectedField, obj *model.Rakkess) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Rakkess_Update(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Update, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Rakkess_Update(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Rakkess", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Rakkess_EventTime(ctx context.Context, field graphql.CollectedField, obj *model.Rakkess) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Rakkess_EventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Rakkess_EventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Rakkess", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Rakkess_ExpiryDate(ctx context.Context, field graphql.CollectedField, obj *model.Rakkess) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Rakkess_ExpiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Rakkess_ExpiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Rakkess", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Resource_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.Resource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Resource_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Resource_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Resource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Resource_namespace(ctx context.Context, field graphql.CollectedField, obj *model.Resource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Resource_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Resource_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Resource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Resource_kind(ctx context.Context, field graphql.CollectedField, obj *model.Resource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Resource_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Resource_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Resource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Resource_resource(ctx context.Context, field graphql.CollectedField, obj *model.Resource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Resource_resource(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Resource, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Resource_resource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Resource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Resource_age(ctx context.Context, field graphql.CollectedField, obj *model.Resource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Resource_age(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Age, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Resource_age(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Resource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Resource_eventTime(ctx context.Context, field graphql.CollectedField, obj *model.Resource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Resource_eventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Resource_eventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Resource", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_id(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_artifactName(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_artifactName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ArtifactName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_artifactName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_vulId(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_vulId(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_vulId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_vulPkgId(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_vulPkgId(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPkgID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_vulPkgId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_vulPkgName(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_vulPkgName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPkgName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_vulPkgName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_vulInstalledVersion(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_vulInstalledVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulInstalledVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_vulInstalledVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_vulFixedVersion(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_vulFixedVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulFixedVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_vulFixedVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_vulTitle(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_vulTitle(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulTitle, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_vulTitle(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_vulSeverity(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_vulSeverity(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulSeverity, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_vulSeverity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_vulPublishedDate(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_vulPublishedDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPublishedDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_vulPublishedDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_vulLastModifiedDate(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_vulLastModifiedDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulLastModifiedDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_vulLastModifiedDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImage_expiryDate(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImage_expiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImage_expiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImage", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImageCount_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImageCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImageCount_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImageCount_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImageCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyImageCount_ImageCount(ctx context.Context, field graphql.CollectedField, obj *model.TrivyImageCount) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyImageCount_ImageCount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ImageCount, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyImageCount_ImageCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyImageCount", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_id(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_namespace(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_kind(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_name(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_misconfigId(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_misconfigId(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_misconfigId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_misconfigAvdid(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_misconfigAvdid(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigAvdid, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_misconfigAvdid(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_misconfigType(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_misconfigType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigType, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_misconfigType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_misconfigTitle(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_misconfigTitle(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigTitle, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_misconfigTitle(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_misconfigDesc(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_misconfigDesc(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigDesc, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_misconfigDesc(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_misconfigMsg(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_misconfigMsg(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigMsg, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_misconfigMsg(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_misconfigQuery(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_misconfigQuery(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigQuery, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_misconfigQuery(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_misconfigResolution(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_misconfigResolution(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigResolution, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_misconfigResolution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_misconfigSeverity(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_misconfigSeverity(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigSeverity, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_misconfigSeverity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_misconfigStatus(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_misconfigStatus(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MisconfigStatus, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_misconfigStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_eventTime(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_eventTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EventTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_eventTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyMisconfig_expiryDate(ctx context.Context, field graphql.CollectedField, obj *model.TrivyMisconfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyMisconfig_expiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyMisconfig_expiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyMisconfig", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivySBOM_id(ctx context.Context, field graphql.CollectedField, obj *model.TrivySbom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivySBOM_id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivySBOM_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivySBOM", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivySBOM_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.TrivySbom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivySBOM_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivySBOM_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivySBOM", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivySBOM_imageName(ctx context.Context, field graphql.CollectedField, obj *model.TrivySbom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivySBOM_imageName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ImageName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivySBOM_imageName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivySBOM", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivySBOM_packageName(ctx context.Context, field graphql.CollectedField, obj *model.TrivySbom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivySBOM_packageName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PackageName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivySBOM_packageName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivySBOM", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivySBOM_packageUrl(ctx context.Context, field graphql.CollectedField, obj *model.TrivySbom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivySBOM_packageUrl(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PackageURL, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivySBOM_packageUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivySBOM", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivySBOM_bomRef(ctx context.Context, field graphql.CollectedField, obj *model.TrivySbom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivySBOM_bomRef(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BomRef, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivySBOM_bomRef(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivySBOM", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivySBOM_serialNumber(ctx context.Context, field graphql.CollectedField, obj *model.TrivySbom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivySBOM_serialNumber(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SerialNumber, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivySBOM_serialNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivySBOM", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivySBOM_version(ctx context.Context, field graphql.CollectedField, obj *model.TrivySbom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivySBOM_version(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Version, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivySBOM_version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivySBOM", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivySBOM_bomFormat(ctx context.Context, field graphql.CollectedField, obj *model.TrivySbom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivySBOM_bomFormat(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BomFormat, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivySBOM_bomFormat(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivySBOM", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivySBOM_expiryDate(ctx context.Context, field graphql.CollectedField, obj *model.TrivySbom) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivySBOM_expiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivySBOM_expiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivySBOM", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_id(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_namespace(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_kind(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_name(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulId(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulId(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulVendorIds(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulVendorIds(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulVendorIds, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulVendorIds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulPkgId(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulPkgId(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPkgID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulPkgId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulPkgName(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulPkgName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPkgName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulPkgName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulPkgPath(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulPkgPath(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPkgPath, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulPkgPath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulInstalledVersion(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulInstalledVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulInstalledVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulInstalledVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulFixedVersion(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulFixedVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulFixedVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulFixedVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulTitle(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulTitle(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulTitle, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulTitle(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulSeverity(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulSeverity(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulSeverity, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulSeverity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulPublishedDate(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulPublishedDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPublishedDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulPublishedDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_vulLastModifiedDate(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_vulLastModifiedDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulLastModifiedDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_vulLastModifiedDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TrivyVul_expiryDate(ctx context.Context, field graphql.CollectedField, obj *model.TrivyVul) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TrivyVul_expiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TrivyVul_expiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TrivyVul", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_id(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_clusterName(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_clusterName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_namespace(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_namespace(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Namespace, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_kind(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_name(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulId(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulId(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulVendorIds(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulVendorIds(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulVendorIds, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulVendorIds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulPkgId(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulPkgId(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPkgID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulPkgId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulPkgName(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulPkgName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPkgName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulPkgName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulPkgPath(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulPkgPath(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPkgPath, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulPkgPath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulInstalledVersion(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulInstalledVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulInstalledVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulInstalledVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulFixedVersion(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulFixedVersion(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulFixedVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulFixedVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulTitle(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulTitle(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulTitle, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulTitle(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulSeverity(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulSeverity(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulSeverity, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulSeverity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulPublishedDate(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulPublishedDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulPublishedDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulPublishedDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_vulLastModifiedDate(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_vulLastModifiedDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.VulLastModifiedDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_vulLastModifiedDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_expiryDate(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_expiryDate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_expiryDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Vulnerability_exportedAt(ctx context.Context, field graphql.CollectedField, obj *model.Vulnerability) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Vulnerability_exportedAt(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExportedAt, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Vulnerability_exportedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Vulnerability", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Locations, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Types(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_mutationType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.Directive) - fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Field) - fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Field_name(ctx, field) - case "description": - return ec.fieldContext___Field_description(ctx, field) - case "args": - return ec.fieldContext___Field_args(ctx, field) - case "type": - return ec.fieldContext___Field_type(ctx, field) - case "isDeprecated": - return ec.fieldContext___Field_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___Field_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.EnumValue) - fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___EnumValue_name(ctx, field) - case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_ofType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SpecifiedByURL(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -// endregion **************************** input.gotpl ***************************** - -// region ************************** interface.gotpl *************************** - -// endregion ************************** interface.gotpl *************************** - -// region **************************** object.gotpl **************************** - -var clusterImplementors = []string{"Cluster"} - -func (ec *executionContext) _Cluster(ctx context.Context, sel ast.SelectionSet, obj *model.Cluster) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, clusterImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Cluster") - case "name": - out.Values[i] = ec._Cluster_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var clusterAPIsCountImplementors = []string{"ClusterAPIsCount"} - -func (ec *executionContext) _ClusterAPIsCount(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterAPIsCount) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, clusterAPIsCountImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ClusterAPIsCount") - case "clusterName": - out.Values[i] = ec._ClusterAPIsCount_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "count": - out.Values[i] = ec._ClusterAPIsCount_count(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var clusterDeletedAPICountImplementors = []string{"ClusterDeletedAPICount"} - -func (ec *executionContext) _ClusterDeletedAPICount(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterDeletedAPICount) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, clusterDeletedAPICountImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ClusterDeletedAPICount") - case "clusterName": - out.Values[i] = ec._ClusterDeletedAPICount_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "deletedAPICount": - out.Values[i] = ec._ClusterDeletedAPICount_deletedAPICount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var clusterDeprecatedAPICountImplementors = []string{"ClusterDeprecatedAPICount"} - -func (ec *executionContext) _ClusterDeprecatedAPICount(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterDeprecatedAPICount) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, clusterDeprecatedAPICountImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ClusterDeprecatedAPICount") - case "clusterName": - out.Values[i] = ec._ClusterDeprecatedAPICount_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "deprecatedAPICount": - out.Values[i] = ec._ClusterDeprecatedAPICount_deprecatedAPICount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var clusterNamespaceMisconfigCountImplementors = []string{"ClusterNamespaceMisconfigCount"} - -func (ec *executionContext) _ClusterNamespaceMisconfigCount(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterNamespaceMisconfigCount) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, clusterNamespaceMisconfigCountImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ClusterNamespaceMisconfigCount") - case "clusterName": - out.Values[i] = ec._ClusterNamespaceMisconfigCount_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "namespace": - out.Values[i] = ec._ClusterNamespaceMisconfigCount_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "misconfigCount": - out.Values[i] = ec._ClusterNamespaceMisconfigCount_misconfigCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var clusterNamespaceOutdatedCountImplementors = []string{"ClusterNamespaceOutdatedCount"} - -func (ec *executionContext) _ClusterNamespaceOutdatedCount(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterNamespaceOutdatedCount) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, clusterNamespaceOutdatedCountImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ClusterNamespaceOutdatedCount") - case "clusterName": - out.Values[i] = ec._ClusterNamespaceOutdatedCount_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "namespace": - out.Values[i] = ec._ClusterNamespaceOutdatedCount_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "outdatedCount": - out.Values[i] = ec._ClusterNamespaceOutdatedCount_outdatedCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var clusterNamespaceResourceCountImplementors = []string{"ClusterNamespaceResourceCount"} - -func (ec *executionContext) _ClusterNamespaceResourceCount(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterNamespaceResourceCount) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, clusterNamespaceResourceCountImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ClusterNamespaceResourceCount") - case "clusterName": - out.Values[i] = ec._ClusterNamespaceResourceCount_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "namespace": - out.Values[i] = ec._ClusterNamespaceResourceCount_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "resourceCount": - out.Values[i] = ec._ClusterNamespaceResourceCount_resourceCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var clusterNamespaceVulCountImplementors = []string{"ClusterNamespaceVulCount"} - -func (ec *executionContext) _ClusterNamespaceVulCount(ctx context.Context, sel ast.SelectionSet, obj *model.ClusterNamespaceVulCount) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, clusterNamespaceVulCountImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ClusterNamespaceVulCount") - case "clusterName": - out.Values[i] = ec._ClusterNamespaceVulCount_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "namespace": - out.Values[i] = ec._ClusterNamespaceVulCount_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "vulCount": - out.Values[i] = ec._ClusterNamespaceVulCount_vulCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var deletedAPIImplementors = []string{"DeletedAPI"} - -func (ec *executionContext) _DeletedAPI(ctx context.Context, sel ast.SelectionSet, obj *model.DeletedAPI) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, deletedAPIImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("DeletedAPI") - case "ClusterName": - out.Values[i] = ec._DeletedAPI_ClusterName(ctx, field, obj) - case "ObjectName": - out.Values[i] = ec._DeletedAPI_ObjectName(ctx, field, obj) - case "Group": - out.Values[i] = ec._DeletedAPI_Group(ctx, field, obj) - case "Kind": - out.Values[i] = ec._DeletedAPI_Kind(ctx, field, obj) - case "Version": - out.Values[i] = ec._DeletedAPI_Version(ctx, field, obj) - case "Name": - out.Values[i] = ec._DeletedAPI_Name(ctx, field, obj) - case "Deleted": - out.Values[i] = ec._DeletedAPI_Deleted(ctx, field, obj) - case "Scope": - out.Values[i] = ec._DeletedAPI_Scope(ctx, field, obj) - case "EventTime": - out.Values[i] = ec._DeletedAPI_EventTime(ctx, field, obj) - case "ExpiryDate": - out.Values[i] = ec._DeletedAPI_ExpiryDate(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var deprecatedAPIImplementors = []string{"DeprecatedAPI"} - -func (ec *executionContext) _DeprecatedAPI(ctx context.Context, sel ast.SelectionSet, obj *model.DeprecatedAPI) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, deprecatedAPIImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("DeprecatedAPI") - case "ClusterName": - out.Values[i] = ec._DeprecatedAPI_ClusterName(ctx, field, obj) - case "ObjectName": - out.Values[i] = ec._DeprecatedAPI_ObjectName(ctx, field, obj) - case "Description": - out.Values[i] = ec._DeprecatedAPI_Description(ctx, field, obj) - case "Kind": - out.Values[i] = ec._DeprecatedAPI_Kind(ctx, field, obj) - case "Deprecated": - out.Values[i] = ec._DeprecatedAPI_Deprecated(ctx, field, obj) - case "Scope": - out.Values[i] = ec._DeprecatedAPI_Scope(ctx, field, obj) - case "EventTime": - out.Values[i] = ec._DeprecatedAPI_EventTime(ctx, field, obj) - case "ExpiryDate": - out.Values[i] = ec._DeprecatedAPI_ExpiryDate(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var eventImplementors = []string{"Event"} - -func (ec *executionContext) _Event(ctx context.Context, sel ast.SelectionSet, obj *model.Event) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, eventImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Event") - case "ClusterName": - out.Values[i] = ec._Event_ClusterName(ctx, field, obj) - case "Id": - out.Values[i] = ec._Event_Id(ctx, field, obj) - case "EventTime": - out.Values[i] = ec._Event_EventTime(ctx, field, obj) - case "OpType": - out.Values[i] = ec._Event_OpType(ctx, field, obj) - case "Name": - out.Values[i] = ec._Event_Name(ctx, field, obj) - case "Namespace": - out.Values[i] = ec._Event_Namespace(ctx, field, obj) - case "Kind": - out.Values[i] = ec._Event_Kind(ctx, field, obj) - case "Message": - out.Values[i] = ec._Event_Message(ctx, field, obj) - case "Reason": - out.Values[i] = ec._Event_Reason(ctx, field, obj) - case "Host": - out.Values[i] = ec._Event_Host(ctx, field, obj) - case "Event": - out.Values[i] = ec._Event_Event(ctx, field, obj) - case "ImageName": - out.Values[i] = ec._Event_ImageName(ctx, field, obj) - case "FirstTime": - out.Values[i] = ec._Event_FirstTime(ctx, field, obj) - case "LastTime": - out.Values[i] = ec._Event_LastTime(ctx, field, obj) - case "ExpiryDate": - out.Values[i] = ec._Event_ExpiryDate(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var getAllResourceImplementors = []string{"GetAllResource"} - -func (ec *executionContext) _GetAllResource(ctx context.Context, sel ast.SelectionSet, obj *model.GetAllResource) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, getAllResourceImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("GetAllResource") - case "ClusterName": - out.Values[i] = ec._GetAllResource_ClusterName(ctx, field, obj) - case "Namespace": - out.Values[i] = ec._GetAllResource_Namespace(ctx, field, obj) - case "Kind": - out.Values[i] = ec._GetAllResource_Kind(ctx, field, obj) - case "Resource": - out.Values[i] = ec._GetAllResource_Resource(ctx, field, obj) - case "Age": - out.Values[i] = ec._GetAllResource_Age(ctx, field, obj) - case "EventTime": - out.Values[i] = ec._GetAllResource_EventTime(ctx, field, obj) - case "ExpiryDate": - out.Values[i] = ec._GetAllResource_ExpiryDate(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var kubeScoreImplementors = []string{"KubeScore"} - -func (ec *executionContext) _KubeScore(ctx context.Context, sel ast.SelectionSet, obj *model.KubeScore) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, kubeScoreImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("KubeScore") - case "id": - out.Values[i] = ec._KubeScore_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "clusterName": - out.Values[i] = ec._KubeScore_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "objectName": - out.Values[i] = ec._KubeScore_objectName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "kind": - out.Values[i] = ec._KubeScore_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "apiVersion": - out.Values[i] = ec._KubeScore_apiVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "name": - out.Values[i] = ec._KubeScore_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "namespace": - out.Values[i] = ec._KubeScore_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "targetType": - out.Values[i] = ec._KubeScore_targetType(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "description": - out.Values[i] = ec._KubeScore_description(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "path": - out.Values[i] = ec._KubeScore_path(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "summary": - out.Values[i] = ec._KubeScore_summary(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "fileName": - out.Values[i] = ec._KubeScore_fileName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "fileRow": - out.Values[i] = ec._KubeScore_fileRow(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "eventTime": - out.Values[i] = ec._KubeScore_eventTime(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var kubescoreImplementors = []string{"Kubescore"} - -func (ec *executionContext) _Kubescore(ctx context.Context, sel ast.SelectionSet, obj *model.Kubescore) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, kubescoreImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Kubescore") - case "id": - out.Values[i] = ec._Kubescore_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "clusterName": - out.Values[i] = ec._Kubescore_clusterName(ctx, field, obj) - case "objectName": - out.Values[i] = ec._Kubescore_objectName(ctx, field, obj) - case "kind": - out.Values[i] = ec._Kubescore_kind(ctx, field, obj) - case "apiVersion": - out.Values[i] = ec._Kubescore_apiVersion(ctx, field, obj) - case "name": - out.Values[i] = ec._Kubescore_name(ctx, field, obj) - case "namespace": - out.Values[i] = ec._Kubescore_namespace(ctx, field, obj) - case "targetType": - out.Values[i] = ec._Kubescore_targetType(ctx, field, obj) - case "description": - out.Values[i] = ec._Kubescore_description(ctx, field, obj) - case "path": - out.Values[i] = ec._Kubescore_path(ctx, field, obj) - case "summary": - out.Values[i] = ec._Kubescore_summary(ctx, field, obj) - case "fileName": - out.Values[i] = ec._Kubescore_fileName(ctx, field, obj) - case "fileRow": - out.Values[i] = ec._Kubescore_fileRow(ctx, field, obj) - case "eventTime": - out.Values[i] = ec._Kubescore_eventTime(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var misconfigurationImplementors = []string{"Misconfiguration"} - -func (ec *executionContext) _Misconfiguration(ctx context.Context, sel ast.SelectionSet, obj *model.Misconfiguration) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, misconfigurationImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Misconfiguration") - case "id": - out.Values[i] = ec._Misconfiguration_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "clusterName": - out.Values[i] = ec._Misconfiguration_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "namespace": - out.Values[i] = ec._Misconfiguration_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "kind": - out.Values[i] = ec._Misconfiguration_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "name": - out.Values[i] = ec._Misconfiguration_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "misconfigId": - out.Values[i] = ec._Misconfiguration_misconfigId(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "misconfigAvdid": - out.Values[i] = ec._Misconfiguration_misconfigAvdid(ctx, field, obj) - case "misconfigType": - out.Values[i] = ec._Misconfiguration_misconfigType(ctx, field, obj) - case "misconfigTitle": - out.Values[i] = ec._Misconfiguration_misconfigTitle(ctx, field, obj) - case "misconfigDesc": - out.Values[i] = ec._Misconfiguration_misconfigDesc(ctx, field, obj) - case "misconfigMsg": - out.Values[i] = ec._Misconfiguration_misconfigMsg(ctx, field, obj) - case "misconfigQuery": - out.Values[i] = ec._Misconfiguration_misconfigQuery(ctx, field, obj) - case "misconfigResolution": - out.Values[i] = ec._Misconfiguration_misconfigResolution(ctx, field, obj) - case "misconfigSeverity": - out.Values[i] = ec._Misconfiguration_misconfigSeverity(ctx, field, obj) - case "misconfigStatus": - out.Values[i] = ec._Misconfiguration_misconfigStatus(ctx, field, obj) - case "eventTime": - out.Values[i] = ec._Misconfiguration_eventTime(ctx, field, obj) - case "expiryDate": - out.Values[i] = ec._Misconfiguration_expiryDate(ctx, field, obj) - case "exportedAt": - out.Values[i] = ec._Misconfiguration_exportedAt(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var namespaceImplementors = []string{"Namespace"} - -func (ec *executionContext) _Namespace(ctx context.Context, sel ast.SelectionSet, obj *model.Namespace) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, namespaceImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Namespace") - case "name": - out.Values[i] = ec._Namespace_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var namespaceDataImplementors = []string{"NamespaceData"} - -func (ec *executionContext) _NamespaceData(ctx context.Context, sel ast.SelectionSet, obj *model.NamespaceData) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, namespaceDataImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("NamespaceData") - case "namespace": - out.Values[i] = ec._NamespaceData_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "outdatedImages": - out.Values[i] = ec._NamespaceData_outdatedImages(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "kubeScores": - out.Values[i] = ec._NamespaceData_kubeScores(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "resources": - out.Values[i] = ec._NamespaceData_resources(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var outdatedImageImplementors = []string{"OutdatedImage"} - -func (ec *executionContext) _OutdatedImage(ctx context.Context, sel ast.SelectionSet, obj *model.OutdatedImage) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, outdatedImageImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("OutdatedImage") - case "clusterName": - out.Values[i] = ec._OutdatedImage_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "namespace": - out.Values[i] = ec._OutdatedImage_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "pod": - out.Values[i] = ec._OutdatedImage_pod(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "currentImage": - out.Values[i] = ec._OutdatedImage_currentImage(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "currentTag": - out.Values[i] = ec._OutdatedImage_currentTag(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "latestVersion": - out.Values[i] = ec._OutdatedImage_latestVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "versionsBehind": - out.Values[i] = ec._OutdatedImage_versionsBehind(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "eventTime": - out.Values[i] = ec._OutdatedImage_eventTime(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var queryImplementors = []string{"Query"} - -func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Query", - }) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ - Object: field.Name, - Field: field, - }) - - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Query") - case "allEvents": - field := field - - 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)) - } - }() - res = ec._Query_allEvents(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allRakkess": - field := field - - 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)) - } - }() - res = ec._Query_allRakkess(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allDeprecatedAPIs": - field := field - - 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)) - } - }() - res = ec._Query_allDeprecatedAPIs(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allDeletedAPIs": - field := field - - 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)) - } - }() - res = ec._Query_allDeletedAPIs(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allGetAllResources": - field := field - - 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)) - } - }() - res = ec._Query_allGetAllResources(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allTrivySBOMs": - field := field - - 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)) - } - }() - res = ec._Query_allTrivySBOMs(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allTrivyImages": - field := field - - 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)) - } - }() - res = ec._Query_allTrivyImages(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allKubeScores": - field := field - - 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)) - } - }() - res = ec._Query_allKubeScores(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allTrivyVuls": - field := field - - 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)) - } - }() - res = ec._Query_allTrivyVuls(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allTrivyMisconfigs": - field := field - - 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)) - } - }() - res = ec._Query_allTrivyMisconfigs(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "uniqueNamespaces": - field := field - - 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)) - } - }() - res = ec._Query_uniqueNamespaces(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "uniqueClusters": - field := field - - 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)) - } - }() - res = ec._Query_uniqueClusters(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "outdatedImagesByClusterAndNamespace": - field := field - - 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)) - } - }() - res = ec._Query_outdatedImagesByClusterAndNamespace(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "outdatedImagesCount": - field := field - - 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)) - } - }() - res = ec._Query_outdatedImagesCount(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allClusterNamespaceOutdatedCounts": - field := field - - 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)) - } - }() - res = ec._Query_allClusterNamespaceOutdatedCounts(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allClusterDeprecatedAPIsCounts": - field := field - - 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)) - } - }() - res = ec._Query_allClusterDeprecatedAPIsCounts(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allClusterDeletedAPIsCounts": - field := field - - 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)) - } - }() - res = ec._Query_allClusterDeletedAPIsCounts(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allClusterNamespaceResourceCounts": - field := field - - 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)) - } - }() - res = ec._Query_allClusterNamespaceResourceCounts(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "eventsByClusterAndNamespace": - field := field - - 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)) - } - }() - res = ec._Query_eventsByClusterAndNamespace(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "vulnerabilities": - field := field - - 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)) - } - }() - res = ec._Query_vulnerabilities(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "misconfigurations": - field := field - - 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)) - } - }() - res = ec._Query_misconfigurations(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "kubescores": - field := field - - 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)) - } - }() - res = ec._Query_kubescores(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "getAllResources": - field := field - - 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)) - } - }() - res = ec._Query_getAllResources(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "trivyImages": - field := field - - 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)) - } - }() - res = ec._Query_trivyImages(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "deprecatedAPIs": - field := field - - 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)) - } - }() - res = ec._Query_deprecatedAPIs(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "deletedAPIs": - field := field - - 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)) - } - }() - res = ec._Query_deletedAPIs(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "trivySBOMs": - field := field - - 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)) - } - }() - res = ec._Query_trivySBOMs(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "trivyVulCount": - field := field - - 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)) - } - }() - res = ec._Query_trivyVulCount(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "trivyMisconfigCount": - field := field - - 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)) - } - }() - res = ec._Query_trivyMisconfigCount(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "deletedAPICount": - field := field - - 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)) - } - }() - res = ec._Query_deletedAPICount(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "trivyImageCount": - field := field - - 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)) - } - }() - res = ec._Query_trivyImageCount(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "deprecatedAPICount": - field := field - - 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)) - } - }() - res = ec._Query_deprecatedAPICount(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - 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(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 -} - -var rakkessImplementors = []string{"Rakkess"} - -func (ec *executionContext) _Rakkess(ctx context.Context, sel ast.SelectionSet, obj *model.Rakkess) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, rakkessImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Rakkess") - case "ClusterName": - out.Values[i] = ec._Rakkess_ClusterName(ctx, field, obj) - case "Name": - out.Values[i] = ec._Rakkess_Name(ctx, field, obj) - case "Create": - out.Values[i] = ec._Rakkess_Create(ctx, field, obj) - case "Delete": - out.Values[i] = ec._Rakkess_Delete(ctx, field, obj) - case "List": - out.Values[i] = ec._Rakkess_List(ctx, field, obj) - case "Update": - out.Values[i] = ec._Rakkess_Update(ctx, field, obj) - case "EventTime": - out.Values[i] = ec._Rakkess_EventTime(ctx, field, obj) - case "ExpiryDate": - out.Values[i] = ec._Rakkess_ExpiryDate(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var resourceImplementors = []string{"Resource"} - -func (ec *executionContext) _Resource(ctx context.Context, sel ast.SelectionSet, obj *model.Resource) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, resourceImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Resource") - case "clusterName": - out.Values[i] = ec._Resource_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "namespace": - out.Values[i] = ec._Resource_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "kind": - out.Values[i] = ec._Resource_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "resource": - out.Values[i] = ec._Resource_resource(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "age": - out.Values[i] = ec._Resource_age(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "eventTime": - out.Values[i] = ec._Resource_eventTime(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var trivyImageImplementors = []string{"TrivyImage"} - -func (ec *executionContext) _TrivyImage(ctx context.Context, sel ast.SelectionSet, obj *model.TrivyImage) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, trivyImageImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TrivyImage") - case "id": - out.Values[i] = ec._TrivyImage_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "clusterName": - out.Values[i] = ec._TrivyImage_clusterName(ctx, field, obj) - case "artifactName": - out.Values[i] = ec._TrivyImage_artifactName(ctx, field, obj) - case "vulId": - out.Values[i] = ec._TrivyImage_vulId(ctx, field, obj) - case "vulPkgId": - out.Values[i] = ec._TrivyImage_vulPkgId(ctx, field, obj) - case "vulPkgName": - out.Values[i] = ec._TrivyImage_vulPkgName(ctx, field, obj) - case "vulInstalledVersion": - out.Values[i] = ec._TrivyImage_vulInstalledVersion(ctx, field, obj) - case "vulFixedVersion": - out.Values[i] = ec._TrivyImage_vulFixedVersion(ctx, field, obj) - case "vulTitle": - out.Values[i] = ec._TrivyImage_vulTitle(ctx, field, obj) - case "vulSeverity": - out.Values[i] = ec._TrivyImage_vulSeverity(ctx, field, obj) - case "vulPublishedDate": - out.Values[i] = ec._TrivyImage_vulPublishedDate(ctx, field, obj) - case "vulLastModifiedDate": - out.Values[i] = ec._TrivyImage_vulLastModifiedDate(ctx, field, obj) - case "expiryDate": - out.Values[i] = ec._TrivyImage_expiryDate(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var trivyImageCountImplementors = []string{"TrivyImageCount"} - -func (ec *executionContext) _TrivyImageCount(ctx context.Context, sel ast.SelectionSet, obj *model.TrivyImageCount) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, trivyImageCountImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TrivyImageCount") - case "clusterName": - out.Values[i] = ec._TrivyImageCount_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "ImageCount": - out.Values[i] = ec._TrivyImageCount_ImageCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var trivyMisconfigImplementors = []string{"TrivyMisconfig"} - -func (ec *executionContext) _TrivyMisconfig(ctx context.Context, sel ast.SelectionSet, obj *model.TrivyMisconfig) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, trivyMisconfigImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TrivyMisconfig") - case "id": - out.Values[i] = ec._TrivyMisconfig_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "clusterName": - out.Values[i] = ec._TrivyMisconfig_clusterName(ctx, field, obj) - case "namespace": - out.Values[i] = ec._TrivyMisconfig_namespace(ctx, field, obj) - case "kind": - out.Values[i] = ec._TrivyMisconfig_kind(ctx, field, obj) - case "name": - out.Values[i] = ec._TrivyMisconfig_name(ctx, field, obj) - case "misconfigId": - out.Values[i] = ec._TrivyMisconfig_misconfigId(ctx, field, obj) - case "misconfigAvdid": - out.Values[i] = ec._TrivyMisconfig_misconfigAvdid(ctx, field, obj) - case "misconfigType": - out.Values[i] = ec._TrivyMisconfig_misconfigType(ctx, field, obj) - case "misconfigTitle": - out.Values[i] = ec._TrivyMisconfig_misconfigTitle(ctx, field, obj) - case "misconfigDesc": - out.Values[i] = ec._TrivyMisconfig_misconfigDesc(ctx, field, obj) - case "misconfigMsg": - out.Values[i] = ec._TrivyMisconfig_misconfigMsg(ctx, field, obj) - case "misconfigQuery": - out.Values[i] = ec._TrivyMisconfig_misconfigQuery(ctx, field, obj) - case "misconfigResolution": - out.Values[i] = ec._TrivyMisconfig_misconfigResolution(ctx, field, obj) - case "misconfigSeverity": - out.Values[i] = ec._TrivyMisconfig_misconfigSeverity(ctx, field, obj) - case "misconfigStatus": - out.Values[i] = ec._TrivyMisconfig_misconfigStatus(ctx, field, obj) - case "eventTime": - out.Values[i] = ec._TrivyMisconfig_eventTime(ctx, field, obj) - case "expiryDate": - out.Values[i] = ec._TrivyMisconfig_expiryDate(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var trivySBOMImplementors = []string{"TrivySBOM"} - -func (ec *executionContext) _TrivySBOM(ctx context.Context, sel ast.SelectionSet, obj *model.TrivySbom) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, trivySBOMImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TrivySBOM") - case "id": - out.Values[i] = ec._TrivySBOM_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "clusterName": - out.Values[i] = ec._TrivySBOM_clusterName(ctx, field, obj) - case "imageName": - out.Values[i] = ec._TrivySBOM_imageName(ctx, field, obj) - case "packageName": - out.Values[i] = ec._TrivySBOM_packageName(ctx, field, obj) - case "packageUrl": - out.Values[i] = ec._TrivySBOM_packageUrl(ctx, field, obj) - case "bomRef": - out.Values[i] = ec._TrivySBOM_bomRef(ctx, field, obj) - case "serialNumber": - out.Values[i] = ec._TrivySBOM_serialNumber(ctx, field, obj) - case "version": - out.Values[i] = ec._TrivySBOM_version(ctx, field, obj) - case "bomFormat": - out.Values[i] = ec._TrivySBOM_bomFormat(ctx, field, obj) - case "expiryDate": - out.Values[i] = ec._TrivySBOM_expiryDate(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var trivyVulImplementors = []string{"TrivyVul"} - -func (ec *executionContext) _TrivyVul(ctx context.Context, sel ast.SelectionSet, obj *model.TrivyVul) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, trivyVulImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TrivyVul") - case "id": - out.Values[i] = ec._TrivyVul_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "clusterName": - out.Values[i] = ec._TrivyVul_clusterName(ctx, field, obj) - case "namespace": - out.Values[i] = ec._TrivyVul_namespace(ctx, field, obj) - case "kind": - out.Values[i] = ec._TrivyVul_kind(ctx, field, obj) - case "name": - out.Values[i] = ec._TrivyVul_name(ctx, field, obj) - case "vulId": - out.Values[i] = ec._TrivyVul_vulId(ctx, field, obj) - case "vulVendorIds": - out.Values[i] = ec._TrivyVul_vulVendorIds(ctx, field, obj) - case "vulPkgId": - out.Values[i] = ec._TrivyVul_vulPkgId(ctx, field, obj) - case "vulPkgName": - out.Values[i] = ec._TrivyVul_vulPkgName(ctx, field, obj) - case "vulPkgPath": - out.Values[i] = ec._TrivyVul_vulPkgPath(ctx, field, obj) - case "vulInstalledVersion": - out.Values[i] = ec._TrivyVul_vulInstalledVersion(ctx, field, obj) - case "vulFixedVersion": - out.Values[i] = ec._TrivyVul_vulFixedVersion(ctx, field, obj) - case "vulTitle": - out.Values[i] = ec._TrivyVul_vulTitle(ctx, field, obj) - case "vulSeverity": - out.Values[i] = ec._TrivyVul_vulSeverity(ctx, field, obj) - case "vulPublishedDate": - out.Values[i] = ec._TrivyVul_vulPublishedDate(ctx, field, obj) - case "vulLastModifiedDate": - out.Values[i] = ec._TrivyVul_vulLastModifiedDate(ctx, field, obj) - case "expiryDate": - out.Values[i] = ec._TrivyVul_expiryDate(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -var vulnerabilityImplementors = []string{"Vulnerability"} - -func (ec *executionContext) _Vulnerability(ctx context.Context, sel ast.SelectionSet, obj *model.Vulnerability) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, vulnerabilityImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Vulnerability") - case "id": - out.Values[i] = ec._Vulnerability_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "clusterName": - out.Values[i] = ec._Vulnerability_clusterName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "namespace": - out.Values[i] = ec._Vulnerability_namespace(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "kind": - out.Values[i] = ec._Vulnerability_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "name": - out.Values[i] = ec._Vulnerability_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "vulId": - out.Values[i] = ec._Vulnerability_vulId(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "vulVendorIds": - out.Values[i] = ec._Vulnerability_vulVendorIds(ctx, field, obj) - case "vulPkgId": - out.Values[i] = ec._Vulnerability_vulPkgId(ctx, field, obj) - case "vulPkgName": - out.Values[i] = ec._Vulnerability_vulPkgName(ctx, field, obj) - case "vulPkgPath": - out.Values[i] = ec._Vulnerability_vulPkgPath(ctx, field, obj) - case "vulInstalledVersion": - out.Values[i] = ec._Vulnerability_vulInstalledVersion(ctx, field, obj) - case "vulFixedVersion": - out.Values[i] = ec._Vulnerability_vulFixedVersion(ctx, field, obj) - case "vulTitle": - out.Values[i] = ec._Vulnerability_vulTitle(ctx, field, obj) - case "vulSeverity": - out.Values[i] = ec._Vulnerability_vulSeverity(ctx, field, obj) - case "vulPublishedDate": - out.Values[i] = ec._Vulnerability_vulPublishedDate(ctx, field, obj) - case "vulLastModifiedDate": - out.Values[i] = ec._Vulnerability_vulLastModifiedDate(ctx, field, obj) - case "expiryDate": - out.Values[i] = ec._Vulnerability_expiryDate(ctx, field, obj) - case "exportedAt": - out.Values[i] = ec._Vulnerability_exportedAt(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -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) - 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 { - 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 { - out.Invalids++ - } - case "args": - out.Values[i] = ec.___Directive_args(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "isRepeatable": - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -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) - 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 { - 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 { - out.Invalids++ - } - case "deprecationReason": - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -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) - 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 { - 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 { - out.Invalids++ - } - case "type": - out.Values[i] = ec.___Field_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "isDeprecated": - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "deprecationReason": - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -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) - 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 { - 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 { - out.Invalids++ - } - case "defaultValue": - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -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) - 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 { - out.Invalids++ - } - case "queryType": - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) - if out.Values[i] == graphql.Null { - 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 { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - 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 -} - -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) - 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 { - 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(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 -} - -// endregion **************************** object.gotpl **************************** - -// region ***************************** type.gotpl ***************************** - -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) marshalNCluster2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Cluster) 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.marshalNCluster2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐCluster(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNCluster2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐCluster(ctx context.Context, sel ast.SelectionSet, v *model.Cluster) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Cluster(ctx, sel, v) -} - -func (ec *executionContext) marshalNClusterAPIsCount2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterAPIsCountᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ClusterAPIsCount) 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.marshalNClusterAPIsCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterAPIsCount(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNClusterAPIsCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterAPIsCount(ctx context.Context, sel ast.SelectionSet, v *model.ClusterAPIsCount) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ClusterAPIsCount(ctx, sel, v) -} - -func (ec *executionContext) marshalNClusterDeletedAPICount2githubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterDeletedAPICount(ctx context.Context, sel ast.SelectionSet, v model.ClusterDeletedAPICount) graphql.Marshaler { - return ec._ClusterDeletedAPICount(ctx, sel, &v) -} - -func (ec *executionContext) marshalNClusterDeletedAPICount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterDeletedAPICount(ctx context.Context, sel ast.SelectionSet, v *model.ClusterDeletedAPICount) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ClusterDeletedAPICount(ctx, sel, v) -} - -func (ec *executionContext) marshalNClusterDeprecatedAPICount2githubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterDeprecatedAPICount(ctx context.Context, sel ast.SelectionSet, v model.ClusterDeprecatedAPICount) graphql.Marshaler { - return ec._ClusterDeprecatedAPICount(ctx, sel, &v) -} - -func (ec *executionContext) marshalNClusterDeprecatedAPICount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterDeprecatedAPICount(ctx context.Context, sel ast.SelectionSet, v *model.ClusterDeprecatedAPICount) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ClusterDeprecatedAPICount(ctx, sel, v) -} - -func (ec *executionContext) marshalNClusterNamespaceMisconfigCount2githubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceMisconfigCount(ctx context.Context, sel ast.SelectionSet, v model.ClusterNamespaceMisconfigCount) graphql.Marshaler { - return ec._ClusterNamespaceMisconfigCount(ctx, sel, &v) -} - -func (ec *executionContext) marshalNClusterNamespaceMisconfigCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceMisconfigCount(ctx context.Context, sel ast.SelectionSet, v *model.ClusterNamespaceMisconfigCount) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ClusterNamespaceMisconfigCount(ctx, sel, v) -} - -func (ec *executionContext) marshalNClusterNamespaceOutdatedCount2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceOutdatedCountᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ClusterNamespaceOutdatedCount) 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.marshalNClusterNamespaceOutdatedCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceOutdatedCount(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNClusterNamespaceOutdatedCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceOutdatedCount(ctx context.Context, sel ast.SelectionSet, v *model.ClusterNamespaceOutdatedCount) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ClusterNamespaceOutdatedCount(ctx, sel, v) -} - -func (ec *executionContext) marshalNClusterNamespaceResourceCount2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceResourceCountᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ClusterNamespaceResourceCount) 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.marshalNClusterNamespaceResourceCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceResourceCount(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNClusterNamespaceResourceCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceResourceCount(ctx context.Context, sel ast.SelectionSet, v *model.ClusterNamespaceResourceCount) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ClusterNamespaceResourceCount(ctx, sel, v) -} - -func (ec *executionContext) marshalNClusterNamespaceVulCount2githubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceVulCount(ctx context.Context, sel ast.SelectionSet, v model.ClusterNamespaceVulCount) graphql.Marshaler { - return ec._ClusterNamespaceVulCount(ctx, sel, &v) -} - -func (ec *executionContext) marshalNClusterNamespaceVulCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐClusterNamespaceVulCount(ctx context.Context, sel ast.SelectionSet, v *model.ClusterNamespaceVulCount) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ClusterNamespaceVulCount(ctx, sel, v) -} - -func (ec *executionContext) marshalNDeletedAPI2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐDeletedAPIᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.DeletedAPI) 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.marshalNDeletedAPI2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐDeletedAPI(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNDeletedAPI2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐDeletedAPI(ctx context.Context, sel ast.SelectionSet, v *model.DeletedAPI) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._DeletedAPI(ctx, sel, v) -} - -func (ec *executionContext) marshalNDeprecatedAPI2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐDeprecatedAPIᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.DeprecatedAPI) 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.marshalNDeprecatedAPI2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐDeprecatedAPI(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNDeprecatedAPI2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐDeprecatedAPI(ctx context.Context, sel ast.SelectionSet, v *model.DeprecatedAPI) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._DeprecatedAPI(ctx, sel, v) -} - -func (ec *executionContext) marshalNEvent2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐEventᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Event) 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.marshalNEvent2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐEvent(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNEvent2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐEvent(ctx context.Context, sel ast.SelectionSet, v *model.Event) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Event(ctx, sel, v) -} - -func (ec *executionContext) marshalNGetAllResource2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐGetAllResourceᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GetAllResource) 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.marshalNGetAllResource2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐGetAllResource(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNGetAllResource2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐGetAllResource(ctx context.Context, sel ast.SelectionSet, v *model.GetAllResource) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._GetAllResource(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalID(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalID(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { - res, err := graphql.UnmarshalInt(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { - res := graphql.MarshalInt(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) marshalNKubeScore2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐKubeScoreᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.KubeScore) 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.marshalNKubeScore2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐKubeScore(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNKubeScore2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐKubeScore(ctx context.Context, sel ast.SelectionSet, v *model.KubeScore) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._KubeScore(ctx, sel, v) -} - -func (ec *executionContext) marshalNKubescore2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐKubescoreᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Kubescore) 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.marshalNKubescore2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐKubescore(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNKubescore2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐKubescore(ctx context.Context, sel ast.SelectionSet, v *model.Kubescore) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Kubescore(ctx, sel, v) -} - -func (ec *executionContext) marshalNMisconfiguration2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐMisconfigurationᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Misconfiguration) 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.marshalNMisconfiguration2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐMisconfiguration(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNMisconfiguration2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐMisconfiguration(ctx context.Context, sel ast.SelectionSet, v *model.Misconfiguration) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Misconfiguration(ctx, sel, v) -} - -func (ec *executionContext) marshalNNamespace2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐNamespaceᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Namespace) 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.marshalNNamespace2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐNamespace(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNNamespace2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐNamespace(ctx context.Context, sel ast.SelectionSet, v *model.Namespace) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Namespace(ctx, sel, v) -} - -func (ec *executionContext) marshalNOutdatedImage2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐOutdatedImageᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.OutdatedImage) 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.marshalNOutdatedImage2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐOutdatedImage(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNOutdatedImage2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐOutdatedImage(ctx context.Context, sel ast.SelectionSet, v *model.OutdatedImage) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._OutdatedImage(ctx, sel, v) -} - -func (ec *executionContext) marshalNRakkess2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐRakkessᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Rakkess) 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.marshalNRakkess2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐRakkess(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNRakkess2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐRakkess(ctx context.Context, sel ast.SelectionSet, v *model.Rakkess) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Rakkess(ctx, sel, v) -} - -func (ec *executionContext) marshalNResource2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐResourceᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Resource) 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.marshalNResource2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐResource(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNResource2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐResource(ctx context.Context, sel ast.SelectionSet, v *model.Resource) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Resource(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) marshalNTrivyImage2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyImageᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.TrivyImage) 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.marshalNTrivyImage2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyImage(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNTrivyImage2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyImage(ctx context.Context, sel ast.SelectionSet, v *model.TrivyImage) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._TrivyImage(ctx, sel, v) -} - -func (ec *executionContext) marshalNTrivyImageCount2githubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyImageCount(ctx context.Context, sel ast.SelectionSet, v model.TrivyImageCount) graphql.Marshaler { - return ec._TrivyImageCount(ctx, sel, &v) -} - -func (ec *executionContext) marshalNTrivyImageCount2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyImageCount(ctx context.Context, sel ast.SelectionSet, v *model.TrivyImageCount) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._TrivyImageCount(ctx, sel, v) -} - -func (ec *executionContext) marshalNTrivyMisconfig2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyMisconfigᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.TrivyMisconfig) 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.marshalNTrivyMisconfig2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyMisconfig(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNTrivyMisconfig2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyMisconfig(ctx context.Context, sel ast.SelectionSet, v *model.TrivyMisconfig) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._TrivyMisconfig(ctx, sel, v) -} - -func (ec *executionContext) marshalNTrivySBOM2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivySbomᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.TrivySbom) 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.marshalNTrivySBOM2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivySbom(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNTrivySBOM2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivySbom(ctx context.Context, sel ast.SelectionSet, v *model.TrivySbom) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._TrivySBOM(ctx, sel, v) -} - -func (ec *executionContext) marshalNTrivyVul2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyVulᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.TrivyVul) 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.marshalNTrivyVul2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyVul(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNTrivyVul2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐTrivyVul(ctx context.Context, sel ast.SelectionSet, v *model.TrivyVul) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._TrivyVul(ctx, sel, v) -} - -func (ec *executionContext) marshalNVulnerability2ᚕᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐVulnerabilityᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Vulnerability) 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.marshalNVulnerability2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐVulnerability(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNVulnerability2ᚖgithubᚗcomᚋintelopsᚋkubvizᚋgraphqlserverᚋgraphᚋmodelᚐVulnerability(ctx context.Context, sel ast.SelectionSet, v *model.Vulnerability) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Vulnerability(ctx, sel, v) -} - -func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { - return ec.___Directive(ctx, sel, &v) -} - -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() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]string, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -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() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { - return ec.___EnumValue(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { - return ec.___Field(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { - return ec.___InputValue(ctx, sel, &v) -} - -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() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { - return ec.___Type(ctx, sel, &v) -} - -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() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec.___Type(ctx, sel, v) -} - -func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - return res -} - -func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalBoolean(*v) - return res -} - -func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalInt(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalInt(*v) - return res -} - -func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalString(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalString(*v) - return res -} - -func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { - 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() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { - 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() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { - 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() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec.___Schema(ctx, sel, v) -} - -func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { - 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() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec.___Type(ctx, sel, v) -} - -// endregion ***************************** type.gotpl ***************************** diff --git a/graphqlserver/graph/model/models_gen.go b/graphqlserver/graph/model/models_gen.go deleted file mode 100644 index 41e4076b..00000000 --- a/graphqlserver/graph/model/models_gen.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package model - -type Cluster struct { - Name string `json:"name"` -} - -type ClusterAPIsCount struct { - ClusterName string `json:"clusterName"` - Count int `json:"count"` -} - -type ClusterDeletedAPICount struct { - ClusterName string `json:"clusterName"` - DeletedAPICount int `json:"deletedAPICount"` -} - -type ClusterDeprecatedAPICount struct { - ClusterName string `json:"clusterName"` - DeprecatedAPICount int `json:"deprecatedAPICount"` -} - -type ClusterNamespaceMisconfigCount struct { - ClusterName string `json:"clusterName"` - Namespace string `json:"namespace"` - MisconfigCount int `json:"misconfigCount"` -} - -type ClusterNamespaceOutdatedCount struct { - ClusterName string `json:"clusterName"` - Namespace string `json:"namespace"` - OutdatedCount int `json:"outdatedCount"` -} - -type ClusterNamespaceResourceCount struct { - ClusterName string `json:"clusterName"` - Namespace string `json:"namespace"` - ResourceCount int `json:"resourceCount"` -} - -type ClusterNamespaceVulCount struct { - ClusterName string `json:"clusterName"` - Namespace string `json:"namespace"` - VulCount int `json:"vulCount"` -} - -type DeletedAPI struct { - ClusterName *string `json:"ClusterName,omitempty"` - ObjectName *string `json:"ObjectName,omitempty"` - Group *string `json:"Group,omitempty"` - Kind *string `json:"Kind,omitempty"` - Version *string `json:"Version,omitempty"` - Name *string `json:"Name,omitempty"` - Deleted *bool `json:"Deleted,omitempty"` - Scope *string `json:"Scope,omitempty"` - EventTime *string `json:"EventTime,omitempty"` - ExpiryDate *string `json:"ExpiryDate,omitempty"` -} - -type DeprecatedAPI struct { - ClusterName *string `json:"ClusterName,omitempty"` - ObjectName *string `json:"ObjectName,omitempty"` - Description *string `json:"Description,omitempty"` - Kind *string `json:"Kind,omitempty"` - Deprecated *bool `json:"Deprecated,omitempty"` - Scope *string `json:"Scope,omitempty"` - EventTime *string `json:"EventTime,omitempty"` - ExpiryDate *string `json:"ExpiryDate,omitempty"` -} - -type Event struct { - ClusterName *string `json:"ClusterName,omitempty"` - ID *string `json:"Id,omitempty"` - EventTime *string `json:"EventTime,omitempty"` - OpType *string `json:"OpType,omitempty"` - Name *string `json:"Name,omitempty"` - Namespace *string `json:"Namespace,omitempty"` - Kind *string `json:"Kind,omitempty"` - Message *string `json:"Message,omitempty"` - Reason *string `json:"Reason,omitempty"` - Host *string `json:"Host,omitempty"` - Event *string `json:"Event,omitempty"` - ImageName *string `json:"ImageName,omitempty"` - FirstTime *string `json:"FirstTime,omitempty"` - LastTime *string `json:"LastTime,omitempty"` - ExpiryDate *string `json:"ExpiryDate,omitempty"` -} - -type GetAllResource struct { - ClusterName *string `json:"ClusterName,omitempty"` - Namespace *string `json:"Namespace,omitempty"` - Kind *string `json:"Kind,omitempty"` - Resource *string `json:"Resource,omitempty"` - Age *string `json:"Age,omitempty"` - EventTime *string `json:"EventTime,omitempty"` - ExpiryDate *string `json:"ExpiryDate,omitempty"` -} - -type KubeScore struct { - ID string `json:"id"` - ClusterName string `json:"clusterName"` - ObjectName string `json:"objectName"` - Kind string `json:"kind"` - APIVersion string `json:"apiVersion"` - Name string `json:"name"` - Namespace string `json:"namespace"` - TargetType string `json:"targetType"` - Description string `json:"description"` - Path string `json:"path"` - Summary string `json:"summary"` - FileName string `json:"fileName"` - FileRow int `json:"fileRow"` - EventTime string `json:"eventTime"` -} - -type Kubescore struct { - ID string `json:"id"` - ClusterName *string `json:"clusterName,omitempty"` - ObjectName *string `json:"objectName,omitempty"` - Kind *string `json:"kind,omitempty"` - APIVersion *string `json:"apiVersion,omitempty"` - Name *string `json:"name,omitempty"` - Namespace *string `json:"namespace,omitempty"` - TargetType *string `json:"targetType,omitempty"` - Description *string `json:"description,omitempty"` - Path *string `json:"path,omitempty"` - Summary *string `json:"summary,omitempty"` - FileName *string `json:"fileName,omitempty"` - FileRow *int `json:"fileRow,omitempty"` - EventTime *string `json:"eventTime,omitempty"` -} - -type Misconfiguration struct { - ID string `json:"id"` - ClusterName string `json:"clusterName"` - Namespace string `json:"namespace"` - Kind string `json:"kind"` - Name string `json:"name"` - MisconfigID string `json:"misconfigId"` - MisconfigAvdid *string `json:"misconfigAvdid,omitempty"` - MisconfigType *string `json:"misconfigType,omitempty"` - MisconfigTitle *string `json:"misconfigTitle,omitempty"` - MisconfigDesc *string `json:"misconfigDesc,omitempty"` - MisconfigMsg *string `json:"misconfigMsg,omitempty"` - MisconfigQuery *string `json:"misconfigQuery,omitempty"` - MisconfigResolution *string `json:"misconfigResolution,omitempty"` - MisconfigSeverity *string `json:"misconfigSeverity,omitempty"` - MisconfigStatus *string `json:"misconfigStatus,omitempty"` - EventTime *string `json:"eventTime,omitempty"` - ExpiryDate *string `json:"expiryDate,omitempty"` - ExportedAt *string `json:"exportedAt,omitempty"` -} - -type Namespace struct { - Name string `json:"name"` -} - -type NamespaceData struct { - Namespace string `json:"namespace"` - OutdatedImages []*OutdatedImage `json:"outdatedImages"` - KubeScores []*KubeScore `json:"kubeScores"` - Resources []*Resource `json:"resources"` -} - -type OutdatedImage struct { - ClusterName string `json:"clusterName"` - Namespace string `json:"namespace"` - Pod string `json:"pod"` - CurrentImage string `json:"currentImage"` - CurrentTag string `json:"currentTag"` - LatestVersion string `json:"latestVersion"` - VersionsBehind int `json:"versionsBehind"` - EventTime string `json:"eventTime"` -} - -type Query struct { -} - -type Rakkess struct { - ClusterName *string `json:"ClusterName,omitempty"` - Name *string `json:"Name,omitempty"` - Create *string `json:"Create,omitempty"` - Delete *string `json:"Delete,omitempty"` - List *string `json:"List,omitempty"` - Update *string `json:"Update,omitempty"` - EventTime *string `json:"EventTime,omitempty"` - ExpiryDate *string `json:"ExpiryDate,omitempty"` -} - -type Resource struct { - ClusterName string `json:"clusterName"` - Namespace string `json:"namespace"` - Kind string `json:"kind"` - Resource string `json:"resource"` - Age string `json:"age"` - EventTime string `json:"eventTime"` -} - -type TrivyImage struct { - ID string `json:"id"` - ClusterName *string `json:"clusterName,omitempty"` - ArtifactName *string `json:"artifactName,omitempty"` - VulID *string `json:"vulId,omitempty"` - VulPkgID *string `json:"vulPkgId,omitempty"` - VulPkgName *string `json:"vulPkgName,omitempty"` - VulInstalledVersion *string `json:"vulInstalledVersion,omitempty"` - VulFixedVersion *string `json:"vulFixedVersion,omitempty"` - VulTitle *string `json:"vulTitle,omitempty"` - VulSeverity *string `json:"vulSeverity,omitempty"` - VulPublishedDate *string `json:"vulPublishedDate,omitempty"` - VulLastModifiedDate *string `json:"vulLastModifiedDate,omitempty"` - ExpiryDate *string `json:"expiryDate,omitempty"` -} - -type TrivyImageCount struct { - ClusterName string `json:"clusterName"` - ImageCount int `json:"ImageCount"` -} - -type TrivyMisconfig struct { - ID string `json:"id"` - ClusterName *string `json:"clusterName,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - MisconfigID *string `json:"misconfigId,omitempty"` - MisconfigAvdid *string `json:"misconfigAvdid,omitempty"` - MisconfigType *string `json:"misconfigType,omitempty"` - MisconfigTitle *string `json:"misconfigTitle,omitempty"` - MisconfigDesc *string `json:"misconfigDesc,omitempty"` - MisconfigMsg *string `json:"misconfigMsg,omitempty"` - MisconfigQuery *string `json:"misconfigQuery,omitempty"` - MisconfigResolution *string `json:"misconfigResolution,omitempty"` - MisconfigSeverity *string `json:"misconfigSeverity,omitempty"` - MisconfigStatus *string `json:"misconfigStatus,omitempty"` - EventTime *string `json:"eventTime,omitempty"` - ExpiryDate *string `json:"expiryDate,omitempty"` -} - -type TrivySbom struct { - ID string `json:"id"` - ClusterName *string `json:"clusterName,omitempty"` - ImageName *string `json:"imageName,omitempty"` - PackageName *string `json:"packageName,omitempty"` - PackageURL *string `json:"packageUrl,omitempty"` - BomRef *string `json:"bomRef,omitempty"` - SerialNumber *string `json:"serialNumber,omitempty"` - Version *int `json:"version,omitempty"` - BomFormat *string `json:"bomFormat,omitempty"` - ExpiryDate *string `json:"expiryDate,omitempty"` -} - -type TrivyVul struct { - ID string `json:"id"` - ClusterName *string `json:"clusterName,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - VulID *string `json:"vulId,omitempty"` - VulVendorIds *string `json:"vulVendorIds,omitempty"` - VulPkgID *string `json:"vulPkgId,omitempty"` - VulPkgName *string `json:"vulPkgName,omitempty"` - VulPkgPath *string `json:"vulPkgPath,omitempty"` - VulInstalledVersion *string `json:"vulInstalledVersion,omitempty"` - VulFixedVersion *string `json:"vulFixedVersion,omitempty"` - VulTitle *string `json:"vulTitle,omitempty"` - VulSeverity *string `json:"vulSeverity,omitempty"` - VulPublishedDate *string `json:"vulPublishedDate,omitempty"` - VulLastModifiedDate *string `json:"vulLastModifiedDate,omitempty"` - ExpiryDate *string `json:"expiryDate,omitempty"` -} - -type Vulnerability struct { - ID string `json:"id"` - ClusterName string `json:"clusterName"` - Namespace string `json:"namespace"` - Kind string `json:"kind"` - Name string `json:"name"` - VulID string `json:"vulId"` - VulVendorIds *string `json:"vulVendorIds,omitempty"` - VulPkgID *string `json:"vulPkgId,omitempty"` - VulPkgName *string `json:"vulPkgName,omitempty"` - VulPkgPath *string `json:"vulPkgPath,omitempty"` - VulInstalledVersion *string `json:"vulInstalledVersion,omitempty"` - VulFixedVersion *string `json:"vulFixedVersion,omitempty"` - VulTitle *string `json:"vulTitle,omitempty"` - VulSeverity *string `json:"vulSeverity,omitempty"` - VulPublishedDate *string `json:"vulPublishedDate,omitempty"` - VulLastModifiedDate *string `json:"vulLastModifiedDate,omitempty"` - ExpiryDate *string `json:"expiryDate,omitempty"` - ExportedAt *string `json:"exportedAt,omitempty"` -} diff --git a/graphqlserver/graph/resolver.go b/graphqlserver/graph/resolver.go deleted file mode 100644 index 37fad417..00000000 --- a/graphqlserver/graph/resolver.go +++ /dev/null @@ -1,17 +0,0 @@ -package graph - -import ( - "database/sql" -) - -// This file will not be regenerated automatically. -// -// It serves as dependency injection for your app, add any dependencies you require here. - -type Resolver struct { - DB *sql.DB -} - -func NewResolver(db *sql.DB) *Resolver { - return &Resolver{DB: db} -} diff --git a/graphqlserver/graph/schema.graphqls b/graphqlserver/graph/schema.graphqls deleted file mode 100644 index 9b6e3258..00000000 --- a/graphqlserver/graph/schema.graphqls +++ /dev/null @@ -1,327 +0,0 @@ -type Query { - allEvents: [Event!]! - allRakkess: [Rakkess!]! - allDeprecatedAPIs: [DeprecatedAPI!]! - allDeletedAPIs: [DeletedAPI!]! - allGetAllResources: [GetAllResource!]! - allTrivySBOMs: [TrivySBOM!]! - allTrivyImages: [TrivyImage!]! - allKubeScores: [Kubescore!]! - allTrivyVuls: [TrivyVul!]! - allTrivyMisconfigs: [TrivyMisconfig!]! - uniqueNamespaces(clusterName: String!): [Namespace!]! - uniqueClusters: [Cluster!]! - outdatedImagesByClusterAndNamespace(clusterName: String!, namespace: String!): [OutdatedImage!]! - outdatedImagesCount(clusterName: String!, namespace: String!): Int! - allClusterNamespaceOutdatedCounts: [ClusterNamespaceOutdatedCount!]! - allClusterDeprecatedAPIsCounts: [ClusterAPIsCount!]! - allClusterDeletedAPIsCounts: [ClusterAPIsCount!]! - allClusterNamespaceResourceCounts: [ClusterNamespaceResourceCount!]! - eventsByClusterAndNamespace(clusterName: String!, namespace: String!): [Event!]! - vulnerabilities(clusterName: String!, namespace: String!): [Vulnerability!]! - misconfigurations(clusterName: String!, namespace: String!): [Misconfiguration!]! - kubescores(clustername: String!, namespace: String!): [KubeScore!]! - getAllResources(clusterName: String!, namespace: String!): [GetAllResource!]! - trivyImages(clusterName: String!): [TrivyImage!]! - deprecatedAPIs(clusterName: String!): [DeprecatedAPI!]! - deletedAPIs(clusterName: String!): [DeletedAPI!]! - trivySBOMs(clusterName: String!): [TrivySBOM!]! - trivyVulCount(clusterName: String!, namespace: String!): ClusterNamespaceVulCount! - trivyMisconfigCount(clusterName: String!, namespace: String!): ClusterNamespaceMisconfigCount! - deletedAPICount(clusterName: String!): ClusterDeletedAPICount! - trivyImageCount(clusterName: String!): TrivyImageCount! - deprecatedAPICount(clusterName: String!): ClusterDeprecatedAPICount! -} - -type ClusterDeprecatedAPICount { - clusterName: String! - deprecatedAPICount: Int! -} - -type TrivyImageCount { - clusterName: String! - ImageCount: Int! -} - - -type ClusterDeletedAPICount { - clusterName: String! - deletedAPICount: Int! -} - - -type ClusterNamespaceMisconfigCount { - clusterName: String! - namespace: String! - misconfigCount: Int! -} - - -type ClusterNamespaceVulCount { - clusterName: String! - namespace: String! - vulCount: Int! -} - -type Kubescore { - id: ID! - clusterName: String - objectName: String - kind: String - apiVersion: String - name: String - namespace: String - targetType: String - description: String - path: String - summary: String - fileName: String - fileRow: Int - eventTime: String -} - - -type Misconfiguration { - id: ID! - clusterName: String! - namespace: String! - kind: String! - name: String! - misconfigId: String! - misconfigAvdid: String - misconfigType: String - misconfigTitle: String - misconfigDesc: String - misconfigMsg: String - misconfigQuery: String - misconfigResolution: String - misconfigSeverity: String - misconfigStatus: String - eventTime: String - expiryDate: String - exportedAt: String -} - -type Vulnerability { - id: ID! - clusterName: String! - namespace: String! - kind: String! - name: String! - vulId: String! - vulVendorIds: String - vulPkgId: String - vulPkgName: String - vulPkgPath: String - vulInstalledVersion: String - vulFixedVersion: String - vulTitle: String - vulSeverity: String - vulPublishedDate: String - vulLastModifiedDate: String - expiryDate: String - exportedAt: String -} - -type Event { - ClusterName: String - Id: String - EventTime: String - OpType: String - Name: String - Namespace: String - Kind: String - Message: String - Reason: String - Host: String - Event: String - ImageName: String - FirstTime: String - LastTime: String - ExpiryDate: String -} - -type Namespace { - name: String! -} - -type Cluster { - name: String! -} - -type ClusterNamespaceResourceCount { - clusterName: String! - namespace: String! - resourceCount: Int! -} -type ClusterAPIsCount { - clusterName: String! - count: Int! -} - - -type ClusterNamespaceOutdatedCount { - clusterName: String! - namespace: String! - outdatedCount: Int! -} - -type TrivyMisconfig { - id: ID! - clusterName: String - namespace: String - kind: String - name: String - misconfigId: String - misconfigAvdid: String - misconfigType: String - misconfigTitle: String - misconfigDesc: String - misconfigMsg: String - misconfigQuery: String - misconfigResolution: String - misconfigSeverity: String - misconfigStatus: String - eventTime: String - expiryDate: String -} - -type TrivyVul { - id: ID! - clusterName: String - namespace: String - kind: String - name: String - vulId: String - vulVendorIds: String - vulPkgId: String - vulPkgName: String - vulPkgPath: String - vulInstalledVersion: String - vulFixedVersion: String - vulTitle: String - vulSeverity: String - vulPublishedDate: String - vulLastModifiedDate: String - expiryDate: String -} - -type TrivyImage { - id: ID! - clusterName: String - artifactName: String - vulId: String - vulPkgId: String - vulPkgName: String - vulInstalledVersion: String - vulFixedVersion: String - vulTitle: String - vulSeverity: String - vulPublishedDate: String - vulLastModifiedDate: String - expiryDate: String -} - -type TrivySBOM { - id: ID! - clusterName: String - imageName: String - packageName: String - packageUrl: String - bomRef: String - serialNumber: String - version: Int - bomFormat: String - expiryDate: String -} - -type GetAllResource { - ClusterName: String - Namespace: String - Kind: String - Resource: String - Age: String - EventTime: String - ExpiryDate: String -} - -type DeletedAPI { - ClusterName: String - ObjectName: String - Group: String - Kind: String - Version: String - Name: String - Deleted: Boolean - Scope: String - EventTime: String - ExpiryDate: String -} - -type DeprecatedAPI { - ClusterName: String - ObjectName: String - Description: String - Kind: String - Deprecated: Boolean - Scope: String - EventTime: String - ExpiryDate: String -} - -type NamespaceData { - namespace: String! - outdatedImages: [OutdatedImage!]! - kubeScores: [KubeScore!]! - resources: [Resource!]! -} - -type OutdatedImage { - clusterName: String! - namespace: String! - pod: String! - currentImage: String! - currentTag: String! - latestVersion: String! - versionsBehind: Int! - eventTime: String! -} - -type KubeScore { - id: ID! - clusterName: String! - objectName: String! - kind: String! - apiVersion: String! - name: String! - namespace: String! - targetType: String! - description: String! - path: String! - summary: String! - fileName: String! - fileRow: Int! - eventTime: String! -} - -type Resource { - clusterName: String! - namespace: String! - kind: String! - resource: String! - age: String! - eventTime: String! -} - - - -type Rakkess { - ClusterName: String - Name: String - Create: String - Delete: String - List: String - Update: String - EventTime: String - ExpiryDate: String -} diff --git a/graphqlserver/graph/schema.resolvers.go b/graphqlserver/graph/schema.resolvers.go deleted file mode 100644 index 71cb5330..00000000 --- a/graphqlserver/graph/schema.resolvers.go +++ /dev/null @@ -1,1040 +0,0 @@ -package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.42 - -import ( - "context" - "database/sql" - "fmt" - - "github.com/intelops/kubviz/graphqlserver/graph/model" -) - -// AllEvents is the resolver for the allEvents field. -func (r *queryResolver) AllEvents(ctx context.Context) ([]*model.Event, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT ClusterName, Id, EventTime, OpType, Name, Namespace, Kind, Message, Reason, Host, Event, FirstTime, LastTime, ExpiryDate FROM events` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - if err == sql.ErrNoRows { - return []*model.Event{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var events []*model.Event - for rows.Next() { - var e model.Event - if err := rows.Scan(&e.ClusterName, &e.ID, &e.EventTime, &e.OpType, &e.Name, &e.Namespace, &e.Kind, &e.Message, &e.Reason, &e.Host, &e.Event, &e.FirstTime, &e.LastTime, &e.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - events = append(events, &e) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return events, nil -} - -// AllRakkess is the resolver for the allRakkess field. -func (r *queryResolver) AllRakkess(ctx context.Context) ([]*model.Rakkess, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT ClusterName, Name, Create, Delete, List, Update, EventTime, ExpiryDate FROM rakkess` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - if err == sql.ErrNoRows { - return []*model.Rakkess{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var rakkessRecords []*model.Rakkess - for rows.Next() { - var r model.Rakkess - if err := rows.Scan(&r.ClusterName, &r.Name, &r.Create, &r.Delete, &r.List, &r.Update, &r.EventTime, &r.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - rakkessRecords = append(rakkessRecords, &r) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return rakkessRecords, nil -} - -// AllDeprecatedAPIs is the resolver for the allDeprecatedAPIs field. -func (r *queryResolver) AllDeprecatedAPIs(ctx context.Context) ([]*model.DeprecatedAPI, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT ClusterName, ObjectName, Description, Kind, Deprecated, Scope, EventTime, ExpiryDate FROM DeprecatedAPIs` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - if err == sql.ErrNoRows { - return []*model.DeprecatedAPI{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var deprecatedAPIs []*model.DeprecatedAPI - for rows.Next() { - var d model.DeprecatedAPI - var deprecatedInt uint8 - if err := rows.Scan(&d.ClusterName, &d.ObjectName, &d.Description, &d.Kind, &deprecatedInt, &d.Scope, &d.EventTime, &d.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - - // Convert uint8 to bool - deprecatedBool := deprecatedInt != 0 - d.Deprecated = &deprecatedBool - - deprecatedAPIs = append(deprecatedAPIs, &d) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return deprecatedAPIs, nil -} - -// AllDeletedAPIs is the resolver for the allDeletedAPIs field. -func (r *queryResolver) AllDeletedAPIs(ctx context.Context) ([]*model.DeletedAPI, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT ClusterName, ObjectName, Group, Kind, Version, Name, Deleted, Scope, EventTime, ExpiryDate FROM DeletedAPIs` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - if err == sql.ErrNoRows { - return []*model.DeletedAPI{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var deletedAPIs []*model.DeletedAPI - for rows.Next() { - var d model.DeletedAPI - var deletedInt uint8 - if err := rows.Scan(&d.ClusterName, &d.ObjectName, &d.Group, &d.Kind, &d.Version, &d.Name, &deletedInt, &d.Scope, &d.EventTime, &d.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - - // Convert uint8 to bool - deletedBool := deletedInt != 0 - d.Deleted = &deletedBool - - deletedAPIs = append(deletedAPIs, &d) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return deletedAPIs, nil -} - -// AllGetAllResources is the resolver for the allGetAllResources field. -func (r *queryResolver) AllGetAllResources(ctx context.Context) ([]*model.GetAllResource, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT ClusterName, Namespace, Kind, Resource, Age, EventTime, ExpiryDate FROM getall_resources` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - if err == sql.ErrNoRows { - return []*model.GetAllResource{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var resources []*model.GetAllResource - for rows.Next() { - var res model.GetAllResource - if err := rows.Scan(&res.ClusterName, &res.Namespace, &res.Kind, &res.Resource, &res.Age, &res.EventTime, &res.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - resources = append(resources, &res) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return resources, nil -} - -// AllTrivySBOMs is the resolver for the allTrivySBOMs field. -func (r *queryResolver) AllTrivySBOMs(ctx context.Context) ([]*model.TrivySbom, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT id, cluster_name, image_name, package_name, package_url, bom_ref, serial_number, version, bom_format, ExpiryDate FROM trivysbom` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - if err == sql.ErrNoRows { - return []*model.TrivySbom{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var sboms []*model.TrivySbom - for rows.Next() { - var s model.TrivySbom - if err := rows.Scan(&s.ID, &s.ClusterName, &s.ImageName, &s.PackageName, &s.PackageURL, &s.BomRef, &s.SerialNumber, &s.Version, &s.BomFormat, &s.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - sboms = append(sboms, &s) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return sboms, nil -} - -// AllTrivyImages is the resolver for the allTrivyImages field. -func (r *queryResolver) AllTrivyImages(ctx context.Context) ([]*model.TrivyImage, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT id, cluster_name, artifact_name, vul_id, vul_pkg_id, vul_pkg_name, vul_installed_version, vul_fixed_version, vul_title, vul_severity, vul_published_date, vul_last_modified_date, ExpiryDate FROM trivyimage` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - if err == sql.ErrNoRows { - return []*model.TrivyImage{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var images []*model.TrivyImage - for rows.Next() { - var img model.TrivyImage - if err := rows.Scan(&img.ID, &img.ClusterName, &img.ArtifactName, &img.VulID, &img.VulPkgID, &img.VulPkgName, &img.VulInstalledVersion, &img.VulFixedVersion, &img.VulTitle, &img.VulSeverity, &img.VulPublishedDate, &img.VulLastModifiedDate, &img.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - images = append(images, &img) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return images, nil -} - -// AllKubeScores is the resolver for the allKubeScores field. -func (r *queryResolver) AllKubeScores(ctx context.Context) ([]*model.Kubescore, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT id, clustername, object_name, kind, apiVersion, name, namespace, target_type, description, path, summary, file_name, file_row, EventTime, ExpiryDate FROM kubescore` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - if err == sql.ErrNoRows { - return []*model.Kubescore{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var kubeScores []*model.Kubescore - for rows.Next() { - var ks model.Kubescore - if err := rows.Scan(&ks.ID, &ks.ClusterName, &ks.ObjectName, &ks.Kind, &ks.APIVersion, &ks.Name, &ks.Namespace, &ks.TargetType, &ks.Description, &ks.Path, &ks.Summary, &ks.FileName, &ks.FileRow, &ks.EventTime); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - kubeScores = append(kubeScores, &ks) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return kubeScores, nil -} - -// AllTrivyVuls is the resolver for the allTrivyVuls field. -func (r *queryResolver) AllTrivyVuls(ctx context.Context) ([]*model.TrivyVul, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT id, cluster_name, namespace, kind, name, vul_id, vul_vendor_ids, vul_pkg_id, vul_pkg_name, vul_pkg_path, vul_installed_version, vul_fixed_version, vul_title, vul_severity, vul_published_date, vul_last_modified_date, ExpiryDate FROM trivy_vul` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - if err == sql.ErrNoRows { - return []*model.TrivyVul{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var trivyVuls []*model.TrivyVul - for rows.Next() { - var tv model.TrivyVul - if err := rows.Scan(&tv.ID, &tv.ClusterName, &tv.Namespace, &tv.Kind, &tv.Name, &tv.VulID, &tv.VulVendorIds, &tv.VulPkgID, &tv.VulPkgName, &tv.VulPkgPath, &tv.VulInstalledVersion, &tv.VulFixedVersion, &tv.VulTitle, &tv.VulSeverity, &tv.VulPublishedDate, &tv.VulLastModifiedDate, &tv.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - trivyVuls = append(trivyVuls, &tv) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return trivyVuls, nil -} - -// AllTrivyMisconfigs is the resolver for the allTrivyMisconfigs field. -func (r *queryResolver) AllTrivyMisconfigs(ctx context.Context) ([]*model.TrivyMisconfig, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT id, cluster_name, namespace, kind, name, misconfig_id, misconfig_avdid, misconfig_type, misconfig_title, misconfig_desc, misconfig_msg, misconfig_query, misconfig_resolution, misconfig_severity, misconfig_status, EventTime, ExpiryDate FROM trivy_misconfig` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - if err == sql.ErrNoRows { - return []*model.TrivyMisconfig{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var misconfigs []*model.TrivyMisconfig - for rows.Next() { - var tm model.TrivyMisconfig - if err := rows.Scan(&tm.ID, &tm.ClusterName, &tm.Namespace, &tm.Kind, &tm.Name, &tm.MisconfigID, &tm.MisconfigAvdid, &tm.MisconfigType, &tm.MisconfigTitle, &tm.MisconfigDesc, &tm.MisconfigMsg, &tm.MisconfigQuery, &tm.MisconfigResolution, &tm.MisconfigSeverity, &tm.MisconfigStatus, &tm.EventTime, &tm.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - misconfigs = append(misconfigs, &tm) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return misconfigs, nil -} - -// UniqueNamespaces is the resolver for the uniqueNamespaces field. -func (r *queryResolver) UniqueNamespaces(ctx context.Context, clusterName string) ([]*model.Namespace, error) { - namespaces, err := r.fetchNamespacesFromDatabase(ctx, clusterName) - if err != nil { - return nil, err - } - - var namespaceObjects []*model.Namespace - for _, ns := range namespaces { - namespaceObjects = append(namespaceObjects, &model.Namespace{Name: ns}) - } - - return namespaceObjects, nil -} - -// UniqueClusters is the resolver for the uniqueClusters field. -func (r *queryResolver) UniqueClusters(ctx context.Context) ([]*model.Cluster, error) { - clusters, err := r.fetchClustersFromDatabase(ctx) - if err != nil { - return nil, err - } - - var clusterObjects []*model.Cluster - for _, cluster := range clusters { - clusterObjects = append(clusterObjects, &model.Cluster{Name: cluster}) - } - - return clusterObjects, nil -} - -// OutdatedImagesByClusterAndNamespace is the resolver for the outdatedImagesByClusterAndNamespace field. -func (r *queryResolver) OutdatedImagesByClusterAndNamespace(ctx context.Context, clusterName string, namespace string) ([]*model.OutdatedImage, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" || namespace == "" { - return nil, fmt.Errorf("clusterName and namespace cannot be empty") - } - - query := `SELECT ClusterName, Namespace, Pod, CurrentImage, CurrentTag, LatestVersion, VersionsBehind, EventTime FROM outdated_images WHERE ClusterName = ? AND Namespace = ?` - - rows, err := r.DB.QueryContext(ctx, query, clusterName, namespace) - if err != nil { - if err == sql.ErrNoRows { - return []*model.OutdatedImage{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var outdatedImages []*model.OutdatedImage - for rows.Next() { - var oi model.OutdatedImage - if err := rows.Scan(&oi.ClusterName, &oi.Namespace, &oi.Pod, &oi.CurrentImage, &oi.CurrentTag, &oi.LatestVersion, &oi.VersionsBehind, &oi.EventTime); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - outdatedImages = append(outdatedImages, &oi) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return outdatedImages, nil -} - -// OutdatedImagesCount is the resolver for the outdatedImagesCount field. -func (r *queryResolver) OutdatedImagesCount(ctx context.Context, clusterName string, namespace string) (int, error) { - if r.DB == nil { - return 0, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" || namespace == "" { - return 0, fmt.Errorf("clusterName and namespace cannot be empty") - } - - query := `SELECT COUNT(*) FROM outdated_images WHERE ClusterName = ? AND Namespace = ?` - - var count int - err := r.DB.QueryRowContext(ctx, query, clusterName, namespace).Scan(&count) - if err != nil { - if err == sql.ErrNoRows { - return 0, nil - } - return 0, fmt.Errorf("error executing query: %v", err) - } - - return count, nil -} - -// AllClusterNamespaceOutdatedCounts is the resolver for the allClusterNamespaceOutdatedCounts field. -func (r *queryResolver) AllClusterNamespaceOutdatedCounts(ctx context.Context) ([]*model.ClusterNamespaceOutdatedCount, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := ` - SELECT ClusterName, Namespace, COUNT(*) as outdatedCount - FROM outdated_images - GROUP BY ClusterName, Namespace - ` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var results []*model.ClusterNamespaceOutdatedCount - for rows.Next() { - var result model.ClusterNamespaceOutdatedCount - if err := rows.Scan(&result.ClusterName, &result.Namespace, &result.OutdatedCount); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - results = append(results, &result) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return results, nil -} - -// AllClusterDeprecatedAPIsCounts is the resolver for the allClusterDeprecatedAPIsCounts field. -func (r *queryResolver) AllClusterDeprecatedAPIsCounts(ctx context.Context) ([]*model.ClusterAPIsCount, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - query := ` - SELECT ClusterName, COUNT(*) as count - FROM DeprecatedAPIs - GROUP BY ClusterName -` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - var results []*model.ClusterAPIsCount - for rows.Next() { - var result model.ClusterAPIsCount - if err := rows.Scan(&result.ClusterName, &result.Count); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - results = append(results, &result) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return results, nil -} - -// AllClusterDeletedAPIsCounts is the resolver for the allClusterDeletedAPIsCounts field. -func (r *queryResolver) AllClusterDeletedAPIsCounts(ctx context.Context) ([]*model.ClusterAPIsCount, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := ` - SELECT ClusterName, COUNT(*) as count - FROM DeletedAPIs - GROUP BY ClusterName - ` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var results []*model.ClusterAPIsCount - for rows.Next() { - var result model.ClusterAPIsCount - if err := rows.Scan(&result.ClusterName, &result.Count); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - results = append(results, &result) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return results, nil -} - -// AllClusterNamespaceResourceCounts is the resolver for the allClusterNamespaceResourceCounts field. -func (r *queryResolver) AllClusterNamespaceResourceCounts(ctx context.Context) ([]*model.ClusterNamespaceResourceCount, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := ` - SELECT ClusterName, Namespace, COUNT(*) as resourceCount - FROM getall_resources - GROUP BY ClusterName, Namespace - ` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var results []*model.ClusterNamespaceResourceCount - for rows.Next() { - var result model.ClusterNamespaceResourceCount - if err := rows.Scan(&result.ClusterName, &result.Namespace, &result.ResourceCount); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - results = append(results, &result) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return results, nil -} - -// EventsByClusterAndNamespace is the resolver for the eventsByClusterAndNamespace field. -func (r *queryResolver) EventsByClusterAndNamespace(ctx context.Context, clusterName string, namespace string) ([]*model.Event, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" || namespace == "" { - return nil, fmt.Errorf("clusterName and namespace cannot be empty") - } - - query := `SELECT ClusterName, Id, EventTime, OpType, Name, Namespace, Kind, Message, Reason, Host, Event, ImageName, FirstTime, LastTime FROM events WHERE ClusterName = ? AND Namespace = ?` - - rows, err := r.DB.QueryContext(ctx, query, clusterName, namespace) - if err != nil { - if err == sql.ErrNoRows { - return []*model.Event{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var events []*model.Event - for rows.Next() { - var e model.Event - if err := rows.Scan(&e.ClusterName, &e.ID, &e.EventTime, &e.OpType, &e.Name, &e.Namespace, &e.Kind, &e.Message, &e.Reason, &e.Host, &e.Event, &e.ImageName, &e.FirstTime, &e.LastTime); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - events = append(events, &e) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return events, nil -} - -// Vulnerabilities is the resolver for the vulnerabilities field. -func (r *queryResolver) Vulnerabilities(ctx context.Context, clusterName string, namespace string) ([]*model.Vulnerability, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" || namespace == "" { - return nil, fmt.Errorf("clusterName and namespace cannot be empty") - } - query := ` - SELECT id, cluster_name, namespace, kind, name, vul_id, vul_vendor_ids, vul_pkg_id, vul_pkg_name, vul_pkg_path, vul_installed_version, vul_fixed_version, vul_title, vul_severity, vul_published_date, vul_last_modified_date, ExpiryDate - FROM trivy_vul - WHERE cluster_name = ? AND namespace = ? - ` - rows, err := r.DB.QueryContext(ctx, query, clusterName, namespace) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - var vulnerabilities []*model.Vulnerability - for rows.Next() { - var v model.Vulnerability - if err := rows.Scan(&v.ID, &v.ClusterName, &v.Namespace, &v.Kind, &v.Name, &v.VulID, &v.VulVendorIds, &v.VulPkgID, &v.VulPkgName, &v.VulPkgPath, &v.VulInstalledVersion, &v.VulFixedVersion, &v.VulTitle, &v.VulSeverity, &v.VulPublishedDate, &v.VulLastModifiedDate, &v.ExpiryDate, &v.ExportedAt); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - vulnerabilities = append(vulnerabilities, &v) - } - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return vulnerabilities, nil -} - -// Misconfigurations is the resolver for the misconfigurations field. -func (r *queryResolver) Misconfigurations(ctx context.Context, clusterName string, namespace string) ([]*model.Misconfiguration, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" || namespace == "" { - return nil, fmt.Errorf("clusterName and namespace cannot be empty") - } - - query := ` - SELECT id, cluster_name, namespace, kind, name, misconfig_id, misconfig_avdid, misconfig_type, misconfig_title, misconfig_desc, misconfig_msg, misconfig_query, misconfig_resolution, misconfig_severity, misconfig_status, EventTime, ExpiryDate - FROM trivy_misconfig - WHERE cluster_name = ? AND namespace = ? - ` - - rows, err := r.DB.QueryContext(ctx, query, clusterName, namespace) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var misconfigurations []*model.Misconfiguration - for rows.Next() { - var m model.Misconfiguration - if err := rows.Scan(&m.ID, &m.ClusterName, &m.Namespace, &m.Kind, &m.Name, &m.MisconfigID, &m.MisconfigAvdid, &m.MisconfigType, &m.MisconfigTitle, &m.MisconfigDesc, &m.MisconfigMsg, &m.MisconfigQuery, &m.MisconfigResolution, &m.MisconfigSeverity, &m.MisconfigStatus, &m.EventTime, &m.ExpiryDate, &m.ExportedAt); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - misconfigurations = append(misconfigurations, &m) - } - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return misconfigurations, nil -} - -// Kubescores is the resolver for the kubescores field. -func (r *queryResolver) Kubescores(ctx context.Context, clustername string, namespace string) ([]*model.KubeScore, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clustername == "" || namespace == "" { - return nil, fmt.Errorf("clustername and namespace cannot be empty") - } - - query := ` - SELECT id, clustername, object_name, kind, apiVersion, name, namespace, target_type, description, path, summary, file_name, file_row, EventTime, ExpiryDate - FROM kubescore - WHERE clustername = ? AND namespace = ? - ` - - rows, err := r.DB.QueryContext(ctx, query, clustername, namespace) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var scores []*model.KubeScore - for rows.Next() { - var s model.KubeScore - if err := rows.Scan(&s.ID, &s.ClusterName, &s.ObjectName, &s.Kind, &s.APIVersion, &s.Name, &s.Namespace, &s.TargetType, &s.Description, &s.Path, &s.Summary, &s.FileName, &s.FileRow, &s.EventTime); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - scores = append(scores, &s) - } - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return scores, nil -} - -// GetAllResources is the resolver for the getAllResources field. -func (r *queryResolver) GetAllResources(ctx context.Context, clusterName string, namespace string) ([]*model.GetAllResource, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" || namespace == "" { - return nil, fmt.Errorf("clusterName and namespace cannot be empty") - } - - query := ` - SELECT ClusterName, Namespace, Kind, Resource, Age, EventTime, ExpiryDate - FROM getall_resources - WHERE ClusterName = ? AND Namespace = ? - ` - - rows, err := r.DB.QueryContext(ctx, query, clusterName, namespace) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var resources []*model.GetAllResource - for rows.Next() { - var r model.GetAllResource - if err := rows.Scan(&r.ClusterName, &r.Namespace, &r.Kind, &r.Resource, &r.Age, &r.EventTime, &r.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - resources = append(resources, &r) - } - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return resources, nil -} - -// TrivyImages is the resolver for the trivyImages field. -func (r *queryResolver) TrivyImages(ctx context.Context, clusterName string) ([]*model.TrivyImage, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" { - return nil, fmt.Errorf("clusterName cannot be empty") - } - - query := ` - SELECT id, cluster_name, artifact_name, vul_id, vul_pkg_id, vul_pkg_name, vul_installed_version, vul_fixed_version, vul_title, vul_severity, vul_published_date, vul_last_modified_date, ExpiryDate - FROM trivyimage - WHERE cluster_name = ? - ` - - rows, err := r.DB.QueryContext(ctx, query, clusterName) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var images []*model.TrivyImage - for rows.Next() { - var img model.TrivyImage - if err := rows.Scan(&img.ID, &img.ClusterName, &img.ArtifactName, &img.VulID, &img.VulPkgID, &img.VulPkgName, &img.VulInstalledVersion, &img.VulFixedVersion, &img.VulTitle, &img.VulSeverity, &img.VulPublishedDate, &img.VulLastModifiedDate, &img.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - images = append(images, &img) - } - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return images, nil -} - -// DeprecatedAPIs is the resolver for the deprecatedAPIs field. -func (r *queryResolver) DeprecatedAPIs(ctx context.Context, clusterName string) ([]*model.DeprecatedAPI, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" { - return nil, fmt.Errorf("ClusterName cannot be empty") - } - - query := ` - SELECT ClusterName, ObjectName, Description, Kind, Deprecated, Scope, EventTime, ExpiryDate - FROM DeprecatedAPIs - WHERE ClusterName = ? - ` - - rows, err := r.DB.QueryContext(ctx, query, clusterName) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - var apis []*model.DeprecatedAPI - for rows.Next() { - var api model.DeprecatedAPI - var deprecated uint8 - if err := rows.Scan(&api.ClusterName, &api.ObjectName, &api.Description, &api.Kind, &deprecated, &api.Scope, &api.EventTime, &api.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - deprecatedBool := deprecated != 0 - api.Deprecated = &deprecatedBool - apis = append(apis, &api) - } - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return apis, nil -} - -// DeletedAPIs is the resolver for the deletedAPIs field. -func (r *queryResolver) DeletedAPIs(ctx context.Context, clusterName string) ([]*model.DeletedAPI, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" { - return nil, fmt.Errorf("ClusterName cannot be empty") - } - - query := ` - SELECT ClusterName, ObjectName, Group, Kind, Version, Name, Deleted, Scope, EventTime, ExpiryDate - FROM DeletedAPIs - WHERE ClusterName = ? - ` - rows, err := r.DB.QueryContext(ctx, query, clusterName) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - var apis []*model.DeletedAPI - for rows.Next() { - var api model.DeletedAPI - var deleted uint8 - if err := rows.Scan(&api.ClusterName, &api.ObjectName, &api.Group, &api.Kind, &api.Version, &api.Name, &deleted, &api.Scope, &api.EventTime, &api.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - deletedBool := deleted != 0 - api.Deleted = &deletedBool - apis = append(apis, &api) - } - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return apis, nil -} - -// TrivySBOMs is the resolver for the trivySBOMs field. -func (r *queryResolver) TrivySBOMs(ctx context.Context, clusterName string) ([]*model.TrivySbom, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" { - return nil, fmt.Errorf("clusterName cannot be empty") - } - - query := ` - SELECT id, cluster_name, image_name, package_name, package_url, bom_ref, serial_number, version, bom_format, ExpiryDate - FROM trivysbom - WHERE cluster_name = ? - ` - - rows, err := r.DB.QueryContext(ctx, query, clusterName) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var sboms []*model.TrivySbom - for rows.Next() { - var sbom model.TrivySbom - if err := rows.Scan(&sbom.ID, &sbom.ClusterName, &sbom.ImageName, &sbom.PackageName, &sbom.PackageURL, &sbom.BomRef, &sbom.SerialNumber, &sbom.Version, &sbom.BomFormat, &sbom.ExpiryDate); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - sboms = append(sboms, &sbom) - } - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return sboms, nil -} - -// TrivyVulCount is the resolver for the trivyVulCount field. -func (r *queryResolver) TrivyVulCount(ctx context.Context, clusterName string, namespace string) (*model.ClusterNamespaceVulCount, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" || namespace == "" { - return nil, fmt.Errorf("clusterName and namespace cannot be empty") - } - - query := `SELECT COUNT(*) FROM trivy_vul WHERE cluster_name = ? AND namespace = ?` - - var count int - err := r.DB.QueryRowContext(ctx, query, clusterName, namespace).Scan(&count) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - - return &model.ClusterNamespaceVulCount{ - ClusterName: clusterName, - Namespace: namespace, - VulCount: count, - }, nil -} - -// TrivyMisconfigCount is the resolver for the trivyMisconfigCount field. -func (r *queryResolver) TrivyMisconfigCount(ctx context.Context, clusterName string, namespace string) (*model.ClusterNamespaceMisconfigCount, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" || namespace == "" { - return nil, fmt.Errorf("clusterName and namespace cannot be empty") - } - - query := `SELECT COUNT(*) FROM trivy_misconfig WHERE cluster_name = ? AND namespace = ?` - - var count int - err := r.DB.QueryRowContext(ctx, query, clusterName, namespace).Scan(&count) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - - return &model.ClusterNamespaceMisconfigCount{ - ClusterName: clusterName, - Namespace: namespace, - MisconfigCount: count, - }, nil -} - -// DeletedAPICount is the resolver for the deletedAPICount field. -func (r *queryResolver) DeletedAPICount(ctx context.Context, clusterName string) (*model.ClusterDeletedAPICount, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" { - return nil, fmt.Errorf("ClusterName cannot be empty") - } - - query := `SELECT COUNT(*) FROM DeletedAPIs WHERE ClusterName = ?` - - var count int - err := r.DB.QueryRowContext(ctx, query, clusterName).Scan(&count) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - - return &model.ClusterDeletedAPICount{ - ClusterName: clusterName, - DeletedAPICount: count, - }, nil -} - -// TrivyImageVulCount is the resolver for the trivyImageVulCount field. -func (r *queryResolver) TrivyImageCount(ctx context.Context, clusterName string) (*model.TrivyImageCount, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" { - return nil, fmt.Errorf("clusterName cannot be empty") - } - - query := `SELECT COUNT(*) FROM trivyimage WHERE cluster_name = ?` - - var count int - err := r.DB.QueryRowContext(ctx, query, clusterName).Scan(&count) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - - return &model.TrivyImageCount{ - ClusterName: clusterName, - ImageCount: count, - }, nil -} - -// DeprecatedAPICount is the resolver for the deprecatedAPICount field. -func (r *queryResolver) DeprecatedAPICount(ctx context.Context, clusterName string) (*model.ClusterDeprecatedAPICount, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - if clusterName == "" { - return nil, fmt.Errorf("ClusterName cannot be empty") - } - - query := `SELECT COUNT(*) FROM DeprecatedAPIs WHERE ClusterName = ?` - - var count int - err := r.DB.QueryRowContext(ctx, query, clusterName).Scan(&count) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - - return &model.ClusterDeprecatedAPICount{ - ClusterName: clusterName, - DeprecatedAPICount: count, - }, nil -} - -// Query returns QueryResolver implementation. -func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } - -type queryResolver struct{ *Resolver } diff --git a/graphqlserver/graph/utils.go b/graphqlserver/graph/utils.go deleted file mode 100644 index dd7bb02a..00000000 --- a/graphqlserver/graph/utils.go +++ /dev/null @@ -1,158 +0,0 @@ -package graph - -import ( - "context" - "database/sql" - "fmt" - - "github.com/intelops/kubviz/graphqlserver/graph/model" -) - -func (r *Resolver) fetchClustersFromDatabase(ctx context.Context) ([]string, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - query := `SELECT DISTINCT ClusterName FROM events` - - rows, err := r.DB.QueryContext(ctx, query) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var clusters []string - for rows.Next() { - var cluster string - if err := rows.Scan(&cluster); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - clusters = append(clusters, cluster) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return clusters, nil -} - -func (r *Resolver) fetchNamespacesFromDatabase(ctx context.Context, clusterName string) ([]string, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - // Include the cluster name in the WHERE clause to filter namespaces by cluster - query := `SELECT DISTINCT Namespace FROM events WHERE ClusterName = ?` - - rows, err := r.DB.QueryContext(ctx, query, clusterName) - if err != nil { - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var namespaces []string - for rows.Next() { - var namespace string - if err := rows.Scan(&namespace); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - namespaces = append(namespaces, namespace) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return namespaces, nil -} -func (r *Resolver) fetchOutdatedImages(ctx context.Context, namespace string) ([]*model.OutdatedImage, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - query := `SELECT ClusterName, Namespace, Pod, CurrentImage, CurrentTag, LatestVersion, VersionsBehind, EventTime FROM outdated_images WHERE Namespace = ?` - - rows, err := r.DB.QueryContext(ctx, query, namespace) - if err != nil { - if err == sql.ErrNoRows { - return []*model.OutdatedImage{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var outdatedImages []*model.OutdatedImage - for rows.Next() { - var oi model.OutdatedImage - if err := rows.Scan(&oi.ClusterName, &oi.Namespace, &oi.Pod, &oi.CurrentImage, &oi.CurrentTag, &oi.LatestVersion, &oi.VersionsBehind, &oi.EventTime); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - outdatedImages = append(outdatedImages, &oi) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return outdatedImages, nil -} -func (r *Resolver) fetchKubeScores(ctx context.Context, namespace string) ([]*model.KubeScore, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT id, clustername, object_name, kind, apiVersion, name, namespace, target_type, description, path, summary, file_name, file_row, EventTime FROM kubescore WHERE namespace = ?` - rows, err := r.DB.QueryContext(ctx, query, namespace) - if err != nil { - if err == sql.ErrNoRows { - // No data for the namespace, return an empty slice - return []*model.KubeScore{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var kubeScores []*model.KubeScore - for rows.Next() { - var ks model.KubeScore - if err := rows.Scan(&ks.ID, &ks.ClusterName, &ks.ObjectName, &ks.Kind, &ks.APIVersion, &ks.Name, &ks.Namespace, &ks.TargetType, &ks.Description, &ks.Path, &ks.Summary, &ks.FileName, &ks.FileRow, &ks.EventTime); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - kubeScores = append(kubeScores, &ks) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return kubeScores, nil -} -func (r *Resolver) fetchResources(ctx context.Context, namespace string) ([]*model.Resource, error) { - if r.DB == nil { - return nil, fmt.Errorf("database connection is not initialized") - } - - query := `SELECT ClusterName, Namespace, Kind, Resource, Age, EventTime FROM getall_resources WHERE Namespace = ?` - rows, err := r.DB.QueryContext(ctx, query, namespace) - if err != nil { - if err == sql.ErrNoRows { - // No data for the namespace, return an empty slice - return []*model.Resource{}, nil - } - return nil, fmt.Errorf("error executing query: %v", err) - } - defer rows.Close() - - var resources []*model.Resource - for rows.Next() { - var res model.Resource - if err := rows.Scan(&res.ClusterName, &res.Namespace, &res.Kind, &res.Resource, &res.Age, &res.EventTime); err != nil { - return nil, fmt.Errorf("error scanning row: %v", err) - } - resources = append(resources, &res) - } - - if err := rows.Err(); err != nil { - return nil, fmt.Errorf("error iterating rows: %v", err) - } - - return resources, nil -} diff --git a/graphqlserver/server.go b/graphqlserver/server.go deleted file mode 100644 index 8e191aff..00000000 --- a/graphqlserver/server.go +++ /dev/null @@ -1,70 +0,0 @@ -package main - -import ( - "database/sql" - "log" - "net/http" - "os" - "time" - - "github.com/99designs/gqlgen/graphql/handler" - "github.com/99designs/gqlgen/graphql/playground" - "github.com/intelops/kubviz/client/pkg/clickhouse" - "github.com/intelops/kubviz/client/pkg/config" - "github.com/intelops/kubviz/graphqlserver/graph" - "github.com/kelseyhightower/envconfig" -) - -const defaultPort = "8085" -const ( - maxRetries = 5 - retryDelay = 5 * time.Second -) - -func main() { - log.Println("Graph ql server starting ... Iteration one") - cfg := &config.GraphQlConfig{} - if err := envconfig.Process("", cfg); err != nil { - log.Fatalf("Could not parse env Config: %v", err) - } - db, err := initializeDatabase(cfg) - if err != nil { - log.Fatalf("Failed to initialize database: %v", err) - } - resolver := graph.NewResolver(db) - port := os.Getenv("PORT") - if port == "" { - port = defaultPort - } - - srv := handler.NewDefaultServer(graph.NewExecutableSchema(graph.Config{Resolvers: resolver})) - - http.Handle("/", playground.Handler("GraphQL playground", "/query")) - http.Handle("/query", srv) - - log.Printf("connect to http://localhost:%s/ for GraphQL playground", port) - log.Fatal(http.ListenAndServe(":"+port, nil)) -} - -func initializeDatabase(cfg *config.GraphQlConfig) (*sql.DB, error) { - var db *sql.DB - var err error - var config = &config.Config{ - DbPort: cfg.DbPort, - DBAddress: cfg.DBAddress, - ClickHouseUsername: cfg.ClickHouseUsername, - ClickHousePassword: cfg.ClickHousePassword, - } - for i := 0; i < maxRetries; i++ { - _, db, err = clickhouse.NewDBClient(config) - if err == nil { - log.Println("Successfully connected to the database") - return db, nil - } - log.Printf("Failed to connect to database, retrying (%d/%d): %v", i+1, maxRetries, err) - time.Sleep(retryDelay) - } - - // If the loop exits and the connection is not established, return the error - return nil, err -} diff --git a/steps-to-test.txt b/steps-to-test.txt deleted file mode 100644 index f34bdfdd..00000000 --- a/steps-to-test.txt +++ /dev/null @@ -1,164 +0,0 @@ -for local testing: - -clone the repo - -in agent/kubviz/k8smetrics_agent.go file change the code like this - -`func main() { - env := Development - ` - -create a file named civo in the repo root directory - -paste your kubeconfig content in this file - -docker-compose up -d (to run agents and client) - -open postman , - -send a sample json to localhost:8090/github - -` -{ - "author":"intelops" -} -` -this will populate the git_json table - - -to populate the container_bridge table follow these steps - -docker pull ubuntu:latest -docker tag ubuntu:latest localhost:5001/ubuntu:v1 -docker push localhost:5001/ubuntu:v1 - - - -tables connected with namespace in common: outdated , kubescore , resources - -sample query: -query { - allNamespaceData { - namespace - outdatedImages { - clusterName - namespace - pod - currentImage - currentTag - latestVersion - versionsBehind - eventTime - } - kubeScores { - id - clusterName - objectName - kind - apiVersion - name - namespace - targetType - description - path - summary - fileName - fileRow - eventTime - } - resources { - clusterName - namespace - kind - resource - age - eventTime - } - } - } - - - sample response: - - { - "data": { - "allNamespaceData": [ - { - "namespace": "namespace1", - "outdatedImages": [ - { - "clusterName": "cluster1", - "namespace": "namespace1", - "pod": "pod1", - "currentImage": "image1:v1", - "currentTag": "v1", - "latestVersion": "v2", - "versionsBehind": 1, - "eventTime": "2022-01-01T12:00:00Z" - }, - // ... more outdatedImages for namespace1 ... - ], - "kubeScores": [ - { - "id": "ks1", - "clusterName": "cluster1", - "objectName": "object1", - "kind": "Deployment", - "apiVersion": "v1", - "name": "deployment1", - "namespace": "namespace1", - "targetType": "type1", - "description": "description1", - "path": "path1", - "summary": "summary1", - "fileName": "file1", - "fileRow": 10, - "eventTime": "2022-01-01T12:00:00Z" - }, - // ... more kubeScores for namespace1 ... - ], - "resources": [ - { - "clusterName": "cluster1", - "namespace": "namespace1", - "kind": "Pod", - "resource": "pod1", - "age": "10d", - "eventTime": "2022-01-01T12:00:00Z" - }, - // ... more resources for namespace1 ... - ] - }, - // ... more namespace data objects ... - ] - } - } - - ... - - - - resources - clusterName, namespace - - - MOM: - 1. filter by cluster name in the unique namespaces. - Vijesh - 2.Role id - is single (it is missed in create group request) - Anila - 3. Total no of users in group response is missing - get group - Nithu - 4. Role details missing in get group users response - Nithu - 5. Update group --> combine both the apis - vijesh (need to discuss with Iyappan) - - - - DONE: - outdated - events - - NOT DONE: - trivy_vul - - trivy_misconfig - trivyimage - only cluster name filter - kubescore - getall_resources - DeletedAPIs - by cluster name - depricated - by cluster name