diff --git a/apps/comms/Taskfile.yml b/apps/comms/Taskfile.yml
index 7aa001ba3..82e65c375 100644
--- a/apps/comms/Taskfile.yml
+++ b/apps/comms/Taskfile.yml
@@ -7,6 +7,33 @@ vars:
app: comms
tasks:
+ gql:
+ dir: ./internal/app
+ cmds:
+ - go run github.com/99designs/gqlgen generate
+ - gofmt -w -d -r '"errors" -> "github.com/kloudlite/api/pkg/errors"' graph/*.resolvers.go
+
+ k8s-schema:
+ cmds:
+ - mkdir -p "./internal/app/_struct-to-graphql"
+ - go run ../../cmd/struct-to-graphql
+ --struct github.com/kloudlite/api/apps/comms/internal/domain/entities.NotificationConf
+ --struct github.com/kloudlite/api/apps/comms/internal/domain/entities.Subscription
+ --struct github.com/kloudlite/api/apps/comms/types.Notification
+ --struct github.com/kloudlite/api/pkg/types.Pagination
+ --struct github.com/kloudlite/api/pkg/repos.MatchFilter
+ --struct github.com/kloudlite/api/pkg/repos.CursorPagination
+ > ./internal/app/_struct-to-graphql/main.go
+ - |+
+ pushd ./internal/app/_struct-to-graphql
+ go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination Notification
+ popd
+ - rm -rf ./internal/app/_struct-to-graphql
+
+
+ gen:constants:
+ cmds:
+ - go generate ./internal/domain/entities/field-constants/gen.go
run:
dotenv: [".secrets/env"]
cmds:
diff --git a/apps/comms/email-templates/alert/email.html b/apps/comms/email-templates/alert/email.html
new file mode 100644
index 000000000..9b46c01a9
--- /dev/null
+++ b/apps/comms/email-templates/alert/email.html
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+ |
+
+
+ |
+
+
+
+ |
+
+
+ |
+ {{.Type}}: {{.Titile}}
+ |
+
+
+ |
+ {{.Body}}
+ |
+
+
+ |
+
+ |
+
+
+
+ Alternatively, you can copy and paste the following URL into your browser: {{.Link}}
+ |
+
+
+ |
+ If you have any questions or need assistance, please don't hesitate to contact us.
+ |
+
+
+ |
+ - Team Kloudlite
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
diff --git a/apps/comms/email-templates/alert/email.mjml b/apps/comms/email-templates/alert/email.mjml
new file mode 100644
index 000000000..d74a7b5bd
--- /dev/null
+++ b/apps/comms/email-templates/alert/email.mjml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+ {{.Type}}: {{.Titile}}
+
+
+ {{.Body}}
+
+
+ View Alerts
+
+
+ Alternatively, you can copy and paste the following URL into your browser:
+ {{.Link}}
+
+
+ If you have any questions or need assistance, please don't hesitate to contact us.
+
+
+ - Team Kloudlite
+
+
+
+
+
+
diff --git a/apps/comms/email-templates/alert/email.txt b/apps/comms/email-templates/alert/email.txt
new file mode 100644
index 000000000..0a5ba62ac
--- /dev/null
+++ b/apps/comms/email-templates/alert/email.txt
@@ -0,0 +1,7 @@
+{{.Type}}: {{.Titile}}
+
+{{.Body}}
+
+If you have any questions or need assistance, please don't hesitate to contact us.
+
+- Team Kloudlite
diff --git a/apps/comms/internal/app/app.go b/apps/comms/internal/app/app.go
index d7908e52c..fe40df32b 100644
--- a/apps/comms/internal/app/app.go
+++ b/apps/comms/internal/app/app.go
@@ -1,80 +1,75 @@
package app
import (
- "embed"
- "fmt"
+ "context"
+
+ "github.com/99designs/gqlgen/graphql"
+ "github.com/gofiber/fiber/v2"
+ "github.com/kloudlite/api/constants"
+ httpServer "github.com/kloudlite/api/pkg/http-server"
+ "github.com/kloudlite/api/pkg/kv"
+
+ "github.com/kloudlite/api/apps/comms/internal/app/graph"
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/generated"
+ "github.com/kloudlite/api/apps/comms/internal/domain"
+
+ "github.com/kloudlite/api/apps/comms/internal/domain/entities"
+ "github.com/kloudlite/api/apps/comms/internal/env"
+ "github.com/kloudlite/api/apps/comms/types"
+ "github.com/kloudlite/api/common"
"github.com/kloudlite/api/pkg/errors"
- "text/template"
+ "github.com/kloudlite/api/pkg/logging"
+ "github.com/kloudlite/api/pkg/messaging"
+ msg_nats "github.com/kloudlite/api/pkg/messaging/nats"
+ "github.com/kloudlite/api/pkg/nats"
+ "github.com/kloudlite/api/pkg/repos"
"github.com/kloudlite/api/pkg/grpc"
"github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/comms"
+ "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam"
"go.uber.org/fx"
)
-type CommsGrpcServer grpc.Server
+type (
+ IAMGrpcClient grpc.Client
+)
+
+type NotificationConsumer messaging.Consumer
-type EmailTemplatesDir struct {
- embed.FS
-}
-
-type EmailTemplate struct {
- Subject string
- Html *template.Template
- PlainText *template.Template
-}
-
-type AccountInviteEmail *EmailTemplate
-type ProjectInviteEmail *EmailTemplate
-type RestPasswordEmail *EmailTemplate
-type UserVerificationEmail *EmailTemplate
-type WelcomeEmail *EmailTemplate
-type WaitingEmail *EmailTemplate
-
-func parseTemplate(et EmailTemplatesDir, templateName string, subject string) (*EmailTemplate, error) {
- txtFile, err := et.ReadFile(fmt.Sprintf("email-templates/%v/email.txt", templateName))
- if err != nil {
- return nil, errors.NewE(err)
- }
- txt, err := template.New("email-text").Parse(string(txtFile))
- if err != nil {
- return nil, errors.NewE(err)
- }
-
- htmlFile, err := et.ReadFile(fmt.Sprintf("email-templates/%v/email.html", templateName))
- if err != nil {
- return nil, errors.NewE(err)
- }
- html, err := template.New(templateName).Parse(string(htmlFile))
- if err != nil {
- return nil, errors.NewE(err)
- }
-
- return &EmailTemplate{
- Subject: subject,
- Html: html,
- PlainText: txt,
- }, nil
-}
+type CommsGrpcServer grpc.Server
var Module = fx.Module("app",
- fx.Provide(func(et EmailTemplatesDir) (AccountInviteEmail, error) {
- return parseTemplate(et, "account-invite", "[Kloudlite] Account Invite")
- }),
- fx.Provide(func(et EmailTemplatesDir) (ProjectInviteEmail, error) {
- return parseTemplate(et, "project-invite", "[Kloudlite] Project Invite")
- }),
- fx.Provide(func(et EmailTemplatesDir) (RestPasswordEmail, error) {
- return parseTemplate(et, "reset-password", "[Kloudlite] Reset Password")
- }),
- fx.Provide(func(et EmailTemplatesDir) (UserVerificationEmail, error) {
- return parseTemplate(et, "user-verification", "[Kloudlite] Verify Email")
- }),
- fx.Provide(func(et EmailTemplatesDir) (WelcomeEmail, error) {
- return parseTemplate(et, "welcome", "[Kloudlite] Welcome to Kloudlite")
+ repos.NewFxMongoRepo[*entities.NotificationConf]("nconfs", "prj", entities.NotificationConfIndexes),
+ repos.NewFxMongoRepo[*entities.Subscription]("subscriptions", "prj", entities.SubscriptionIndexes),
+ repos.NewFxMongoRepo[*types.Notification]("notifications", "prj", entities.SubscriptionIndexes),
+
+ domain.Module,
+
+ fx.Provide(func(jc *nats.JetstreamClient, ev *env.Env, logger logging.Logger) (NotificationConsumer, error) {
+ topic := string(common.NotificationTopicName)
+ consumerName := "ntfy:message"
+ return msg_nats.NewJetstreamConsumer(context.TODO(), jc, msg_nats.JetstreamConsumerArgs{
+ Stream: ev.NotificationNatsStream,
+ ConsumerConfig: msg_nats.ConsumerConfig{
+ Name: consumerName,
+ Durable: consumerName,
+ Description: "this consumer reads message from a subject dedicated to errors, that occurred when the resource was applied at the agent",
+ FilterSubjects: []string{
+ topic,
+ },
+ },
+ })
}),
- fx.Provide(func(et EmailTemplatesDir) (WaitingEmail, error) {
- return parseTemplate(et, "waiting", "[Kloudlite] Welcome to Kloudlite")
+
+ fx.Provide(
+ func(conn IAMGrpcClient) iam.IAMClient {
+ return iam.NewIAMClient(conn)
+ },
+ ),
+
+ fx.Provide(func(et domain.EmailTemplatesDir) (*domain.EmailTemplates, error) {
+ return domain.GetEmailTemplates(et)
}),
fx.Provide(newCommsSvc),
@@ -82,4 +77,66 @@ var Module = fx.Module("app",
fx.Invoke(func(server CommsGrpcServer, commsServer comms.CommsServer) {
comms.RegisterCommsServer(server, commsServer)
}),
+
+ fx.Provide(func(cli *nats.Client, logger logging.Logger) domain.ResourceEventPublisher {
+ return NewResourceEventPublisher(cli, logger)
+ }),
+
+ fx.Invoke(
+ func(server httpServer.Server, d domain.Domain, sessionRepo kv.Repo[*common.AuthSession], ev *env.Env) {
+ gqlConfig := generated.Config{Resolvers: &graph.Resolver{Domain: d, Env: ev}}
+
+ gqlConfig.Directives.IsLoggedInAndVerified = func(ctx context.Context, _ interface{}, next graphql.Resolver) (res interface{}, err error) {
+ sess := httpServer.GetSession[*common.AuthSession](ctx)
+ if sess == nil {
+ return nil, fiber.ErrUnauthorized
+ }
+
+ if !sess.UserVerified {
+ return nil, &fiber.Error{
+ Code: fiber.StatusForbidden,
+ Message: "user's email is not verified",
+ }
+ }
+
+ return next(context.WithValue(ctx, "user-session", sess))
+ }
+
+ gqlConfig.Directives.HasAccount = func(ctx context.Context, _ interface{}, next graphql.Resolver) (res interface{}, err error) {
+ sess := httpServer.GetSession[*common.AuthSession](ctx)
+ if sess == nil {
+ return nil, fiber.ErrUnauthorized
+ }
+ m := httpServer.GetHttpCookies(ctx)
+ klAccount := m[ev.AccountCookieName]
+ if klAccount == "" {
+ return nil, errors.Newf("no cookie named %q present in request", ev.AccountCookieName)
+ }
+
+ nctx := context.WithValue(ctx, "user-session", sess)
+ nctx = context.WithValue(nctx, "account-name", klAccount)
+ return next(nctx)
+ }
+
+ schema := generated.NewExecutableSchema(gqlConfig)
+ server.SetupGraphqlServer(schema, httpServer.NewReadSessionMiddleware(sessionRepo, constants.CookieName, constants.CacheSessionPrefix))
+ },
+ ),
+
+ fx.Invoke(func(lf fx.Lifecycle, consumer NotificationConsumer, d domain.Domain, logr logging.Logger) {
+ lf.Append(fx.Hook{
+ OnStart: func(ctx context.Context) error {
+ go func() {
+ err := processNotification(ctx, d, consumer, logr)
+ if err != nil {
+ logr.Errorf(err, "could not process notifications")
+ }
+ }()
+ return nil
+ },
+ OnStop: func(ctx context.Context) error {
+ return nil
+ },
+ })
+ }),
)
diff --git a/apps/comms/internal/app/gqlgen.yml b/apps/comms/internal/app/gqlgen.yml
new file mode 100644
index 000000000..b7800e568
--- /dev/null
+++ b/apps/comms/internal/app/gqlgen.yml
@@ -0,0 +1,114 @@
+# Where are all the schema files located? globs are supported eg src/**/*.graphqls
+schema:
+ - graph/*.graphqls
+ - graph/struct-to-graphql/*.graphqls
+
+# Where should the generated server code go?
+exec:
+ filename: graph/generated/generated.go
+ package: generated
+
+# Uncomment to enable federation
+federation:
+ filename: graph/generated/federation.go
+ package: generated
+ version: 2
+
+# 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
+
+# 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: set to speed up generation time by not performing a final validation pass.
+# skip_validation: 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/kloudlite/api/pkg/errors"
+ # - "github.com/kloudlite/api/apps/wireguard/internal/domain/entities"
+
+# 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
+skip_mod_tidy: true
+skip_validation: true
+
+models:
+ Metadata: &metadata-model
+ model: k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta
+ MetadataIn: *metadata-model
+
+ ID:
+ model:
+ - github.com/kloudlite/api/pkg/repos.ID
+
+ Int:
+ model:
+ - github.com/99designs/gqlgen/graphql.Int
+ - github.com/99designs/gqlgen/graphql.Int64
+ - github.com/99designs/gqlgen/graphql.Int32
+
+ Json:
+ model:
+ - github.com/99designs/gqlgen/graphql.Map
+
+ Subscription: &subscription-model
+ model:
+ - github.com/kloudlite/api/apps/comms/internal/domain/entities.Subscription
+ SubscriptionIn: *subscription-model
+
+ NotificationConf: ¬ification-conf-model
+ model:
+ - github.com/kloudlite/api/apps/comms/internal/domain/entities.NotificationConf
+ NotificationConfIn: *notification-conf-model
+
+ Notification: ¬ification-model
+ model:
+ - github.com/kloudlite/api/apps/comms/types.Notification
+ NotificationIn: *notification-model
+
+ Pagination: &pagination
+ model:
+ - github.com/kloudlite/api/pkg/types.Pagination
+ PaginationIn: *pagination
+
+
+ MatchFilter: &match-filter-model
+ model: github.com/kloudlite/api/pkg/repos.MatchFilter
+ MatchFilterIn: *match-filter-model
+
+ MatchFilterMatchType:
+ model: github.com/kloudlite/api/pkg/repos.MatchType
+
+ CursorPagination: &cursor-pagination-model
+ model: github.com/kloudlite/api/pkg/repos.CursorPagination
+ CursorPaginationIn: *cursor-pagination-model
+
+ CursorPaginationSortDirection: &cursor-pagination-sort-direction
+ model: github.com/kloudlite/api/pkg/repos.SortDirection
+
+ Overrides:
+ model:
+ - github.com/kloudlite/operator/apis/crds/v1.JsonPatch
+ OverridesIn:
+ model:
+ - github.com/kloudlite/operator/apis/crds/v1.JsonPatch
+
+ Github__com___kloudlite___api___common__CreatedOrUpdatedBy:
+ model: github.com/kloudlite/api/common.CreatedOrUpdatedBy
+
diff --git a/apps/comms/internal/app/graph/common-types.resolvers.go b/apps/comms/internal/app/graph/common-types.resolvers.go
new file mode 100644
index 000000000..78d98baf0
--- /dev/null
+++ b/apps/comms/internal/app/graph/common-types.resolvers.go
@@ -0,0 +1,29 @@
+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.45
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/generated"
+ "github.com/kloudlite/api/common"
+)
+
+// UserID is the resolver for the userId field.
+func (r *github__com___kloudlite___api___common__CreatedOrUpdatedByResolver) UserID(ctx context.Context, obj *common.CreatedOrUpdatedBy) (string, error) {
+ if obj == nil {
+ return "", fmt.Errorf("obj is nil")
+ }
+
+ return string(obj.UserId), nil
+}
+
+// Github__com___kloudlite___api___common__CreatedOrUpdatedBy returns generated.Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver implementation.
+func (r *Resolver) Github__com___kloudlite___api___common__CreatedOrUpdatedBy() generated.Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver {
+ return &github__com___kloudlite___api___common__CreatedOrUpdatedByResolver{r}
+}
+
+type github__com___kloudlite___api___common__CreatedOrUpdatedByResolver struct{ *Resolver }
diff --git a/apps/comms/internal/app/graph/generated/federation.go b/apps/comms/internal/app/graph/generated/federation.go
new file mode 100644
index 000000000..1116a0266
--- /dev/null
+++ b/apps/comms/internal/app/graph/generated/federation.go
@@ -0,0 +1,35 @@
+// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
+
+package generated
+
+import (
+ "context"
+ "errors"
+ "strings"
+
+ "github.com/99designs/gqlgen/plugin/federation/fedruntime"
+)
+
+var (
+ ErrUnknownType = errors.New("unknown type")
+ ErrTypeNotFound = errors.New("type not found")
+)
+
+func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) {
+ if ec.DisableIntrospection {
+ return fedruntime.Service{}, errors.New("federated introspection disabled")
+ }
+
+ var sdl []string
+
+ for _, src := range sources {
+ if src.BuiltIn {
+ continue
+ }
+ sdl = append(sdl, src.Input)
+ }
+
+ return fedruntime.Service{
+ SDL: strings.Join(sdl, "\n"),
+ }, nil
+}
diff --git a/apps/comms/internal/app/graph/generated/generated.go b/apps/comms/internal/app/graph/generated/generated.go
new file mode 100644
index 000000000..420a45ef0
--- /dev/null
+++ b/apps/comms/internal/app/graph/generated/generated.go
@@ -0,0 +1,10423 @@
+// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
+
+package generated
+
+import (
+ "bytes"
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "strconv"
+ "sync"
+ "sync/atomic"
+
+ "github.com/99designs/gqlgen/graphql"
+ "github.com/99designs/gqlgen/graphql/introspection"
+ "github.com/99designs/gqlgen/plugin/federation/fedruntime"
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/model"
+ "github.com/kloudlite/api/apps/comms/internal/domain/entities"
+ "github.com/kloudlite/api/apps/comms/types"
+ "github.com/kloudlite/api/common"
+ "github.com/kloudlite/api/pkg/repos"
+ types1 "github.com/kloudlite/api/pkg/types"
+ 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 {
+ Github__com___kloudlite___api___common__CreatedOrUpdatedBy() Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver
+ MatchFilter() MatchFilterResolver
+ Mutation() MutationResolver
+ Notification() NotificationResolver
+ NotificationConf() NotificationConfResolver
+ Query() QueryResolver
+ Subscription() SubscriptionResolver
+ MatchFilterIn() MatchFilterInResolver
+ NotificationConfIn() NotificationConfInResolver
+}
+
+type DirectiveRoot struct {
+ HasAccount func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
+ IsLoggedInAndVerified func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
+}
+
+type ComplexityRoot struct {
+ CursorPagination struct {
+ After func(childComplexity int) int
+ Before func(childComplexity int) int
+ First func(childComplexity int) int
+ Last func(childComplexity int) int
+ OrderBy func(childComplexity int) int
+ SortDirection func(childComplexity int) int
+ }
+
+ Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email struct {
+ Enabled func(childComplexity int) int
+ MailAddress func(childComplexity int) int
+ }
+
+ Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack struct {
+ Enabled func(childComplexity int) int
+ URL func(childComplexity int) int
+ }
+
+ Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram struct {
+ ChatID func(childComplexity int) int
+ Enabled func(childComplexity int) int
+ Token func(childComplexity int) int
+ }
+
+ Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook struct {
+ Enabled func(childComplexity int) int
+ URL func(childComplexity int) int
+ }
+
+ Github__com___kloudlite___api___apps___comms___types__NotifyContent struct {
+ Body func(childComplexity int) int
+ Image func(childComplexity int) int
+ Link func(childComplexity int) int
+ Subject func(childComplexity int) int
+ Title func(childComplexity int) int
+ }
+
+ Github__com___kloudlite___api___common__CreatedOrUpdatedBy struct {
+ UserEmail func(childComplexity int) int
+ UserID func(childComplexity int) int
+ UserName func(childComplexity int) int
+ }
+
+ MatchFilter struct {
+ Array func(childComplexity int) int
+ Exact func(childComplexity int) int
+ MatchType func(childComplexity int) int
+ NotInArray func(childComplexity int) int
+ Regex func(childComplexity int) int
+ }
+
+ Mutation struct {
+ CommsMarkNotificationAsRead func(childComplexity int, id repos.ID) int
+ CommsUpdateNotificationConfig func(childComplexity int, config entities.NotificationConf) int
+ CommsUpdateSubscriptionConfig func(childComplexity int, config entities.Subscription, id repos.ID) int
+ }
+
+ Notification struct {
+ AccountName func(childComplexity int) int
+ Content func(childComplexity int) int
+ CreationTime func(childComplexity int) int
+ Id func(childComplexity int) int
+ MarkedForDeletion func(childComplexity int) int
+ NotificationType func(childComplexity int) int
+ Priority func(childComplexity int) int
+ Read func(childComplexity int) int
+ RecordVersion func(childComplexity int) int
+ UpdateTime func(childComplexity int) int
+ }
+
+ NotificationConf struct {
+ AccountName func(childComplexity int) int
+ CreatedBy func(childComplexity int) int
+ CreationTime func(childComplexity int) int
+ Email func(childComplexity int) int
+ Id func(childComplexity int) int
+ LastUpdatedBy func(childComplexity int) int
+ MarkedForDeletion func(childComplexity int) int
+ RecordVersion func(childComplexity int) int
+ Slack func(childComplexity int) int
+ Telegram func(childComplexity int) int
+ UpdateTime func(childComplexity int) int
+ Webhook func(childComplexity int) int
+ }
+
+ NotificationEdge struct {
+ Cursor func(childComplexity int) int
+ Node func(childComplexity int) int
+ }
+
+ NotificationPaginatedRecords struct {
+ Edges func(childComplexity int) int
+ PageInfo func(childComplexity int) int
+ TotalCount func(childComplexity int) int
+ }
+
+ PageInfo struct {
+ EndCursor func(childComplexity int) int
+ HasNextPage func(childComplexity int) int
+ HasPreviousPage func(childComplexity int) int
+ StartCursor func(childComplexity int) int
+ }
+
+ Pagination struct {
+ Page func(childComplexity int) int
+ PerPage func(childComplexity int) int
+ }
+
+ Query struct {
+ CommsGetNotificationConfig func(childComplexity int) int
+ CommsGetSubscriptionConfig func(childComplexity int, id repos.ID) int
+ CommsListNotifications func(childComplexity int, pagination *repos.CursorPagination) int
+ __resolve__service func(childComplexity int) int
+ }
+
+ Subscription struct {
+ AccountName func(childComplexity int) int
+ CreatedBy func(childComplexity int) int
+ CreationTime func(childComplexity int) int
+ Enabled func(childComplexity int) int
+ ID func(childComplexity int) int
+ LastUpdatedBy func(childComplexity int) int
+ MailAddress func(childComplexity int) int
+ MarkedForDeletion func(childComplexity int) int
+ RecordVersion func(childComplexity int) int
+ UpdateTime func(childComplexity int) int
+ }
+
+ _Service struct {
+ SDL func(childComplexity int) int
+ }
+}
+
+type Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver interface {
+ UserID(ctx context.Context, obj *common.CreatedOrUpdatedBy) (string, error)
+}
+type MatchFilterResolver interface {
+ MatchType(ctx context.Context, obj *repos.MatchFilter) (model.GithubComKloudliteAPIPkgReposMatchType, error)
+}
+type MutationResolver interface {
+ CommsUpdateNotificationConfig(ctx context.Context, config entities.NotificationConf) (*entities.NotificationConf, error)
+ CommsUpdateSubscriptionConfig(ctx context.Context, config entities.Subscription, id repos.ID) (*entities.Subscription, error)
+ CommsMarkNotificationAsRead(ctx context.Context, id repos.ID) (*types.Notification, error)
+}
+type NotificationResolver interface {
+ Content(ctx context.Context, obj *types.Notification) (*model.GithubComKloudliteAPIAppsCommsTypesNotifyContent, error)
+ CreationTime(ctx context.Context, obj *types.Notification) (string, error)
+
+ NotificationType(ctx context.Context, obj *types.Notification) (model.GithubComKloudliteAPIAppsCommsTypesNotificationType, error)
+
+ UpdateTime(ctx context.Context, obj *types.Notification) (string, error)
+}
+type NotificationConfResolver interface {
+ CreationTime(ctx context.Context, obj *entities.NotificationConf) (string, error)
+ Email(ctx context.Context, obj *entities.NotificationConf) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail, error)
+
+ Slack(ctx context.Context, obj *entities.NotificationConf) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack, error)
+ Telegram(ctx context.Context, obj *entities.NotificationConf) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram, error)
+ UpdateTime(ctx context.Context, obj *entities.NotificationConf) (string, error)
+ Webhook(ctx context.Context, obj *entities.NotificationConf) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook, error)
+}
+type QueryResolver interface {
+ CommsListNotifications(ctx context.Context, pagination *repos.CursorPagination) (*model.NotificationPaginatedRecords, error)
+ CommsGetNotificationConfig(ctx context.Context) (*entities.NotificationConf, error)
+ CommsGetSubscriptionConfig(ctx context.Context, id repos.ID) (*entities.Subscription, error)
+}
+type SubscriptionResolver interface {
+ AccountName(ctx context.Context) (<-chan string, error)
+ CreatedBy(ctx context.Context) (<-chan *common.CreatedOrUpdatedBy, error)
+ CreationTime(ctx context.Context) (<-chan string, error)
+ Enabled(ctx context.Context) (<-chan bool, error)
+ ID(ctx context.Context) (<-chan repos.ID, error)
+ LastUpdatedBy(ctx context.Context) (<-chan *common.CreatedOrUpdatedBy, error)
+ MailAddress(ctx context.Context) (<-chan string, error)
+ MarkedForDeletion(ctx context.Context) (<-chan *bool, error)
+ RecordVersion(ctx context.Context) (<-chan int, error)
+ UpdateTime(ctx context.Context) (<-chan string, error)
+}
+
+type MatchFilterInResolver interface {
+ MatchType(ctx context.Context, obj *repos.MatchFilter, data model.GithubComKloudliteAPIPkgReposMatchType) error
+}
+type NotificationConfInResolver interface {
+ Email(ctx context.Context, obj *entities.NotificationConf, data *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmailIn) error
+ Slack(ctx context.Context, obj *entities.NotificationConf, data *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlackIn) error
+ Telegram(ctx context.Context, obj *entities.NotificationConf, data *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegramIn) error
+ Webhook(ctx context.Context, obj *entities.NotificationConf, data *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhookIn) 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 "CursorPagination.after":
+ if e.complexity.CursorPagination.After == nil {
+ break
+ }
+
+ return e.complexity.CursorPagination.After(childComplexity), true
+
+ case "CursorPagination.before":
+ if e.complexity.CursorPagination.Before == nil {
+ break
+ }
+
+ return e.complexity.CursorPagination.Before(childComplexity), true
+
+ case "CursorPagination.first":
+ if e.complexity.CursorPagination.First == nil {
+ break
+ }
+
+ return e.complexity.CursorPagination.First(childComplexity), true
+
+ case "CursorPagination.last":
+ if e.complexity.CursorPagination.Last == nil {
+ break
+ }
+
+ return e.complexity.CursorPagination.Last(childComplexity), true
+
+ case "CursorPagination.orderBy":
+ if e.complexity.CursorPagination.OrderBy == nil {
+ break
+ }
+
+ return e.complexity.CursorPagination.OrderBy(childComplexity), true
+
+ case "CursorPagination.sortDirection":
+ if e.complexity.CursorPagination.SortDirection == nil {
+ break
+ }
+
+ return e.complexity.CursorPagination.SortDirection(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email.enabled":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email.Enabled == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email.Enabled(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email.mailAddress":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email.MailAddress == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email.MailAddress(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack.enabled":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack.Enabled == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack.Enabled(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack.url":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack.URL == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack.URL(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram.chatId":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram.ChatID == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram.ChatID(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram.enabled":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram.Enabled == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram.Enabled(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram.token":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram.Token == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram.Token(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook.enabled":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook.Enabled == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook.Enabled(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook.url":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook.URL == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook.URL(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___types__NotifyContent.body":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___types__NotifyContent.Body == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___types__NotifyContent.Body(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___types__NotifyContent.image":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___types__NotifyContent.Image == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___types__NotifyContent.Image(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___types__NotifyContent.link":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___types__NotifyContent.Link == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___types__NotifyContent.Link(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___types__NotifyContent.subject":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___types__NotifyContent.Subject == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___types__NotifyContent.Subject(childComplexity), true
+
+ case "Github__com___kloudlite___api___apps___comms___types__NotifyContent.title":
+ if e.complexity.Github__com___kloudlite___api___apps___comms___types__NotifyContent.Title == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___apps___comms___types__NotifyContent.Title(childComplexity), true
+
+ case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userEmail":
+ if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserEmail == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserEmail(childComplexity), true
+
+ case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userId":
+ if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserID == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserID(childComplexity), true
+
+ case "Github__com___kloudlite___api___common__CreatedOrUpdatedBy.userName":
+ if e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserName == nil {
+ break
+ }
+
+ return e.complexity.Github__com___kloudlite___api___common__CreatedOrUpdatedBy.UserName(childComplexity), true
+
+ case "MatchFilter.array":
+ if e.complexity.MatchFilter.Array == nil {
+ break
+ }
+
+ return e.complexity.MatchFilter.Array(childComplexity), true
+
+ case "MatchFilter.exact":
+ if e.complexity.MatchFilter.Exact == nil {
+ break
+ }
+
+ return e.complexity.MatchFilter.Exact(childComplexity), true
+
+ case "MatchFilter.matchType":
+ if e.complexity.MatchFilter.MatchType == nil {
+ break
+ }
+
+ return e.complexity.MatchFilter.MatchType(childComplexity), true
+
+ case "MatchFilter.notInArray":
+ if e.complexity.MatchFilter.NotInArray == nil {
+ break
+ }
+
+ return e.complexity.MatchFilter.NotInArray(childComplexity), true
+
+ case "MatchFilter.regex":
+ if e.complexity.MatchFilter.Regex == nil {
+ break
+ }
+
+ return e.complexity.MatchFilter.Regex(childComplexity), true
+
+ case "Mutation.comms_markNotificationAsRead":
+ if e.complexity.Mutation.CommsMarkNotificationAsRead == nil {
+ break
+ }
+
+ args, err := ec.field_Mutation_comms_markNotificationAsRead_args(context.TODO(), rawArgs)
+ if err != nil {
+ return 0, false
+ }
+
+ return e.complexity.Mutation.CommsMarkNotificationAsRead(childComplexity, args["id"].(repos.ID)), true
+
+ case "Mutation.comms_updateNotificationConfig":
+ if e.complexity.Mutation.CommsUpdateNotificationConfig == nil {
+ break
+ }
+
+ args, err := ec.field_Mutation_comms_updateNotificationConfig_args(context.TODO(), rawArgs)
+ if err != nil {
+ return 0, false
+ }
+
+ return e.complexity.Mutation.CommsUpdateNotificationConfig(childComplexity, args["config"].(entities.NotificationConf)), true
+
+ case "Mutation.comms_updateSubscriptionConfig":
+ if e.complexity.Mutation.CommsUpdateSubscriptionConfig == nil {
+ break
+ }
+
+ args, err := ec.field_Mutation_comms_updateSubscriptionConfig_args(context.TODO(), rawArgs)
+ if err != nil {
+ return 0, false
+ }
+
+ return e.complexity.Mutation.CommsUpdateSubscriptionConfig(childComplexity, args["config"].(entities.Subscription), args["id"].(repos.ID)), true
+
+ case "Notification.accountName":
+ if e.complexity.Notification.AccountName == nil {
+ break
+ }
+
+ return e.complexity.Notification.AccountName(childComplexity), true
+
+ case "Notification.content":
+ if e.complexity.Notification.Content == nil {
+ break
+ }
+
+ return e.complexity.Notification.Content(childComplexity), true
+
+ case "Notification.creationTime":
+ if e.complexity.Notification.CreationTime == nil {
+ break
+ }
+
+ return e.complexity.Notification.CreationTime(childComplexity), true
+
+ case "Notification.id":
+ if e.complexity.Notification.Id == nil {
+ break
+ }
+
+ return e.complexity.Notification.Id(childComplexity), true
+
+ case "Notification.markedForDeletion":
+ if e.complexity.Notification.MarkedForDeletion == nil {
+ break
+ }
+
+ return e.complexity.Notification.MarkedForDeletion(childComplexity), true
+
+ case "Notification.notificationType":
+ if e.complexity.Notification.NotificationType == nil {
+ break
+ }
+
+ return e.complexity.Notification.NotificationType(childComplexity), true
+
+ case "Notification.priority":
+ if e.complexity.Notification.Priority == nil {
+ break
+ }
+
+ return e.complexity.Notification.Priority(childComplexity), true
+
+ case "Notification.read":
+ if e.complexity.Notification.Read == nil {
+ break
+ }
+
+ return e.complexity.Notification.Read(childComplexity), true
+
+ case "Notification.recordVersion":
+ if e.complexity.Notification.RecordVersion == nil {
+ break
+ }
+
+ return e.complexity.Notification.RecordVersion(childComplexity), true
+
+ case "Notification.updateTime":
+ if e.complexity.Notification.UpdateTime == nil {
+ break
+ }
+
+ return e.complexity.Notification.UpdateTime(childComplexity), true
+
+ case "NotificationConf.accountName":
+ if e.complexity.NotificationConf.AccountName == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.AccountName(childComplexity), true
+
+ case "NotificationConf.createdBy":
+ if e.complexity.NotificationConf.CreatedBy == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.CreatedBy(childComplexity), true
+
+ case "NotificationConf.creationTime":
+ if e.complexity.NotificationConf.CreationTime == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.CreationTime(childComplexity), true
+
+ case "NotificationConf.email":
+ if e.complexity.NotificationConf.Email == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.Email(childComplexity), true
+
+ case "NotificationConf.id":
+ if e.complexity.NotificationConf.Id == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.Id(childComplexity), true
+
+ case "NotificationConf.lastUpdatedBy":
+ if e.complexity.NotificationConf.LastUpdatedBy == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.LastUpdatedBy(childComplexity), true
+
+ case "NotificationConf.markedForDeletion":
+ if e.complexity.NotificationConf.MarkedForDeletion == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.MarkedForDeletion(childComplexity), true
+
+ case "NotificationConf.recordVersion":
+ if e.complexity.NotificationConf.RecordVersion == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.RecordVersion(childComplexity), true
+
+ case "NotificationConf.slack":
+ if e.complexity.NotificationConf.Slack == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.Slack(childComplexity), true
+
+ case "NotificationConf.telegram":
+ if e.complexity.NotificationConf.Telegram == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.Telegram(childComplexity), true
+
+ case "NotificationConf.updateTime":
+ if e.complexity.NotificationConf.UpdateTime == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.UpdateTime(childComplexity), true
+
+ case "NotificationConf.webhook":
+ if e.complexity.NotificationConf.Webhook == nil {
+ break
+ }
+
+ return e.complexity.NotificationConf.Webhook(childComplexity), true
+
+ case "NotificationEdge.cursor":
+ if e.complexity.NotificationEdge.Cursor == nil {
+ break
+ }
+
+ return e.complexity.NotificationEdge.Cursor(childComplexity), true
+
+ case "NotificationEdge.node":
+ if e.complexity.NotificationEdge.Node == nil {
+ break
+ }
+
+ return e.complexity.NotificationEdge.Node(childComplexity), true
+
+ case "NotificationPaginatedRecords.edges":
+ if e.complexity.NotificationPaginatedRecords.Edges == nil {
+ break
+ }
+
+ return e.complexity.NotificationPaginatedRecords.Edges(childComplexity), true
+
+ case "NotificationPaginatedRecords.pageInfo":
+ if e.complexity.NotificationPaginatedRecords.PageInfo == nil {
+ break
+ }
+
+ return e.complexity.NotificationPaginatedRecords.PageInfo(childComplexity), true
+
+ case "NotificationPaginatedRecords.totalCount":
+ if e.complexity.NotificationPaginatedRecords.TotalCount == nil {
+ break
+ }
+
+ return e.complexity.NotificationPaginatedRecords.TotalCount(childComplexity), true
+
+ case "PageInfo.endCursor":
+ if e.complexity.PageInfo.EndCursor == nil {
+ break
+ }
+
+ return e.complexity.PageInfo.EndCursor(childComplexity), true
+
+ case "PageInfo.hasNextPage":
+ if e.complexity.PageInfo.HasNextPage == nil {
+ break
+ }
+
+ return e.complexity.PageInfo.HasNextPage(childComplexity), true
+
+ case "PageInfo.hasPreviousPage":
+ if e.complexity.PageInfo.HasPreviousPage == nil {
+ break
+ }
+
+ return e.complexity.PageInfo.HasPreviousPage(childComplexity), true
+
+ case "PageInfo.startCursor":
+ if e.complexity.PageInfo.StartCursor == nil {
+ break
+ }
+
+ return e.complexity.PageInfo.StartCursor(childComplexity), true
+
+ case "Pagination.page":
+ if e.complexity.Pagination.Page == nil {
+ break
+ }
+
+ return e.complexity.Pagination.Page(childComplexity), true
+
+ case "Pagination.per_page":
+ if e.complexity.Pagination.PerPage == nil {
+ break
+ }
+
+ return e.complexity.Pagination.PerPage(childComplexity), true
+
+ case "Query.comms_getNotificationConfig":
+ if e.complexity.Query.CommsGetNotificationConfig == nil {
+ break
+ }
+
+ return e.complexity.Query.CommsGetNotificationConfig(childComplexity), true
+
+ case "Query.comms_getSubscriptionConfig":
+ if e.complexity.Query.CommsGetSubscriptionConfig == nil {
+ break
+ }
+
+ args, err := ec.field_Query_comms_getSubscriptionConfig_args(context.TODO(), rawArgs)
+ if err != nil {
+ return 0, false
+ }
+
+ return e.complexity.Query.CommsGetSubscriptionConfig(childComplexity, args["id"].(repos.ID)), true
+
+ case "Query.comms_listNotifications":
+ if e.complexity.Query.CommsListNotifications == nil {
+ break
+ }
+
+ args, err := ec.field_Query_comms_listNotifications_args(context.TODO(), rawArgs)
+ if err != nil {
+ return 0, false
+ }
+
+ return e.complexity.Query.CommsListNotifications(childComplexity, args["pagination"].(*repos.CursorPagination)), true
+
+ case "Query._service":
+ if e.complexity.Query.__resolve__service == nil {
+ break
+ }
+
+ return e.complexity.Query.__resolve__service(childComplexity), true
+
+ case "Subscription.accountName":
+ if e.complexity.Subscription.AccountName == nil {
+ break
+ }
+
+ return e.complexity.Subscription.AccountName(childComplexity), true
+
+ case "Subscription.createdBy":
+ if e.complexity.Subscription.CreatedBy == nil {
+ break
+ }
+
+ return e.complexity.Subscription.CreatedBy(childComplexity), true
+
+ case "Subscription.creationTime":
+ if e.complexity.Subscription.CreationTime == nil {
+ break
+ }
+
+ return e.complexity.Subscription.CreationTime(childComplexity), true
+
+ case "Subscription.enabled":
+ if e.complexity.Subscription.Enabled == nil {
+ break
+ }
+
+ return e.complexity.Subscription.Enabled(childComplexity), true
+
+ case "Subscription.id":
+ if e.complexity.Subscription.ID == nil {
+ break
+ }
+
+ return e.complexity.Subscription.ID(childComplexity), true
+
+ case "Subscription.lastUpdatedBy":
+ if e.complexity.Subscription.LastUpdatedBy == nil {
+ break
+ }
+
+ return e.complexity.Subscription.LastUpdatedBy(childComplexity), true
+
+ case "Subscription.mailAddress":
+ if e.complexity.Subscription.MailAddress == nil {
+ break
+ }
+
+ return e.complexity.Subscription.MailAddress(childComplexity), true
+
+ case "Subscription.markedForDeletion":
+ if e.complexity.Subscription.MarkedForDeletion == nil {
+ break
+ }
+
+ return e.complexity.Subscription.MarkedForDeletion(childComplexity), true
+
+ case "Subscription.recordVersion":
+ if e.complexity.Subscription.RecordVersion == nil {
+ break
+ }
+
+ return e.complexity.Subscription.RecordVersion(childComplexity), true
+
+ case "Subscription.updateTime":
+ if e.complexity.Subscription.UpdateTime == nil {
+ break
+ }
+
+ return e.complexity.Subscription.UpdateTime(childComplexity), true
+
+ case "_Service.sdl":
+ if e.complexity._Service.SDL == nil {
+ break
+ }
+
+ return e.complexity._Service.SDL(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(
+ ec.unmarshalInputCursorPaginationIn,
+ ec.unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__EmailIn,
+ ec.unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__SlackIn,
+ ec.unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramIn,
+ ec.unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookIn,
+ ec.unmarshalInputMatchFilterIn,
+ ec.unmarshalInputNotificationConfIn,
+ ec.unmarshalInputPaginationIn,
+ ec.unmarshalInputSubscriptionIn,
+ )
+ 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
+ }
+ case ast.Mutation:
+ return func(ctx context.Context) *graphql.Response {
+ if !first {
+ return nil
+ }
+ first = false
+ ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap)
+ data := ec._Mutation(ctx, rc.Operation.SelectionSet)
+ var buf bytes.Buffer
+ data.MarshalGQL(&buf)
+
+ return &graphql.Response{
+ Data: buf.Bytes(),
+ }
+ }
+ case ast.Subscription:
+ next := ec._Subscription(ctx, rc.Operation.SelectionSet)
+
+ var buf bytes.Buffer
+ return func(ctx context.Context) *graphql.Response {
+ buf.Reset()
+ data := next(ctx)
+
+ if data == nil {
+ return nil
+ }
+ data.MarshalGQL(&buf)
+
+ return &graphql.Response{
+ Data: buf.Bytes(),
+ }
+ }
+
+ 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
+}
+
+var sources = []*ast.Source{
+ {Name: "../schema.graphqls", Input: `directive @isLoggedInAndVerified on FIELD_DEFINITION
+directive @hasAccount on FIELD_DEFINITION
+
+type Query {
+ comms_listNotifications(pagination: CursorPaginationIn): NotificationPaginatedRecords @isLoggedInAndVerified @hasAccount
+ comms_getNotificationConfig: NotificationConf @isLoggedInAndVerified @hasAccount
+ comms_getSubscriptionConfig(id: ID!): Subscription
+}
+
+type Mutation {
+ comms_updateNotificationConfig(config: NotificationConfIn!): NotificationConf @isLoggedInAndVerified @hasAccount
+ comms_updateSubscriptionConfig(config: SubscriptionIn!, id: ID!): Subscription
+
+ comms_markNotificationAsRead(id: ID!): Notification @isLoggedInAndVerified @hasAccount
+}
+`, BuiltIn: false},
+ {Name: "../struct-to-graphql/common-types.graphqls", Input: `type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email @shareable {
+ enabled: Boolean!
+ mailAddress: String!
+}
+
+type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack @shareable {
+ enabled: Boolean!
+ url: String!
+}
+
+type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram @shareable {
+ chatId: String!
+ enabled: Boolean!
+ token: String!
+}
+
+type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook @shareable {
+ enabled: Boolean!
+ url: String!
+}
+
+type Github__com___kloudlite___api___apps___comms___types__NotifyContent @shareable {
+ body: String!
+ image: String!
+ link: String!
+ subject: String!
+ title: String!
+}
+
+type Github__com___kloudlite___api___common__CreatedOrUpdatedBy @shareable {
+ userEmail: String!
+ userId: String!
+ userName: String!
+}
+
+type PageInfo @shareable {
+ endCursor: String
+ hasNextPage: Boolean
+ hasPreviousPage: Boolean
+ startCursor: String
+}
+
+input Github__com___kloudlite___api___apps___comms___internal___domain___entities__EmailIn {
+ enabled: Boolean!
+ mailAddress: String!
+}
+
+input Github__com___kloudlite___api___apps___comms___internal___domain___entities__SlackIn {
+ enabled: Boolean!
+ url: String!
+}
+
+input Github__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramIn {
+ chatId: String!
+ enabled: Boolean!
+ token: String!
+}
+
+input Github__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookIn {
+ enabled: Boolean!
+ url: String!
+}
+
+enum Github__com___kloudlite___api___apps___comms___types__NotificationType {
+ alert
+ notification
+}
+
+enum Github__com___kloudlite___api___pkg___repos__MatchType {
+ array
+ exact
+ not_in_array
+ regex
+}
+
+`, BuiltIn: false},
+ {Name: "../struct-to-graphql/cursorpagination.graphqls", Input: `type CursorPagination @shareable {
+ after: String
+ before: String
+ first: Int
+ last: Int
+ orderBy: String
+ sortDirection: CursorPaginationSortDirection
+}
+
+input CursorPaginationIn {
+ after: String
+ before: String
+ first: Int
+ last: Int
+ orderBy: String = "_id"
+ sortDirection: CursorPaginationSortDirection = "ASC"
+}
+
+enum CursorPaginationSortDirection {
+ ASC
+ DESC
+}
+
+`, BuiltIn: false},
+ {Name: "../struct-to-graphql/directives.graphqls", Input: `extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"])
+
+directive @goField(
+ forceResolver: Boolean
+ name: String
+) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION
+`, BuiltIn: false},
+ {Name: "../struct-to-graphql/matchfilter.graphqls", Input: `type MatchFilter @shareable {
+ array: [Any!]
+ exact: Any
+ matchType: Github__com___kloudlite___api___pkg___repos__MatchType!
+ notInArray: [Any!]
+ regex: String
+}
+
+input MatchFilterIn {
+ array: [Any!]
+ exact: Any
+ matchType: Github__com___kloudlite___api___pkg___repos__MatchType!
+ notInArray: [Any!]
+ regex: String
+}
+
+`, BuiltIn: false},
+ {Name: "../struct-to-graphql/notification.graphqls", Input: `type Notification @shareable {
+ accountName: String!
+ content: Github__com___kloudlite___api___apps___comms___types__NotifyContent!
+ creationTime: Date!
+ id: ID!
+ markedForDeletion: Boolean
+ notificationType: Github__com___kloudlite___api___apps___comms___types__NotificationType!
+ priority: Int!
+ read: Boolean!
+ recordVersion: Int!
+ updateTime: Date!
+}
+
+type NotificationEdge @shareable {
+ cursor: String!
+ node: Notification!
+}
+
+type NotificationPaginatedRecords @shareable {
+ edges: [NotificationEdge!]!
+ pageInfo: PageInfo!
+ totalCount: Int!
+}
+
+`, BuiltIn: false},
+ {Name: "../struct-to-graphql/notificationconf.graphqls", Input: `type NotificationConf @shareable {
+ accountName: String!
+ createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ creationTime: Date!
+ email: Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email
+ id: ID!
+ lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ markedForDeletion: Boolean
+ recordVersion: Int!
+ slack: Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack
+ telegram: Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram
+ updateTime: Date!
+ webhook: Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook
+}
+
+input NotificationConfIn {
+ email: Github__com___kloudlite___api___apps___comms___internal___domain___entities__EmailIn
+ slack: Github__com___kloudlite___api___apps___comms___internal___domain___entities__SlackIn
+ telegram: Github__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramIn
+ webhook: Github__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookIn
+}
+
+`, BuiltIn: false},
+ {Name: "../struct-to-graphql/pagination.graphqls", Input: `type Pagination @shareable {
+ page: Int
+ per_page: Int
+}
+
+input PaginationIn {
+ page: Int
+ per_page: Int
+}
+
+`, BuiltIn: false},
+ {Name: "../struct-to-graphql/scalars.graphqls", Input: `scalar Any
+scalar Json
+scalar Map
+scalar Date
+`, BuiltIn: false},
+ {Name: "../struct-to-graphql/subscription.graphqls", Input: `type Subscription @shareable {
+ accountName: String!
+ createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ creationTime: Date!
+ enabled: Boolean!
+ id: ID!
+ lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ mailAddress: String!
+ markedForDeletion: Boolean
+ recordVersion: Int!
+ updateTime: Date!
+}
+
+input SubscriptionIn {
+ enabled: Boolean!
+ mailAddress: String!
+}
+
+`, BuiltIn: false},
+ {Name: "../../federation/directives.graphql", Input: `
+ directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
+ directive @composeDirective(name: String!) repeatable on SCHEMA
+ directive @extends on OBJECT | INTERFACE
+ directive @external on OBJECT | FIELD_DEFINITION
+ directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE
+ directive @inaccessible on
+ | ARGUMENT_DEFINITION
+ | ENUM
+ | ENUM_VALUE
+ | FIELD_DEFINITION
+ | INPUT_FIELD_DEFINITION
+ | INPUT_OBJECT
+ | INTERFACE
+ | OBJECT
+ | SCALAR
+ | UNION
+ directive @interfaceObject on OBJECT
+ directive @link(import: [String!], url: String!) repeatable on SCHEMA
+ directive @override(from: String!, label: String) on FIELD_DEFINITION
+ directive @policy(policies: [[federation__Policy!]!]!) on
+ | FIELD_DEFINITION
+ | OBJECT
+ | INTERFACE
+ | SCALAR
+ | ENUM
+ directive @provides(fields: FieldSet!) on FIELD_DEFINITION
+ directive @requires(fields: FieldSet!) on FIELD_DEFINITION
+ directive @requiresScopes(scopes: [[federation__Scope!]!]!) on
+ | FIELD_DEFINITION
+ | OBJECT
+ | INTERFACE
+ | SCALAR
+ | ENUM
+ directive @shareable repeatable on FIELD_DEFINITION | OBJECT
+ directive @tag(name: String!) repeatable on
+ | ARGUMENT_DEFINITION
+ | ENUM
+ | ENUM_VALUE
+ | FIELD_DEFINITION
+ | INPUT_FIELD_DEFINITION
+ | INPUT_OBJECT
+ | INTERFACE
+ | OBJECT
+ | SCALAR
+ | UNION
+ scalar _Any
+ scalar FieldSet
+ scalar federation__Policy
+ scalar federation__Scope
+`, BuiltIn: true},
+ {Name: "../../federation/entity.graphql", Input: `
+type _Service {
+ sdl: String
+}
+
+extend type Query {
+ _service: _Service!
+}
+`, BuiltIn: true},
+}
+var parsedSchema = gqlparser.MustLoadSchema(sources...)
+
+// endregion ************************** generated!.gotpl **************************
+
+// region ***************************** args.gotpl *****************************
+
+func (ec *executionContext) field_Mutation_comms_markNotificationAsRead_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
+ var err error
+ args := map[string]interface{}{}
+ var arg0 repos.ID
+ if tmp, ok := rawArgs["id"]; ok {
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
+ arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp)
+ if err != nil {
+ return nil, err
+ }
+ }
+ args["id"] = arg0
+ return args, nil
+}
+
+func (ec *executionContext) field_Mutation_comms_updateNotificationConfig_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
+ var err error
+ args := map[string]interface{}{}
+ var arg0 entities.NotificationConf
+ if tmp, ok := rawArgs["config"]; ok {
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config"))
+ arg0, err = ec.unmarshalNNotificationConfIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋdomainᚋentitiesᚐNotificationConf(ctx, tmp)
+ if err != nil {
+ return nil, err
+ }
+ }
+ args["config"] = arg0
+ return args, nil
+}
+
+func (ec *executionContext) field_Mutation_comms_updateSubscriptionConfig_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
+ var err error
+ args := map[string]interface{}{}
+ var arg0 entities.Subscription
+ if tmp, ok := rawArgs["config"]; ok {
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config"))
+ arg0, err = ec.unmarshalNSubscriptionIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋdomainᚋentitiesᚐSubscription(ctx, tmp)
+ if err != nil {
+ return nil, err
+ }
+ }
+ args["config"] = arg0
+ var arg1 repos.ID
+ if tmp, ok := rawArgs["id"]; ok {
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
+ arg1, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp)
+ if err != nil {
+ return nil, err
+ }
+ }
+ args["id"] = arg1
+ return args, nil
+}
+
+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_comms_getSubscriptionConfig_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
+ var err error
+ args := map[string]interface{}{}
+ var arg0 repos.ID
+ if tmp, ok := rawArgs["id"]; ok {
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
+ arg0, err = ec.unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, tmp)
+ if err != nil {
+ return nil, err
+ }
+ }
+ args["id"] = arg0
+ return args, nil
+}
+
+func (ec *executionContext) field_Query_comms_listNotifications_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
+ var err error
+ args := map[string]interface{}{}
+ var arg0 *repos.CursorPagination
+ if tmp, ok := rawArgs["pagination"]; ok {
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pagination"))
+ arg0, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp)
+ if err != nil {
+ return nil, err
+ }
+ }
+ args["pagination"] = arg0
+ 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) _CursorPagination_after(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_CursorPagination_after(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.After, 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_CursorPagination_after(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "CursorPagination",
+ 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) _CursorPagination_before(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_CursorPagination_before(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Before, 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_CursorPagination_before(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "CursorPagination",
+ 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) _CursorPagination_first(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_CursorPagination_first(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.First, nil
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(*int64)
+ fc.Result = res
+ return ec.marshalOInt2ᚖint64(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_CursorPagination_first(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "CursorPagination",
+ 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) _CursorPagination_last(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_CursorPagination_last(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Last, nil
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(*int64)
+ fc.Result = res
+ return ec.marshalOInt2ᚖint64(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_CursorPagination_last(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "CursorPagination",
+ 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) _CursorPagination_orderBy(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_CursorPagination_orderBy(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.OrderBy, 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.marshalOString2string(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_CursorPagination_orderBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "CursorPagination",
+ 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) _CursorPagination_sortDirection(ctx context.Context, field graphql.CollectedField, obj *repos.CursorPagination) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_CursorPagination_sortDirection(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.SortDirection, nil
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(repos.SortDirection)
+ fc.Result = res
+ return ec.marshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_CursorPagination_sortDirection(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "CursorPagination",
+ Field: field,
+ IsMethod: false,
+ IsResolver: false,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type CursorPaginationSortDirection does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email_enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email_enabled(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Enabled, 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_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email",
+ 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) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email_mailAddress(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email_mailAddress(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.MailAddress, 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_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email_mailAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email",
+ 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) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack_enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack_enabled(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Enabled, 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_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack",
+ 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) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack_url(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack_url(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.URL, 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_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack_url(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack",
+ 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) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_chatId(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_chatId(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.ChatID, 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_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_chatId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram",
+ 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) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_enabled(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Enabled, 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_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram",
+ 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) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_token(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_token(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Token, 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_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_token(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram",
+ 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) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook_enabled(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook_enabled(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Enabled, 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_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook",
+ 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) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook_url(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook_url(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.URL, 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_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook_url(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook",
+ 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) _Github__com___kloudlite___api___apps___comms___types__NotifyContent_body(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsTypesNotifyContent) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___types__NotifyContent_body(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Body, 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_Github__com___kloudlite___api___apps___comms___types__NotifyContent_body(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___types__NotifyContent",
+ 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) _Github__com___kloudlite___api___apps___comms___types__NotifyContent_image(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsTypesNotifyContent) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___types__NotifyContent_image(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Image, 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_Github__com___kloudlite___api___apps___comms___types__NotifyContent_image(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___types__NotifyContent",
+ 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) _Github__com___kloudlite___api___apps___comms___types__NotifyContent_link(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsTypesNotifyContent) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___types__NotifyContent_link(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Link, 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_Github__com___kloudlite___api___apps___comms___types__NotifyContent_link(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___types__NotifyContent",
+ 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) _Github__com___kloudlite___api___apps___comms___types__NotifyContent_subject(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsTypesNotifyContent) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___types__NotifyContent_subject(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Subject, 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_Github__com___kloudlite___api___apps___comms___types__NotifyContent_subject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___types__NotifyContent",
+ 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) _Github__com___kloudlite___api___apps___comms___types__NotifyContent_title(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteAPIAppsCommsTypesNotifyContent) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___apps___comms___types__NotifyContent_title(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Title, 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_Github__com___kloudlite___api___apps___comms___types__NotifyContent_title(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___apps___comms___types__NotifyContent",
+ 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) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.UserEmail, 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_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy",
+ 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) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Github__com___kloudlite___api___common__CreatedOrUpdatedBy().UserID(rctx, obj)
+ })
+ 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_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ 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) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx context.Context, field graphql.CollectedField, obj *common.CreatedOrUpdatedBy) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.UserName, 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_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Github__com___kloudlite___api___common__CreatedOrUpdatedBy",
+ 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) _MatchFilter_array(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_MatchFilter_array(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Array, nil
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.([]any)
+ fc.Result = res
+ return ec.marshalOAny2ᚕinterfaceᚄ(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_MatchFilter_array(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "MatchFilter",
+ Field: field,
+ IsMethod: false,
+ IsResolver: false,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Any does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _MatchFilter_exact(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_MatchFilter_exact(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Exact, nil
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(any)
+ fc.Result = res
+ return ec.marshalOAny2interface(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_MatchFilter_exact(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "MatchFilter",
+ Field: field,
+ IsMethod: false,
+ IsResolver: false,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Any does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _MatchFilter_matchType(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_MatchFilter_matchType(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.MatchFilter().MatchType(rctx, obj)
+ })
+ 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.GithubComKloudliteAPIPkgReposMatchType)
+ fc.Result = res
+ return ec.marshalNGithub__com___kloudlite___api___pkg___repos__MatchType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgReposMatchType(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_MatchFilter_matchType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "MatchFilter",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Github__com___kloudlite___api___pkg___repos__MatchType does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _MatchFilter_notInArray(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_MatchFilter_notInArray(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.NotInArray, nil
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.([]any)
+ fc.Result = res
+ return ec.marshalOAny2ᚕinterfaceᚄ(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_MatchFilter_notInArray(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "MatchFilter",
+ Field: field,
+ IsMethod: false,
+ IsResolver: false,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Any does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _MatchFilter_regex(ctx context.Context, field graphql.CollectedField, obj *repos.MatchFilter) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_MatchFilter_regex(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Regex, 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_MatchFilter_regex(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "MatchFilter",
+ 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) _Mutation_comms_updateNotificationConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Mutation_comms_updateNotificationConfig(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = graphql.Null
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ directive0 := func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Mutation().CommsUpdateNotificationConfig(rctx, fc.Args["config"].(entities.NotificationConf))
+ }
+ directive1 := func(ctx context.Context) (interface{}, error) {
+ if ec.directives.IsLoggedInAndVerified == nil {
+ return nil, errors.New("directive isLoggedInAndVerified is not implemented")
+ }
+ return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0)
+ }
+ directive2 := func(ctx context.Context) (interface{}, error) {
+ if ec.directives.HasAccount == nil {
+ return nil, errors.New("directive hasAccount is not implemented")
+ }
+ return ec.directives.HasAccount(ctx, nil, directive1)
+ }
+
+ tmp, err := directive2(rctx)
+ if err != nil {
+ return nil, graphql.ErrorOnPath(ctx, err)
+ }
+ if tmp == nil {
+ return nil, nil
+ }
+ if data, ok := tmp.(*entities.NotificationConf); ok {
+ return data, nil
+ }
+ return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/comms/internal/domain/entities.NotificationConf`, tmp)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(*entities.NotificationConf)
+ fc.Result = res
+ return ec.marshalONotificationConf2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋdomainᚋentitiesᚐNotificationConf(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Mutation_comms_updateNotificationConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Mutation",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "accountName":
+ return ec.fieldContext_NotificationConf_accountName(ctx, field)
+ case "createdBy":
+ return ec.fieldContext_NotificationConf_createdBy(ctx, field)
+ case "creationTime":
+ return ec.fieldContext_NotificationConf_creationTime(ctx, field)
+ case "email":
+ return ec.fieldContext_NotificationConf_email(ctx, field)
+ case "id":
+ return ec.fieldContext_NotificationConf_id(ctx, field)
+ case "lastUpdatedBy":
+ return ec.fieldContext_NotificationConf_lastUpdatedBy(ctx, field)
+ case "markedForDeletion":
+ return ec.fieldContext_NotificationConf_markedForDeletion(ctx, field)
+ case "recordVersion":
+ return ec.fieldContext_NotificationConf_recordVersion(ctx, field)
+ case "slack":
+ return ec.fieldContext_NotificationConf_slack(ctx, field)
+ case "telegram":
+ return ec.fieldContext_NotificationConf_telegram(ctx, field)
+ case "updateTime":
+ return ec.fieldContext_NotificationConf_updateTime(ctx, field)
+ case "webhook":
+ return ec.fieldContext_NotificationConf_webhook(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type NotificationConf", 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_Mutation_comms_updateNotificationConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
+ ec.Error(ctx, err)
+ return fc, err
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Mutation_comms_updateSubscriptionConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Mutation_comms_updateSubscriptionConfig(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = graphql.Null
+ }
+ }()
+ res := &entities.Subscription{}
+ fc.Result = res
+ return ec.marshalOSubscription2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋdomainᚋentitiesᚐSubscription(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Mutation_comms_updateSubscriptionConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Mutation",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "accountName":
+ return ec.fieldContext_Subscription_accountName(ctx, field)
+ case "createdBy":
+ return ec.fieldContext_Subscription_createdBy(ctx, field)
+ case "creationTime":
+ return ec.fieldContext_Subscription_creationTime(ctx, field)
+ case "enabled":
+ return ec.fieldContext_Subscription_enabled(ctx, field)
+ case "id":
+ return ec.fieldContext_Subscription_id(ctx, field)
+ case "lastUpdatedBy":
+ return ec.fieldContext_Subscription_lastUpdatedBy(ctx, field)
+ case "mailAddress":
+ return ec.fieldContext_Subscription_mailAddress(ctx, field)
+ case "markedForDeletion":
+ return ec.fieldContext_Subscription_markedForDeletion(ctx, field)
+ case "recordVersion":
+ return ec.fieldContext_Subscription_recordVersion(ctx, field)
+ case "updateTime":
+ return ec.fieldContext_Subscription_updateTime(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Subscription", 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_Mutation_comms_updateSubscriptionConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
+ ec.Error(ctx, err)
+ return fc, err
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Mutation_comms_markNotificationAsRead(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Mutation_comms_markNotificationAsRead(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = graphql.Null
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ directive0 := func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Mutation().CommsMarkNotificationAsRead(rctx, fc.Args["id"].(repos.ID))
+ }
+ directive1 := func(ctx context.Context) (interface{}, error) {
+ if ec.directives.IsLoggedInAndVerified == nil {
+ return nil, errors.New("directive isLoggedInAndVerified is not implemented")
+ }
+ return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0)
+ }
+ directive2 := func(ctx context.Context) (interface{}, error) {
+ if ec.directives.HasAccount == nil {
+ return nil, errors.New("directive hasAccount is not implemented")
+ }
+ return ec.directives.HasAccount(ctx, nil, directive1)
+ }
+
+ tmp, err := directive2(rctx)
+ if err != nil {
+ return nil, graphql.ErrorOnPath(ctx, err)
+ }
+ if tmp == nil {
+ return nil, nil
+ }
+ if data, ok := tmp.(*types.Notification); ok {
+ return data, nil
+ }
+ return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/comms/types.Notification`, tmp)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(*types.Notification)
+ fc.Result = res
+ return ec.marshalONotification2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋtypesᚐNotification(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Mutation_comms_markNotificationAsRead(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Mutation",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "accountName":
+ return ec.fieldContext_Notification_accountName(ctx, field)
+ case "content":
+ return ec.fieldContext_Notification_content(ctx, field)
+ case "creationTime":
+ return ec.fieldContext_Notification_creationTime(ctx, field)
+ case "id":
+ return ec.fieldContext_Notification_id(ctx, field)
+ case "markedForDeletion":
+ return ec.fieldContext_Notification_markedForDeletion(ctx, field)
+ case "notificationType":
+ return ec.fieldContext_Notification_notificationType(ctx, field)
+ case "priority":
+ return ec.fieldContext_Notification_priority(ctx, field)
+ case "read":
+ return ec.fieldContext_Notification_read(ctx, field)
+ case "recordVersion":
+ return ec.fieldContext_Notification_recordVersion(ctx, field)
+ case "updateTime":
+ return ec.fieldContext_Notification_updateTime(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Notification", 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_Mutation_comms_markNotificationAsRead_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
+ ec.Error(ctx, err)
+ return fc, err
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Notification_accountName(ctx context.Context, field graphql.CollectedField, obj *types.Notification) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Notification_accountName(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.AccountName, 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_Notification_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Notification",
+ 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) _Notification_content(ctx context.Context, field graphql.CollectedField, obj *types.Notification) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Notification_content(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Notification().Content(rctx, obj)
+ })
+ 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.GithubComKloudliteAPIAppsCommsTypesNotifyContent)
+ fc.Result = res
+ return ec.marshalNGithub__com___kloudlite___api___apps___comms___types__NotifyContent2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsTypesNotifyContent(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Notification_content(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Notification",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "body":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___types__NotifyContent_body(ctx, field)
+ case "image":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___types__NotifyContent_image(ctx, field)
+ case "link":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___types__NotifyContent_link(ctx, field)
+ case "subject":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___types__NotifyContent_subject(ctx, field)
+ case "title":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___types__NotifyContent_title(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___comms___types__NotifyContent", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Notification_creationTime(ctx context.Context, field graphql.CollectedField, obj *types.Notification) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Notification_creationTime(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Notification().CreationTime(rctx, obj)
+ })
+ 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.marshalNDate2string(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Notification_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Notification",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Date does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Notification_id(ctx context.Context, field graphql.CollectedField, obj *types.Notification) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Notification_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.(repos.ID)
+ fc.Result = res
+ return ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Notification_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Notification",
+ 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) _Notification_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *types.Notification) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Notification_markedForDeletion(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.MarkedForDeletion, 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_Notification_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Notification",
+ 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) _Notification_notificationType(ctx context.Context, field graphql.CollectedField, obj *types.Notification) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Notification_notificationType(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Notification().NotificationType(rctx, obj)
+ })
+ 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.GithubComKloudliteAPIAppsCommsTypesNotificationType)
+ fc.Result = res
+ return ec.marshalNGithub__com___kloudlite___api___apps___comms___types__NotificationType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsTypesNotificationType(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Notification_notificationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Notification",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Github__com___kloudlite___api___apps___comms___types__NotificationType does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Notification_priority(ctx context.Context, field graphql.CollectedField, obj *types.Notification) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Notification_priority(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Priority, 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_Notification_priority(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Notification",
+ 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) _Notification_read(ctx context.Context, field graphql.CollectedField, obj *types.Notification) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Notification_read(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Read, 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_Notification_read(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Notification",
+ 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) _Notification_recordVersion(ctx context.Context, field graphql.CollectedField, obj *types.Notification) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Notification_recordVersion(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.RecordVersion, 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_Notification_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Notification",
+ 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) _Notification_updateTime(ctx context.Context, field graphql.CollectedField, obj *types.Notification) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Notification_updateTime(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Notification().UpdateTime(rctx, obj)
+ })
+ 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.marshalNDate2string(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Notification_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Notification",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Date does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationConf_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_accountName(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.AccountName, 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_NotificationConf_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ 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) _NotificationConf_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_createdBy(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.CreatedBy, 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.(common.CreatedOrUpdatedBy)
+ fc.Result = res
+ return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationConf_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ Field: field,
+ IsMethod: false,
+ IsResolver: false,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "userEmail":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field)
+ case "userId":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field)
+ case "userName":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationConf_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_creationTime(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.NotificationConf().CreationTime(rctx, obj)
+ })
+ 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.marshalNDate2string(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationConf_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Date does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationConf_email(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_email(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.NotificationConf().Email(rctx, obj)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail)
+ fc.Result = res
+ return ec.marshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__Email2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationConf_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "enabled":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email_enabled(ctx, field)
+ case "mailAddress":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email_mailAddress(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationConf_id(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_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.(repos.ID)
+ fc.Result = res
+ return ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationConf_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ 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) _NotificationConf_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_lastUpdatedBy(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.LastUpdatedBy, 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.(common.CreatedOrUpdatedBy)
+ fc.Result = res
+ return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationConf_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ Field: field,
+ IsMethod: false,
+ IsResolver: false,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "userEmail":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field)
+ case "userId":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field)
+ case "userName":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationConf_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_markedForDeletion(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.MarkedForDeletion, 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_NotificationConf_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ 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) _NotificationConf_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_recordVersion(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.RecordVersion, 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_NotificationConf_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ 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) _NotificationConf_slack(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_slack(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.NotificationConf().Slack(rctx, obj)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack)
+ fc.Result = res
+ return ec.marshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__Slack2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationConf_slack(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "enabled":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack_enabled(ctx, field)
+ case "url":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack_url(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationConf_telegram(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_telegram(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.NotificationConf().Telegram(rctx, obj)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram)
+ fc.Result = res
+ return ec.marshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationConf_telegram(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "chatId":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_chatId(ctx, field)
+ case "enabled":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_enabled(ctx, field)
+ case "token":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_token(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationConf_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_updateTime(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.NotificationConf().UpdateTime(rctx, obj)
+ })
+ 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.marshalNDate2string(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationConf_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Date does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationConf_webhook(ctx context.Context, field graphql.CollectedField, obj *entities.NotificationConf) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationConf_webhook(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.NotificationConf().Webhook(rctx, obj)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook)
+ fc.Result = res
+ return ec.marshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationConf_webhook(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationConf",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "enabled":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook_enabled(ctx, field)
+ case "url":
+ return ec.fieldContext_Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook_url(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.NotificationEdge) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationEdge_cursor(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Cursor, 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_NotificationEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationEdge",
+ 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) _NotificationEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.NotificationEdge) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationEdge_node(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Node, 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.(*types.Notification)
+ fc.Result = res
+ return ec.marshalNNotification2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋtypesᚐNotification(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationEdge",
+ Field: field,
+ IsMethod: false,
+ IsResolver: false,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "accountName":
+ return ec.fieldContext_Notification_accountName(ctx, field)
+ case "content":
+ return ec.fieldContext_Notification_content(ctx, field)
+ case "creationTime":
+ return ec.fieldContext_Notification_creationTime(ctx, field)
+ case "id":
+ return ec.fieldContext_Notification_id(ctx, field)
+ case "markedForDeletion":
+ return ec.fieldContext_Notification_markedForDeletion(ctx, field)
+ case "notificationType":
+ return ec.fieldContext_Notification_notificationType(ctx, field)
+ case "priority":
+ return ec.fieldContext_Notification_priority(ctx, field)
+ case "read":
+ return ec.fieldContext_Notification_read(ctx, field)
+ case "recordVersion":
+ return ec.fieldContext_Notification_recordVersion(ctx, field)
+ case "updateTime":
+ return ec.fieldContext_Notification_updateTime(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Notification", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.NotificationPaginatedRecords) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationPaginatedRecords_edges(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Edges, 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.NotificationEdge)
+ fc.Result = res
+ return ec.marshalNNotificationEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐNotificationEdgeᚄ(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationPaginatedRecords",
+ Field: field,
+ IsMethod: false,
+ IsResolver: false,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "cursor":
+ return ec.fieldContext_NotificationEdge_cursor(ctx, field)
+ case "node":
+ return ec.fieldContext_NotificationEdge_node(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type NotificationEdge", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.NotificationPaginatedRecords) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationPaginatedRecords_pageInfo(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.PageInfo, 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.PageInfo)
+ fc.Result = res
+ return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_NotificationPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationPaginatedRecords",
+ Field: field,
+ IsMethod: false,
+ IsResolver: false,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "endCursor":
+ return ec.fieldContext_PageInfo_endCursor(ctx, field)
+ case "hasNextPage":
+ return ec.fieldContext_PageInfo_hasNextPage(ctx, field)
+ case "hasPreviousPage":
+ return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field)
+ case "startCursor":
+ return ec.fieldContext_PageInfo_startCursor(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _NotificationPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.NotificationPaginatedRecords) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_NotificationPaginatedRecords_totalCount(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.TotalCount, 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_NotificationPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "NotificationPaginatedRecords",
+ 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) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.EndCursor, 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_PageInfo_endCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "PageInfo",
+ 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) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.HasNextPage, 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_PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "PageInfo",
+ 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) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.HasPreviousPage, 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_PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "PageInfo",
+ 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) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.StartCursor, 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_PageInfo_startCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "PageInfo",
+ 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) _Pagination_page(ctx context.Context, field graphql.CollectedField, obj *types1.Pagination) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Pagination_page(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.Page, 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.marshalOInt2int(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Pagination_page(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Pagination",
+ 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) _Pagination_per_page(ctx context.Context, field graphql.CollectedField, obj *types1.Pagination) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Pagination_per_page(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.PerPage, 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.marshalOInt2int(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Pagination_per_page(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Pagination",
+ 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) _Query_comms_listNotifications(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Query_comms_listNotifications(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = graphql.Null
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ directive0 := func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Query().CommsListNotifications(rctx, fc.Args["pagination"].(*repos.CursorPagination))
+ }
+ directive1 := func(ctx context.Context) (interface{}, error) {
+ if ec.directives.IsLoggedInAndVerified == nil {
+ return nil, errors.New("directive isLoggedInAndVerified is not implemented")
+ }
+ return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0)
+ }
+ directive2 := func(ctx context.Context) (interface{}, error) {
+ if ec.directives.HasAccount == nil {
+ return nil, errors.New("directive hasAccount is not implemented")
+ }
+ return ec.directives.HasAccount(ctx, nil, directive1)
+ }
+
+ tmp, err := directive2(rctx)
+ if err != nil {
+ return nil, graphql.ErrorOnPath(ctx, err)
+ }
+ if tmp == nil {
+ return nil, nil
+ }
+ if data, ok := tmp.(*model.NotificationPaginatedRecords); ok {
+ return data, nil
+ }
+ return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/comms/internal/app/graph/model.NotificationPaginatedRecords`, tmp)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(*model.NotificationPaginatedRecords)
+ fc.Result = res
+ return ec.marshalONotificationPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐNotificationPaginatedRecords(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Query_comms_listNotifications(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 "edges":
+ return ec.fieldContext_NotificationPaginatedRecords_edges(ctx, field)
+ case "pageInfo":
+ return ec.fieldContext_NotificationPaginatedRecords_pageInfo(ctx, field)
+ case "totalCount":
+ return ec.fieldContext_NotificationPaginatedRecords_totalCount(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type NotificationPaginatedRecords", 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_comms_listNotifications_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
+ ec.Error(ctx, err)
+ return fc, err
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Query_comms_getNotificationConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Query_comms_getNotificationConfig(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = graphql.Null
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ directive0 := func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Query().CommsGetNotificationConfig(rctx)
+ }
+ directive1 := func(ctx context.Context) (interface{}, error) {
+ if ec.directives.IsLoggedInAndVerified == nil {
+ return nil, errors.New("directive isLoggedInAndVerified is not implemented")
+ }
+ return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0)
+ }
+ directive2 := func(ctx context.Context) (interface{}, error) {
+ if ec.directives.HasAccount == nil {
+ return nil, errors.New("directive hasAccount is not implemented")
+ }
+ return ec.directives.HasAccount(ctx, nil, directive1)
+ }
+
+ tmp, err := directive2(rctx)
+ if err != nil {
+ return nil, graphql.ErrorOnPath(ctx, err)
+ }
+ if tmp == nil {
+ return nil, nil
+ }
+ if data, ok := tmp.(*entities.NotificationConf); ok {
+ return data, nil
+ }
+ return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/comms/internal/domain/entities.NotificationConf`, tmp)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return graphql.Null
+ }
+ if resTmp == nil {
+ return graphql.Null
+ }
+ res := resTmp.(*entities.NotificationConf)
+ fc.Result = res
+ return ec.marshalONotificationConf2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋdomainᚋentitiesᚐNotificationConf(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Query_comms_getNotificationConfig(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 "accountName":
+ return ec.fieldContext_NotificationConf_accountName(ctx, field)
+ case "createdBy":
+ return ec.fieldContext_NotificationConf_createdBy(ctx, field)
+ case "creationTime":
+ return ec.fieldContext_NotificationConf_creationTime(ctx, field)
+ case "email":
+ return ec.fieldContext_NotificationConf_email(ctx, field)
+ case "id":
+ return ec.fieldContext_NotificationConf_id(ctx, field)
+ case "lastUpdatedBy":
+ return ec.fieldContext_NotificationConf_lastUpdatedBy(ctx, field)
+ case "markedForDeletion":
+ return ec.fieldContext_NotificationConf_markedForDeletion(ctx, field)
+ case "recordVersion":
+ return ec.fieldContext_NotificationConf_recordVersion(ctx, field)
+ case "slack":
+ return ec.fieldContext_NotificationConf_slack(ctx, field)
+ case "telegram":
+ return ec.fieldContext_NotificationConf_telegram(ctx, field)
+ case "updateTime":
+ return ec.fieldContext_NotificationConf_updateTime(ctx, field)
+ case "webhook":
+ return ec.fieldContext_NotificationConf_webhook(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type NotificationConf", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Query_comms_getSubscriptionConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Query_comms_getSubscriptionConfig(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = graphql.Null
+ }
+ }()
+ res := &entities.Subscription{}
+ fc.Result = res
+ return ec.marshalOSubscription2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋdomainᚋentitiesᚐSubscription(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Query_comms_getSubscriptionConfig(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 "accountName":
+ return ec.fieldContext_Subscription_accountName(ctx, field)
+ case "createdBy":
+ return ec.fieldContext_Subscription_createdBy(ctx, field)
+ case "creationTime":
+ return ec.fieldContext_Subscription_creationTime(ctx, field)
+ case "enabled":
+ return ec.fieldContext_Subscription_enabled(ctx, field)
+ case "id":
+ return ec.fieldContext_Subscription_id(ctx, field)
+ case "lastUpdatedBy":
+ return ec.fieldContext_Subscription_lastUpdatedBy(ctx, field)
+ case "mailAddress":
+ return ec.fieldContext_Subscription_mailAddress(ctx, field)
+ case "markedForDeletion":
+ return ec.fieldContext_Subscription_markedForDeletion(ctx, field)
+ case "recordVersion":
+ return ec.fieldContext_Subscription_recordVersion(ctx, field)
+ case "updateTime":
+ return ec.fieldContext_Subscription_updateTime(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Subscription", 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_comms_getSubscriptionConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
+ ec.Error(ctx, err)
+ return fc, err
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext_Query__service(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.__resolve__service(ctx)
+ })
+ 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.(fedruntime.Service)
+ fc.Result = res
+ return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext_Query__service(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 "sdl":
+ return ec.fieldContext__Service_sdl(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type _Service", field.Name)
+ },
+ }
+ 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) _Subscription_accountName(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
+ fc, err := ec.fieldContext_Subscription_accountName(ctx, field)
+ if err != nil {
+ return nil
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = nil
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Subscription().AccountName(rctx)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return nil
+ }
+ if resTmp == nil {
+ if !graphql.HasFieldError(ctx, fc) {
+ ec.Errorf(ctx, "must not be null")
+ }
+ return nil
+ }
+ return func(ctx context.Context) graphql.Marshaler {
+ select {
+ case res, ok := <-resTmp.(<-chan string):
+ if !ok {
+ return nil
+ }
+ return graphql.WriterFunc(func(w io.Writer) {
+ w.Write([]byte{'{'})
+ graphql.MarshalString(field.Alias).MarshalGQL(w)
+ w.Write([]byte{':'})
+ ec.marshalNString2string(ctx, field.Selections, res).MarshalGQL(w)
+ w.Write([]byte{'}'})
+ })
+ case <-ctx.Done():
+ return nil
+ }
+ }
+}
+
+func (ec *executionContext) fieldContext_Subscription_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Subscription",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ 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) _Subscription_createdBy(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
+ fc, err := ec.fieldContext_Subscription_createdBy(ctx, field)
+ if err != nil {
+ return nil
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = nil
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Subscription().CreatedBy(rctx)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return nil
+ }
+ if resTmp == nil {
+ if !graphql.HasFieldError(ctx, fc) {
+ ec.Errorf(ctx, "must not be null")
+ }
+ return nil
+ }
+ return func(ctx context.Context) graphql.Marshaler {
+ select {
+ case res, ok := <-resTmp.(<-chan *common.CreatedOrUpdatedBy):
+ if !ok {
+ return nil
+ }
+ return graphql.WriterFunc(func(w io.Writer) {
+ w.Write([]byte{'{'})
+ graphql.MarshalString(field.Alias).MarshalGQL(w)
+ w.Write([]byte{':'})
+ ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res).MarshalGQL(w)
+ w.Write([]byte{'}'})
+ })
+ case <-ctx.Done():
+ return nil
+ }
+ }
+}
+
+func (ec *executionContext) fieldContext_Subscription_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Subscription",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "userEmail":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field)
+ case "userId":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field)
+ case "userName":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Subscription_creationTime(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
+ fc, err := ec.fieldContext_Subscription_creationTime(ctx, field)
+ if err != nil {
+ return nil
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = nil
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Subscription().CreationTime(rctx)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return nil
+ }
+ if resTmp == nil {
+ if !graphql.HasFieldError(ctx, fc) {
+ ec.Errorf(ctx, "must not be null")
+ }
+ return nil
+ }
+ return func(ctx context.Context) graphql.Marshaler {
+ select {
+ case res, ok := <-resTmp.(<-chan string):
+ if !ok {
+ return nil
+ }
+ return graphql.WriterFunc(func(w io.Writer) {
+ w.Write([]byte{'{'})
+ graphql.MarshalString(field.Alias).MarshalGQL(w)
+ w.Write([]byte{':'})
+ ec.marshalNDate2string(ctx, field.Selections, res).MarshalGQL(w)
+ w.Write([]byte{'}'})
+ })
+ case <-ctx.Done():
+ return nil
+ }
+ }
+}
+
+func (ec *executionContext) fieldContext_Subscription_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Subscription",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Date does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Subscription_enabled(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
+ fc, err := ec.fieldContext_Subscription_enabled(ctx, field)
+ if err != nil {
+ return nil
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = nil
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Subscription().Enabled(rctx)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return nil
+ }
+ if resTmp == nil {
+ if !graphql.HasFieldError(ctx, fc) {
+ ec.Errorf(ctx, "must not be null")
+ }
+ return nil
+ }
+ return func(ctx context.Context) graphql.Marshaler {
+ select {
+ case res, ok := <-resTmp.(<-chan bool):
+ if !ok {
+ return nil
+ }
+ return graphql.WriterFunc(func(w io.Writer) {
+ w.Write([]byte{'{'})
+ graphql.MarshalString(field.Alias).MarshalGQL(w)
+ w.Write([]byte{':'})
+ ec.marshalNBoolean2bool(ctx, field.Selections, res).MarshalGQL(w)
+ w.Write([]byte{'}'})
+ })
+ case <-ctx.Done():
+ return nil
+ }
+ }
+}
+
+func (ec *executionContext) fieldContext_Subscription_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Subscription",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ 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) _Subscription_id(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
+ fc, err := ec.fieldContext_Subscription_id(ctx, field)
+ if err != nil {
+ return nil
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = nil
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Subscription().ID(rctx)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return nil
+ }
+ if resTmp == nil {
+ if !graphql.HasFieldError(ctx, fc) {
+ ec.Errorf(ctx, "must not be null")
+ }
+ return nil
+ }
+ return func(ctx context.Context) graphql.Marshaler {
+ select {
+ case res, ok := <-resTmp.(<-chan repos.ID):
+ if !ok {
+ return nil
+ }
+ return graphql.WriterFunc(func(w io.Writer) {
+ w.Write([]byte{'{'})
+ graphql.MarshalString(field.Alias).MarshalGQL(w)
+ w.Write([]byte{':'})
+ ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res).MarshalGQL(w)
+ w.Write([]byte{'}'})
+ })
+ case <-ctx.Done():
+ return nil
+ }
+ }
+}
+
+func (ec *executionContext) fieldContext_Subscription_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Subscription",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ 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) _Subscription_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
+ fc, err := ec.fieldContext_Subscription_lastUpdatedBy(ctx, field)
+ if err != nil {
+ return nil
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = nil
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Subscription().LastUpdatedBy(rctx)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return nil
+ }
+ if resTmp == nil {
+ if !graphql.HasFieldError(ctx, fc) {
+ ec.Errorf(ctx, "must not be null")
+ }
+ return nil
+ }
+ return func(ctx context.Context) graphql.Marshaler {
+ select {
+ case res, ok := <-resTmp.(<-chan *common.CreatedOrUpdatedBy):
+ if !ok {
+ return nil
+ }
+ return graphql.WriterFunc(func(w io.Writer) {
+ w.Write([]byte{'{'})
+ graphql.MarshalString(field.Alias).MarshalGQL(w)
+ w.Write([]byte{':'})
+ ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res).MarshalGQL(w)
+ w.Write([]byte{'}'})
+ })
+ case <-ctx.Done():
+ return nil
+ }
+ }
+}
+
+func (ec *executionContext) fieldContext_Subscription_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Subscription",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ switch field.Name {
+ case "userEmail":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field)
+ case "userId":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field)
+ case "userName":
+ return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field)
+ }
+ return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name)
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Subscription_mailAddress(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
+ fc, err := ec.fieldContext_Subscription_mailAddress(ctx, field)
+ if err != nil {
+ return nil
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = nil
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Subscription().MailAddress(rctx)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return nil
+ }
+ if resTmp == nil {
+ if !graphql.HasFieldError(ctx, fc) {
+ ec.Errorf(ctx, "must not be null")
+ }
+ return nil
+ }
+ return func(ctx context.Context) graphql.Marshaler {
+ select {
+ case res, ok := <-resTmp.(<-chan string):
+ if !ok {
+ return nil
+ }
+ return graphql.WriterFunc(func(w io.Writer) {
+ w.Write([]byte{'{'})
+ graphql.MarshalString(field.Alias).MarshalGQL(w)
+ w.Write([]byte{':'})
+ ec.marshalNString2string(ctx, field.Selections, res).MarshalGQL(w)
+ w.Write([]byte{'}'})
+ })
+ case <-ctx.Done():
+ return nil
+ }
+ }
+}
+
+func (ec *executionContext) fieldContext_Subscription_mailAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Subscription",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ 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) _Subscription_markedForDeletion(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
+ fc, err := ec.fieldContext_Subscription_markedForDeletion(ctx, field)
+ if err != nil {
+ return nil
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = nil
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Subscription().MarkedForDeletion(rctx)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return nil
+ }
+ if resTmp == nil {
+ return nil
+ }
+ return func(ctx context.Context) graphql.Marshaler {
+ select {
+ case res, ok := <-resTmp.(<-chan *bool):
+ if !ok {
+ return nil
+ }
+ return graphql.WriterFunc(func(w io.Writer) {
+ w.Write([]byte{'{'})
+ graphql.MarshalString(field.Alias).MarshalGQL(w)
+ w.Write([]byte{':'})
+ ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res).MarshalGQL(w)
+ w.Write([]byte{'}'})
+ })
+ case <-ctx.Done():
+ return nil
+ }
+ }
+}
+
+func (ec *executionContext) fieldContext_Subscription_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Subscription",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ 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) _Subscription_recordVersion(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
+ fc, err := ec.fieldContext_Subscription_recordVersion(ctx, field)
+ if err != nil {
+ return nil
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = nil
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Subscription().RecordVersion(rctx)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return nil
+ }
+ if resTmp == nil {
+ if !graphql.HasFieldError(ctx, fc) {
+ ec.Errorf(ctx, "must not be null")
+ }
+ return nil
+ }
+ return func(ctx context.Context) graphql.Marshaler {
+ select {
+ case res, ok := <-resTmp.(<-chan int):
+ if !ok {
+ return nil
+ }
+ return graphql.WriterFunc(func(w io.Writer) {
+ w.Write([]byte{'{'})
+ graphql.MarshalString(field.Alias).MarshalGQL(w)
+ w.Write([]byte{':'})
+ ec.marshalNInt2int(ctx, field.Selections, res).MarshalGQL(w)
+ w.Write([]byte{'}'})
+ })
+ case <-ctx.Done():
+ return nil
+ }
+ }
+}
+
+func (ec *executionContext) fieldContext_Subscription_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Subscription",
+ 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")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) _Subscription_updateTime(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
+ fc, err := ec.fieldContext_Subscription_updateTime(ctx, field)
+ if err != nil {
+ return nil
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ ret = nil
+ }
+ }()
+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
+ ctx = rctx // use context from middleware stack in children
+ return ec.resolvers.Subscription().UpdateTime(rctx)
+ })
+ if err != nil {
+ ec.Error(ctx, err)
+ return nil
+ }
+ if resTmp == nil {
+ if !graphql.HasFieldError(ctx, fc) {
+ ec.Errorf(ctx, "must not be null")
+ }
+ return nil
+ }
+ return func(ctx context.Context) graphql.Marshaler {
+ select {
+ case res, ok := <-resTmp.(<-chan string):
+ if !ok {
+ return nil
+ }
+ return graphql.WriterFunc(func(w io.Writer) {
+ w.Write([]byte{'{'})
+ graphql.MarshalString(field.Alias).MarshalGQL(w)
+ w.Write([]byte{':'})
+ ec.marshalNDate2string(ctx, field.Selections, res).MarshalGQL(w)
+ w.Write([]byte{'}'})
+ })
+ case <-ctx.Done():
+ return nil
+ }
+ }
+}
+
+func (ec *executionContext) fieldContext_Subscription_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "Subscription",
+ Field: field,
+ IsMethod: true,
+ IsResolver: true,
+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
+ return nil, errors.New("field of type Date does not have child fields")
+ },
+ }
+ return fc, nil
+}
+
+func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) {
+ fc, err := ec.fieldContext__Service_sdl(ctx, field)
+ if err != nil {
+ return graphql.Null
+ }
+ ctx = graphql.WithFieldContext(ctx, fc)
+ defer func() {
+ if r := recover(); r != nil {
+ ec.Error(ctx, ec.Recover(ctx, r))
+ 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.SDL, 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.marshalOString2string(ctx, field.Selections, res)
+}
+
+func (ec *executionContext) fieldContext__Service_sdl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
+ fc = &graphql.FieldContext{
+ Object: "_Service",
+ 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 *****************************
+
+func (ec *executionContext) unmarshalInputCursorPaginationIn(ctx context.Context, obj interface{}) (repos.CursorPagination, error) {
+ var it repos.CursorPagination
+ asMap := map[string]interface{}{}
+ for k, v := range obj.(map[string]interface{}) {
+ asMap[k] = v
+ }
+
+ if _, present := asMap["orderBy"]; !present {
+ asMap["orderBy"] = "_id"
+ }
+ if _, present := asMap["sortDirection"]; !present {
+ asMap["sortDirection"] = "ASC"
+ }
+
+ fieldsInOrder := [...]string{"after", "before", "first", "last", "orderBy", "sortDirection"}
+ for _, k := range fieldsInOrder {
+ v, ok := asMap[k]
+ if !ok {
+ continue
+ }
+ switch k {
+ case "after":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after"))
+ data, err := ec.unmarshalOString2ᚖstring(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.After = data
+ case "before":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before"))
+ data, err := ec.unmarshalOString2ᚖstring(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Before = data
+ case "first":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first"))
+ data, err := ec.unmarshalOInt2ᚖint64(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.First = data
+ case "last":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last"))
+ data, err := ec.unmarshalOInt2ᚖint64(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Last = data
+ case "orderBy":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy"))
+ data, err := ec.unmarshalOString2string(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.OrderBy = data
+ case "sortDirection":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sortDirection"))
+ data, err := ec.unmarshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.SortDirection = data
+ }
+ }
+
+ return it, nil
+}
+
+func (ec *executionContext) unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__EmailIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmailIn, error) {
+ var it model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmailIn
+ asMap := map[string]interface{}{}
+ for k, v := range obj.(map[string]interface{}) {
+ asMap[k] = v
+ }
+
+ fieldsInOrder := [...]string{"enabled", "mailAddress"}
+ for _, k := range fieldsInOrder {
+ v, ok := asMap[k]
+ if !ok {
+ continue
+ }
+ switch k {
+ case "enabled":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled"))
+ data, err := ec.unmarshalNBoolean2bool(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Enabled = data
+ case "mailAddress":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mailAddress"))
+ data, err := ec.unmarshalNString2string(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.MailAddress = data
+ }
+ }
+
+ return it, nil
+}
+
+func (ec *executionContext) unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__SlackIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlackIn, error) {
+ var it model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlackIn
+ asMap := map[string]interface{}{}
+ for k, v := range obj.(map[string]interface{}) {
+ asMap[k] = v
+ }
+
+ fieldsInOrder := [...]string{"enabled", "url"}
+ for _, k := range fieldsInOrder {
+ v, ok := asMap[k]
+ if !ok {
+ continue
+ }
+ switch k {
+ case "enabled":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled"))
+ data, err := ec.unmarshalNBoolean2bool(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Enabled = data
+ case "url":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("url"))
+ data, err := ec.unmarshalNString2string(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.URL = data
+ }
+ }
+
+ return it, nil
+}
+
+func (ec *executionContext) unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegramIn, error) {
+ var it model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegramIn
+ asMap := map[string]interface{}{}
+ for k, v := range obj.(map[string]interface{}) {
+ asMap[k] = v
+ }
+
+ fieldsInOrder := [...]string{"chatId", "enabled", "token"}
+ for _, k := range fieldsInOrder {
+ v, ok := asMap[k]
+ if !ok {
+ continue
+ }
+ switch k {
+ case "chatId":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chatId"))
+ data, err := ec.unmarshalNString2string(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.ChatID = data
+ case "enabled":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled"))
+ data, err := ec.unmarshalNBoolean2bool(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Enabled = data
+ case "token":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("token"))
+ data, err := ec.unmarshalNString2string(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Token = data
+ }
+ }
+
+ return it, nil
+}
+
+func (ec *executionContext) unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhookIn, error) {
+ var it model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhookIn
+ asMap := map[string]interface{}{}
+ for k, v := range obj.(map[string]interface{}) {
+ asMap[k] = v
+ }
+
+ fieldsInOrder := [...]string{"enabled", "url"}
+ for _, k := range fieldsInOrder {
+ v, ok := asMap[k]
+ if !ok {
+ continue
+ }
+ switch k {
+ case "enabled":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled"))
+ data, err := ec.unmarshalNBoolean2bool(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Enabled = data
+ case "url":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("url"))
+ data, err := ec.unmarshalNString2string(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.URL = data
+ }
+ }
+
+ return it, nil
+}
+
+func (ec *executionContext) unmarshalInputMatchFilterIn(ctx context.Context, obj interface{}) (repos.MatchFilter, error) {
+ var it repos.MatchFilter
+ asMap := map[string]interface{}{}
+ for k, v := range obj.(map[string]interface{}) {
+ asMap[k] = v
+ }
+
+ fieldsInOrder := [...]string{"array", "exact", "matchType", "notInArray", "regex"}
+ for _, k := range fieldsInOrder {
+ v, ok := asMap[k]
+ if !ok {
+ continue
+ }
+ switch k {
+ case "array":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("array"))
+ data, err := ec.unmarshalOAny2ᚕinterfaceᚄ(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Array = data
+ case "exact":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exact"))
+ data, err := ec.unmarshalOAny2interface(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Exact = data
+ case "matchType":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("matchType"))
+ data, err := ec.unmarshalNGithub__com___kloudlite___api___pkg___repos__MatchType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgReposMatchType(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ if err = ec.resolvers.MatchFilterIn().MatchType(ctx, &it, data); err != nil {
+ return it, err
+ }
+ case "notInArray":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("notInArray"))
+ data, err := ec.unmarshalOAny2ᚕinterfaceᚄ(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.NotInArray = data
+ case "regex":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("regex"))
+ data, err := ec.unmarshalOString2ᚖstring(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Regex = data
+ }
+ }
+
+ return it, nil
+}
+
+func (ec *executionContext) unmarshalInputNotificationConfIn(ctx context.Context, obj interface{}) (entities.NotificationConf, error) {
+ var it entities.NotificationConf
+ asMap := map[string]interface{}{}
+ for k, v := range obj.(map[string]interface{}) {
+ asMap[k] = v
+ }
+
+ fieldsInOrder := [...]string{"email", "slack", "telegram", "webhook"}
+ for _, k := range fieldsInOrder {
+ v, ok := asMap[k]
+ if !ok {
+ continue
+ }
+ switch k {
+ case "email":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
+ data, err := ec.unmarshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__EmailIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmailIn(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ if err = ec.resolvers.NotificationConfIn().Email(ctx, &it, data); err != nil {
+ return it, err
+ }
+ case "slack":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("slack"))
+ data, err := ec.unmarshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__SlackIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlackIn(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ if err = ec.resolvers.NotificationConfIn().Slack(ctx, &it, data); err != nil {
+ return it, err
+ }
+ case "telegram":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("telegram"))
+ data, err := ec.unmarshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegramIn(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ if err = ec.resolvers.NotificationConfIn().Telegram(ctx, &it, data); err != nil {
+ return it, err
+ }
+ case "webhook":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("webhook"))
+ data, err := ec.unmarshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhookIn(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ if err = ec.resolvers.NotificationConfIn().Webhook(ctx, &it, data); err != nil {
+ return it, err
+ }
+ }
+ }
+
+ return it, nil
+}
+
+func (ec *executionContext) unmarshalInputPaginationIn(ctx context.Context, obj interface{}) (types1.Pagination, error) {
+ var it types1.Pagination
+ asMap := map[string]interface{}{}
+ for k, v := range obj.(map[string]interface{}) {
+ asMap[k] = v
+ }
+
+ fieldsInOrder := [...]string{"page", "per_page"}
+ for _, k := range fieldsInOrder {
+ v, ok := asMap[k]
+ if !ok {
+ continue
+ }
+ switch k {
+ case "page":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("page"))
+ data, err := ec.unmarshalOInt2int(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Page = data
+ case "per_page":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("per_page"))
+ data, err := ec.unmarshalOInt2int(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.PerPage = data
+ }
+ }
+
+ return it, nil
+}
+
+func (ec *executionContext) unmarshalInputSubscriptionIn(ctx context.Context, obj interface{}) (entities.Subscription, error) {
+ var it entities.Subscription
+ asMap := map[string]interface{}{}
+ for k, v := range obj.(map[string]interface{}) {
+ asMap[k] = v
+ }
+
+ fieldsInOrder := [...]string{"enabled", "mailAddress"}
+ for _, k := range fieldsInOrder {
+ v, ok := asMap[k]
+ if !ok {
+ continue
+ }
+ switch k {
+ case "enabled":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled"))
+ data, err := ec.unmarshalNBoolean2bool(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.Enabled = data
+ case "mailAddress":
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mailAddress"))
+ data, err := ec.unmarshalNString2string(ctx, v)
+ if err != nil {
+ return it, err
+ }
+ it.MailAddress = data
+ }
+ }
+
+ return it, nil
+}
+
+// endregion **************************** input.gotpl *****************************
+
+// region ************************** interface.gotpl ***************************
+
+// endregion ************************** interface.gotpl ***************************
+
+// region **************************** object.gotpl ****************************
+
+var cursorPaginationImplementors = []string{"CursorPagination"}
+
+func (ec *executionContext) _CursorPagination(ctx context.Context, sel ast.SelectionSet, obj *repos.CursorPagination) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, cursorPaginationImplementors)
+
+ 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("CursorPagination")
+ case "after":
+ out.Values[i] = ec._CursorPagination_after(ctx, field, obj)
+ case "before":
+ out.Values[i] = ec._CursorPagination_before(ctx, field, obj)
+ case "first":
+ out.Values[i] = ec._CursorPagination_first(ctx, field, obj)
+ case "last":
+ out.Values[i] = ec._CursorPagination_last(ctx, field, obj)
+ case "orderBy":
+ out.Values[i] = ec._CursorPagination_orderBy(ctx, field, obj)
+ case "sortDirection":
+ out.Values[i] = ec._CursorPagination_sortDirection(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 github__com___kloudlite___api___apps___comms___internal___domain___entities__EmailImplementors = []string{"Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email"}
+
+func (ec *executionContext) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___comms___internal___domain___entities__EmailImplementors)
+
+ 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("Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email")
+ case "enabled":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email_enabled(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "mailAddress":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email_mailAddress(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 github__com___kloudlite___api___apps___comms___internal___domain___entities__SlackImplementors = []string{"Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack"}
+
+func (ec *executionContext) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___comms___internal___domain___entities__SlackImplementors)
+
+ 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("Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack")
+ case "enabled":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack_enabled(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "url":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack_url(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 github__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramImplementors = []string{"Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram"}
+
+func (ec *executionContext) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramImplementors)
+
+ 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("Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram")
+ case "chatId":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_chatId(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "enabled":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_enabled(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "token":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram_token(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 github__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookImplementors = []string{"Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook"}
+
+func (ec *executionContext) _Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookImplementors)
+
+ 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("Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook")
+ case "enabled":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook_enabled(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "url":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook_url(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 github__com___kloudlite___api___apps___comms___types__NotifyContentImplementors = []string{"Github__com___kloudlite___api___apps___comms___types__NotifyContent"}
+
+func (ec *executionContext) _Github__com___kloudlite___api___apps___comms___types__NotifyContent(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteAPIAppsCommsTypesNotifyContent) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___apps___comms___types__NotifyContentImplementors)
+
+ 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("Github__com___kloudlite___api___apps___comms___types__NotifyContent")
+ case "body":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___types__NotifyContent_body(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "image":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___types__NotifyContent_image(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "link":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___types__NotifyContent_link(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "subject":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___types__NotifyContent_subject(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "title":
+ out.Values[i] = ec._Github__com___kloudlite___api___apps___comms___types__NotifyContent_title(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 github__com___kloudlite___api___common__CreatedOrUpdatedByImplementors = []string{"Github__com___kloudlite___api___common__CreatedOrUpdatedBy"}
+
+func (ec *executionContext) _Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, obj *common.CreatedOrUpdatedBy) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___api___common__CreatedOrUpdatedByImplementors)
+
+ 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("Github__com___kloudlite___api___common__CreatedOrUpdatedBy")
+ case "userEmail":
+ out.Values[i] = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "userId":
+ 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._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field, obj)
+ if res == graphql.Null {
+ atomic.AddUint32(&fs.Invalids, 1)
+ }
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ case "userName":
+ out.Values[i] = ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ 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 matchFilterImplementors = []string{"MatchFilter"}
+
+func (ec *executionContext) _MatchFilter(ctx context.Context, sel ast.SelectionSet, obj *repos.MatchFilter) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, matchFilterImplementors)
+
+ 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("MatchFilter")
+ case "array":
+ out.Values[i] = ec._MatchFilter_array(ctx, field, obj)
+ case "exact":
+ out.Values[i] = ec._MatchFilter_exact(ctx, field, obj)
+ case "matchType":
+ 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._MatchFilter_matchType(ctx, field, obj)
+ if res == graphql.Null {
+ atomic.AddUint32(&fs.Invalids, 1)
+ }
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ case "notInArray":
+ out.Values[i] = ec._MatchFilter_notInArray(ctx, field, obj)
+ case "regex":
+ out.Values[i] = ec._MatchFilter_regex(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 mutationImplementors = []string{"Mutation"}
+
+func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors)
+ ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
+ Object: "Mutation",
+ })
+
+ 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("Mutation")
+ case "comms_updateNotificationConfig":
+ out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
+ return ec._Mutation_comms_updateNotificationConfig(ctx, field)
+ })
+ case "comms_updateSubscriptionConfig":
+ out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
+ return ec._Mutation_comms_updateSubscriptionConfig(ctx, field)
+ })
+ case "comms_markNotificationAsRead":
+ out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
+ return ec._Mutation_comms_markNotificationAsRead(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 notificationImplementors = []string{"Notification"}
+
+func (ec *executionContext) _Notification(ctx context.Context, sel ast.SelectionSet, obj *types.Notification) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, notificationImplementors)
+
+ 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("Notification")
+ case "accountName":
+ out.Values[i] = ec._Notification_accountName(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "content":
+ 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._Notification_content(ctx, field, obj)
+ if res == graphql.Null {
+ atomic.AddUint32(&fs.Invalids, 1)
+ }
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ case "creationTime":
+ 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._Notification_creationTime(ctx, field, obj)
+ if res == graphql.Null {
+ atomic.AddUint32(&fs.Invalids, 1)
+ }
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ case "id":
+ out.Values[i] = ec._Notification_id(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "markedForDeletion":
+ out.Values[i] = ec._Notification_markedForDeletion(ctx, field, obj)
+ case "notificationType":
+ 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._Notification_notificationType(ctx, field, obj)
+ if res == graphql.Null {
+ atomic.AddUint32(&fs.Invalids, 1)
+ }
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ case "priority":
+ out.Values[i] = ec._Notification_priority(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "read":
+ out.Values[i] = ec._Notification_read(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "recordVersion":
+ out.Values[i] = ec._Notification_recordVersion(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "updateTime":
+ 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._Notification_updateTime(ctx, field, obj)
+ if res == graphql.Null {
+ atomic.AddUint32(&fs.Invalids, 1)
+ }
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ 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 notificationConfImplementors = []string{"NotificationConf"}
+
+func (ec *executionContext) _NotificationConf(ctx context.Context, sel ast.SelectionSet, obj *entities.NotificationConf) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, notificationConfImplementors)
+
+ 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("NotificationConf")
+ case "accountName":
+ out.Values[i] = ec._NotificationConf_accountName(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "createdBy":
+ out.Values[i] = ec._NotificationConf_createdBy(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "creationTime":
+ 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._NotificationConf_creationTime(ctx, field, obj)
+ if res == graphql.Null {
+ atomic.AddUint32(&fs.Invalids, 1)
+ }
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ case "email":
+ 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._NotificationConf_email(ctx, field, obj)
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ case "id":
+ out.Values[i] = ec._NotificationConf_id(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "lastUpdatedBy":
+ out.Values[i] = ec._NotificationConf_lastUpdatedBy(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "markedForDeletion":
+ out.Values[i] = ec._NotificationConf_markedForDeletion(ctx, field, obj)
+ case "recordVersion":
+ out.Values[i] = ec._NotificationConf_recordVersion(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ atomic.AddUint32(&out.Invalids, 1)
+ }
+ case "slack":
+ 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._NotificationConf_slack(ctx, field, obj)
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ case "telegram":
+ 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._NotificationConf_telegram(ctx, field, obj)
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ case "updateTime":
+ 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._NotificationConf_updateTime(ctx, field, obj)
+ if res == graphql.Null {
+ atomic.AddUint32(&fs.Invalids, 1)
+ }
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ case "webhook":
+ 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._NotificationConf_webhook(ctx, field, obj)
+ return res
+ }
+
+ if field.Deferrable != nil {
+ dfs, ok := deferred[field.Deferrable.Label]
+ di := 0
+ if ok {
+ dfs.AddField(field)
+ di = len(dfs.Values) - 1
+ } else {
+ dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
+ deferred[field.Deferrable.Label] = dfs
+ }
+ dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
+ return innerFunc(ctx, dfs)
+ })
+
+ // don't run the out.Concurrently() call below
+ out.Values[i] = graphql.Null
+ continue
+ }
+
+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
+ 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 notificationEdgeImplementors = []string{"NotificationEdge"}
+
+func (ec *executionContext) _NotificationEdge(ctx context.Context, sel ast.SelectionSet, obj *model.NotificationEdge) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, notificationEdgeImplementors)
+
+ 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("NotificationEdge")
+ case "cursor":
+ out.Values[i] = ec._NotificationEdge_cursor(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "node":
+ out.Values[i] = ec._NotificationEdge_node(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 notificationPaginatedRecordsImplementors = []string{"NotificationPaginatedRecords"}
+
+func (ec *executionContext) _NotificationPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.NotificationPaginatedRecords) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, notificationPaginatedRecordsImplementors)
+
+ 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("NotificationPaginatedRecords")
+ case "edges":
+ out.Values[i] = ec._NotificationPaginatedRecords_edges(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "pageInfo":
+ out.Values[i] = ec._NotificationPaginatedRecords_pageInfo(ctx, field, obj)
+ if out.Values[i] == graphql.Null {
+ out.Invalids++
+ }
+ case "totalCount":
+ out.Values[i] = ec._NotificationPaginatedRecords_totalCount(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 pageInfoImplementors = []string{"PageInfo"}
+
+func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *model.PageInfo) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors)
+
+ 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("PageInfo")
+ case "endCursor":
+ out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj)
+ case "hasNextPage":
+ out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj)
+ case "hasPreviousPage":
+ out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj)
+ case "startCursor":
+ out.Values[i] = ec._PageInfo_startCursor(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 paginationImplementors = []string{"Pagination"}
+
+func (ec *executionContext) _Pagination(ctx context.Context, sel ast.SelectionSet, obj *types1.Pagination) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, paginationImplementors)
+
+ 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("Pagination")
+ case "page":
+ out.Values[i] = ec._Pagination_page(ctx, field, obj)
+ case "per_page":
+ out.Values[i] = ec._Pagination_per_page(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 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 "comms_listNotifications":
+ 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_comms_listNotifications(ctx, field)
+ 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 "comms_getNotificationConfig":
+ 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_comms_getNotificationConfig(ctx, field)
+ 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 "comms_getSubscriptionConfig":
+ 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_comms_getSubscriptionConfig(ctx, field)
+ 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 "_service":
+ 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__service(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 subscriptionImplementors = []string{"Subscription"}
+
+func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func(ctx context.Context) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors)
+ ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
+ Object: "Subscription",
+ })
+ if len(fields) != 1 {
+ ec.Errorf(ctx, "must subscribe to exactly one stream")
+ return nil
+ }
+
+ switch fields[0].Name {
+ case "accountName":
+ return ec._Subscription_accountName(ctx, fields[0])
+ case "createdBy":
+ return ec._Subscription_createdBy(ctx, fields[0])
+ case "creationTime":
+ return ec._Subscription_creationTime(ctx, fields[0])
+ case "enabled":
+ return ec._Subscription_enabled(ctx, fields[0])
+ case "id":
+ return ec._Subscription_id(ctx, fields[0])
+ case "lastUpdatedBy":
+ return ec._Subscription_lastUpdatedBy(ctx, fields[0])
+ case "mailAddress":
+ return ec._Subscription_mailAddress(ctx, fields[0])
+ case "markedForDeletion":
+ return ec._Subscription_markedForDeletion(ctx, fields[0])
+ case "recordVersion":
+ return ec._Subscription_recordVersion(ctx, fields[0])
+ case "updateTime":
+ return ec._Subscription_updateTime(ctx, fields[0])
+ default:
+ panic("unknown field " + strconv.Quote(fields[0].Name))
+ }
+}
+
+var _ServiceImplementors = []string{"_Service"}
+
+func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler {
+ fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors)
+
+ 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("_Service")
+ case "sdl":
+ out.Values[i] = ec.__Service_sdl(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) unmarshalNAny2interface(ctx context.Context, v interface{}) (any, error) {
+ res, err := graphql.UnmarshalAny(v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalNAny2interface(ctx context.Context, sel ast.SelectionSet, v any) 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
+ }
+ res := graphql.MarshalAny(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) 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) unmarshalNDate2string(ctx context.Context, v interface{}) (string, error) {
+ res, err := graphql.UnmarshalString(v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalNDate2string(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) unmarshalNFieldSet2string(ctx context.Context, v interface{}) (string, error) {
+ res, err := graphql.UnmarshalString(v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalNFieldSet2string(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) unmarshalNGithub__com___kloudlite___api___apps___comms___types__NotificationType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsTypesNotificationType(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIAppsCommsTypesNotificationType, error) {
+ var res model.GithubComKloudliteAPIAppsCommsTypesNotificationType
+ err := res.UnmarshalGQL(v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___comms___types__NotificationType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsTypesNotificationType(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIAppsCommsTypesNotificationType) graphql.Marshaler {
+ return v
+}
+
+func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___comms___types__NotifyContent2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsTypesNotifyContent(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIAppsCommsTypesNotifyContent) graphql.Marshaler {
+ return ec._Github__com___kloudlite___api___apps___comms___types__NotifyContent(ctx, sel, &v)
+}
+
+func (ec *executionContext) marshalNGithub__com___kloudlite___api___apps___comms___types__NotifyContent2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsTypesNotifyContent(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsCommsTypesNotifyContent) 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._Github__com___kloudlite___api___apps___comms___types__NotifyContent(ctx, sel, v)
+}
+
+func (ec *executionContext) marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, v common.CreatedOrUpdatedBy) graphql.Marshaler {
+ return ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx, sel, &v)
+}
+
+func (ec *executionContext) marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, v *common.CreatedOrUpdatedBy) 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._Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx, sel, v)
+}
+
+func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___pkg___repos__MatchType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgReposMatchType(ctx context.Context, v interface{}) (model.GithubComKloudliteAPIPkgReposMatchType, error) {
+ var res model.GithubComKloudliteAPIPkgReposMatchType
+ err := res.UnmarshalGQL(v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalNGithub__com___kloudlite___api___pkg___repos__MatchType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIPkgReposMatchType(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteAPIPkgReposMatchType) graphql.Marshaler {
+ return v
+}
+
+func (ec *executionContext) unmarshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx context.Context, v interface{}) (repos.ID, error) {
+ tmp, err := graphql.UnmarshalString(v)
+ res := repos.ID(tmp)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx context.Context, sel ast.SelectionSet, v repos.ID) graphql.Marshaler {
+ res := graphql.MarshalString(string(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) marshalNNotification2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋtypesᚐNotification(ctx context.Context, sel ast.SelectionSet, v *types.Notification) 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._Notification(ctx, sel, v)
+}
+
+func (ec *executionContext) unmarshalNNotificationConfIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋdomainᚋentitiesᚐNotificationConf(ctx context.Context, v interface{}) (entities.NotificationConf, error) {
+ res, err := ec.unmarshalInputNotificationConfIn(ctx, v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalNNotificationEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐNotificationEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.NotificationEdge) 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.marshalNNotificationEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐNotificationEdge(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) marshalNNotificationEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐNotificationEdge(ctx context.Context, sel ast.SelectionSet, v *model.NotificationEdge) 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._NotificationEdge(ctx, sel, v)
+}
+
+func (ec *executionContext) marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v *model.PageInfo) 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._PageInfo(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) unmarshalNSubscriptionIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋdomainᚋentitiesᚐSubscription(ctx context.Context, v interface{}) (entities.Subscription, error) {
+ res, err := ec.unmarshalInputSubscriptionIn(ctx, v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler {
+ return ec.__Service(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) unmarshalNfederation__Policy2string(ctx context.Context, v interface{}) (string, error) {
+ res, err := graphql.UnmarshalString(v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalNfederation__Policy2string(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) unmarshalNfederation__Policy2ᚕ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.unmarshalNfederation__Policy2string(ctx, vSlice[i])
+ if err != nil {
+ return nil, err
+ }
+ }
+ return res, nil
+}
+
+func (ec *executionContext) marshalNfederation__Policy2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
+ ret := make(graphql.Array, len(v))
+ for i := range v {
+ ret[i] = ec.marshalNfederation__Policy2string(ctx, sel, v[i])
+ }
+
+ for _, e := range ret {
+ if e == graphql.Null {
+ return graphql.Null
+ }
+ }
+
+ return ret
+}
+
+func (ec *executionContext) unmarshalNfederation__Policy2ᚕᚕ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.unmarshalNfederation__Policy2ᚕstringᚄ(ctx, vSlice[i])
+ if err != nil {
+ return nil, err
+ }
+ }
+ return res, nil
+}
+
+func (ec *executionContext) marshalNfederation__Policy2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler {
+ ret := make(graphql.Array, len(v))
+ for i := range v {
+ ret[i] = ec.marshalNfederation__Policy2ᚕstringᚄ(ctx, sel, v[i])
+ }
+
+ for _, e := range ret {
+ if e == graphql.Null {
+ return graphql.Null
+ }
+ }
+
+ return ret
+}
+
+func (ec *executionContext) unmarshalNfederation__Scope2string(ctx context.Context, v interface{}) (string, error) {
+ res, err := graphql.UnmarshalString(v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalNfederation__Scope2string(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) unmarshalNfederation__Scope2ᚕ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.unmarshalNfederation__Scope2string(ctx, vSlice[i])
+ if err != nil {
+ return nil, err
+ }
+ }
+ return res, nil
+}
+
+func (ec *executionContext) marshalNfederation__Scope2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
+ ret := make(graphql.Array, len(v))
+ for i := range v {
+ ret[i] = ec.marshalNfederation__Scope2string(ctx, sel, v[i])
+ }
+
+ for _, e := range ret {
+ if e == graphql.Null {
+ return graphql.Null
+ }
+ }
+
+ return ret
+}
+
+func (ec *executionContext) unmarshalNfederation__Scope2ᚕᚕ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.unmarshalNfederation__Scope2ᚕstringᚄ(ctx, vSlice[i])
+ if err != nil {
+ return nil, err
+ }
+ }
+ return res, nil
+}
+
+func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v [][]string) graphql.Marshaler {
+ ret := make(graphql.Array, len(v))
+ for i := range v {
+ ret[i] = ec.marshalNfederation__Scope2ᚕstringᚄ(ctx, sel, v[i])
+ }
+
+ for _, e := range ret {
+ if e == graphql.Null {
+ return graphql.Null
+ }
+ }
+
+ return ret
+}
+
+func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) {
+ if v == nil {
+ return nil, nil
+ }
+ res, err := graphql.UnmarshalAny(v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ res := graphql.MarshalAny(v)
+ return res
+}
+
+func (ec *executionContext) unmarshalOAny2ᚕinterfaceᚄ(ctx context.Context, v interface{}) ([]any, error) {
+ if v == nil {
+ return nil, nil
+ }
+ var vSlice []interface{}
+ if v != nil {
+ vSlice = graphql.CoerceList(v)
+ }
+ var err error
+ res := make([]any, len(vSlice))
+ for i := range vSlice {
+ ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
+ res[i], err = ec.unmarshalNAny2interface(ctx, vSlice[i])
+ if err != nil {
+ return nil, err
+ }
+ }
+ return res, nil
+}
+
+func (ec *executionContext) marshalOAny2ᚕinterfaceᚄ(ctx context.Context, sel ast.SelectionSet, v []any) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ ret := make(graphql.Array, len(v))
+ for i := range v {
+ ret[i] = ec.marshalNAny2interface(ctx, sel, v[i])
+ }
+
+ for _, e := range ret {
+ if e == graphql.Null {
+ return graphql.Null
+ }
+ }
+
+ return ret
+}
+
+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) unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx context.Context, v interface{}) (*repos.CursorPagination, error) {
+ if v == nil {
+ return nil, nil
+ }
+ res, err := ec.unmarshalInputCursorPaginationIn(ctx, v)
+ return &res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) unmarshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx context.Context, v interface{}) (repos.SortDirection, error) {
+ tmp, err := graphql.UnmarshalString(v)
+ res := repos.SortDirection(tmp)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalOCursorPaginationSortDirection2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐSortDirection(ctx context.Context, sel ast.SelectionSet, v repos.SortDirection) graphql.Marshaler {
+ res := graphql.MarshalString(string(v))
+ return res
+}
+
+func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__Email2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ return ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email(ctx, sel, v)
+}
+
+func (ec *executionContext) unmarshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__EmailIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmailIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmailIn, error) {
+ if v == nil {
+ return nil, nil
+ }
+ res, err := ec.unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__EmailIn(ctx, v)
+ return &res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__Slack2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ return ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack(ctx, sel, v)
+}
+
+func (ec *executionContext) unmarshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__SlackIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlackIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlackIn, error) {
+ if v == nil {
+ return nil, nil
+ }
+ res, err := ec.unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__SlackIn(ctx, v)
+ return &res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ return ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram(ctx, sel, v)
+}
+
+func (ec *executionContext) unmarshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegramIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegramIn, error) {
+ if v == nil {
+ return nil, nil
+ }
+ res, err := ec.unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramIn(ctx, v)
+ return &res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ return ec._Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook(ctx, sel, v)
+}
+
+func (ec *executionContext) unmarshalOGithub__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhookIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhookIn, error) {
+ if v == nil {
+ return nil, nil
+ }
+ res, err := ec.unmarshalInputGithub__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookIn(ctx, v)
+ return &res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) unmarshalOInt2int(ctx context.Context, v interface{}) (int, error) {
+ res, err := graphql.UnmarshalInt(v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalOInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler {
+ res := graphql.MarshalInt(v)
+ return res
+}
+
+func (ec *executionContext) unmarshalOInt2ᚖint64(ctx context.Context, v interface{}) (*int64, error) {
+ if v == nil {
+ return nil, nil
+ }
+ res, err := graphql.UnmarshalInt64(v)
+ return &res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalOInt2ᚖint64(ctx context.Context, sel ast.SelectionSet, v *int64) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ res := graphql.MarshalInt64(*v)
+ return res
+}
+
+func (ec *executionContext) marshalONotification2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋtypesᚐNotification(ctx context.Context, sel ast.SelectionSet, v *types.Notification) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ return ec._Notification(ctx, sel, v)
+}
+
+func (ec *executionContext) marshalONotificationConf2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋdomainᚋentitiesᚐNotificationConf(ctx context.Context, sel ast.SelectionSet, v *entities.NotificationConf) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ return ec._NotificationConf(ctx, sel, v)
+}
+
+func (ec *executionContext) marshalONotificationPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋappᚋgraphᚋmodelᚐNotificationPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.NotificationPaginatedRecords) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ return ec._NotificationPaginatedRecords(ctx, sel, v)
+}
+
+func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) {
+ res, err := graphql.UnmarshalString(v)
+ return res, graphql.ErrorOnPath(ctx, err)
+}
+
+func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
+ res := graphql.MarshalString(v)
+ return res
+}
+
+func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) {
+ if v == nil {
+ return nil, nil
+ }
+ 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.unmarshalNString2string(ctx, vSlice[i])
+ if err != nil {
+ return nil, err
+ }
+ }
+ return res, nil
+}
+
+func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ ret := make(graphql.Array, len(v))
+ for i := range v {
+ ret[i] = ec.marshalNString2string(ctx, sel, v[i])
+ }
+
+ for _, e := range ret {
+ if e == graphql.Null {
+ return graphql.Null
+ }
+ }
+
+ return ret
+}
+
+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) marshalOSubscription2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcommsᚋinternalᚋdomainᚋentitiesᚐSubscription(ctx context.Context, sel ast.SelectionSet, v *entities.Subscription) graphql.Marshaler {
+ if v == nil {
+ return graphql.Null
+ }
+ res := ec._Subscription(ctx, sel)
+ return res(ctx)
+}
+
+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/apps/comms/internal/app/graph/matchfilter.resolvers.go b/apps/comms/internal/app/graph/matchfilter.resolvers.go
new file mode 100644
index 000000000..01998de80
--- /dev/null
+++ b/apps/comms/internal/app/graph/matchfilter.resolvers.go
@@ -0,0 +1,48 @@
+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.45
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/generated"
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/model"
+ fn "github.com/kloudlite/api/pkg/functions"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+// MatchType is the resolver for the matchType field.
+func (r *matchFilterResolver) MatchType(ctx context.Context, obj *repos.MatchFilter) (model.GithubComKloudliteAPIPkgReposMatchType, error) {
+ if obj == nil {
+ return "", fmt.Errorf("obj is nil")
+ }
+
+ return fn.JsonConvert[model.GithubComKloudliteAPIPkgReposMatchType](obj.MatchType)
+}
+
+// MatchType is the resolver for the matchType field.
+func (r *matchFilterInResolver) MatchType(ctx context.Context, obj *repos.MatchFilter, data model.GithubComKloudliteAPIPkgReposMatchType) error {
+ if obj == nil {
+ return fmt.Errorf("obj is nil")
+ }
+
+ mt, err := fn.JsonConvert[repos.MatchType](data)
+ if err != nil {
+ return err
+ }
+
+ obj.MatchType = mt
+ return nil
+}
+
+// MatchFilter returns generated.MatchFilterResolver implementation.
+func (r *Resolver) MatchFilter() generated.MatchFilterResolver { return &matchFilterResolver{r} }
+
+// MatchFilterIn returns generated.MatchFilterInResolver implementation.
+func (r *Resolver) MatchFilterIn() generated.MatchFilterInResolver { return &matchFilterInResolver{r} }
+
+type matchFilterResolver struct{ *Resolver }
+type matchFilterInResolver struct{ *Resolver }
diff --git a/apps/comms/internal/app/graph/model/models_gen.go b/apps/comms/internal/app/graph/model/models_gen.go
new file mode 100644
index 000000000..eafa39616
--- /dev/null
+++ b/apps/comms/internal/app/graph/model/models_gen.go
@@ -0,0 +1,171 @@
+// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
+
+package model
+
+import (
+ "fmt"
+ "io"
+ "strconv"
+
+ "github.com/kloudlite/api/apps/comms/types"
+)
+
+type GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail struct {
+ Enabled bool `json:"enabled"`
+ MailAddress string `json:"mailAddress"`
+}
+
+type GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmailIn struct {
+ Enabled bool `json:"enabled"`
+ MailAddress string `json:"mailAddress"`
+}
+
+type GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack struct {
+ Enabled bool `json:"enabled"`
+ URL string `json:"url"`
+}
+
+type GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlackIn struct {
+ Enabled bool `json:"enabled"`
+ URL string `json:"url"`
+}
+
+type GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram struct {
+ ChatID string `json:"chatId"`
+ Enabled bool `json:"enabled"`
+ Token string `json:"token"`
+}
+
+type GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegramIn struct {
+ ChatID string `json:"chatId"`
+ Enabled bool `json:"enabled"`
+ Token string `json:"token"`
+}
+
+type GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook struct {
+ Enabled bool `json:"enabled"`
+ URL string `json:"url"`
+}
+
+type GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhookIn struct {
+ Enabled bool `json:"enabled"`
+ URL string `json:"url"`
+}
+
+type GithubComKloudliteAPIAppsCommsTypesNotifyContent struct {
+ Body string `json:"body"`
+ Image string `json:"image"`
+ Link string `json:"link"`
+ Subject string `json:"subject"`
+ Title string `json:"title"`
+}
+
+type Mutation struct {
+}
+
+type NotificationEdge struct {
+ Cursor string `json:"cursor"`
+ Node *types.Notification `json:"node"`
+}
+
+type NotificationPaginatedRecords struct {
+ Edges []*NotificationEdge `json:"edges"`
+ PageInfo *PageInfo `json:"pageInfo"`
+ TotalCount int `json:"totalCount"`
+}
+
+type PageInfo struct {
+ EndCursor *string `json:"endCursor,omitempty"`
+ HasNextPage *bool `json:"hasNextPage,omitempty"`
+ HasPreviousPage *bool `json:"hasPreviousPage,omitempty"`
+ StartCursor *string `json:"startCursor,omitempty"`
+}
+
+type Query struct {
+}
+
+type GithubComKloudliteAPIAppsCommsTypesNotificationType string
+
+const (
+ GithubComKloudliteAPIAppsCommsTypesNotificationTypeAlert GithubComKloudliteAPIAppsCommsTypesNotificationType = "alert"
+ GithubComKloudliteAPIAppsCommsTypesNotificationTypeNotification GithubComKloudliteAPIAppsCommsTypesNotificationType = "notification"
+)
+
+var AllGithubComKloudliteAPIAppsCommsTypesNotificationType = []GithubComKloudliteAPIAppsCommsTypesNotificationType{
+ GithubComKloudliteAPIAppsCommsTypesNotificationTypeAlert,
+ GithubComKloudliteAPIAppsCommsTypesNotificationTypeNotification,
+}
+
+func (e GithubComKloudliteAPIAppsCommsTypesNotificationType) IsValid() bool {
+ switch e {
+ case GithubComKloudliteAPIAppsCommsTypesNotificationTypeAlert, GithubComKloudliteAPIAppsCommsTypesNotificationTypeNotification:
+ return true
+ }
+ return false
+}
+
+func (e GithubComKloudliteAPIAppsCommsTypesNotificationType) String() string {
+ return string(e)
+}
+
+func (e *GithubComKloudliteAPIAppsCommsTypesNotificationType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = GithubComKloudliteAPIAppsCommsTypesNotificationType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid Github__com___kloudlite___api___apps___comms___types__NotificationType", str)
+ }
+ return nil
+}
+
+func (e GithubComKloudliteAPIAppsCommsTypesNotificationType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type GithubComKloudliteAPIPkgReposMatchType string
+
+const (
+ GithubComKloudliteAPIPkgReposMatchTypeArray GithubComKloudliteAPIPkgReposMatchType = "array"
+ GithubComKloudliteAPIPkgReposMatchTypeExact GithubComKloudliteAPIPkgReposMatchType = "exact"
+ GithubComKloudliteAPIPkgReposMatchTypeNotInArray GithubComKloudliteAPIPkgReposMatchType = "not_in_array"
+ GithubComKloudliteAPIPkgReposMatchTypeRegex GithubComKloudliteAPIPkgReposMatchType = "regex"
+)
+
+var AllGithubComKloudliteAPIPkgReposMatchType = []GithubComKloudliteAPIPkgReposMatchType{
+ GithubComKloudliteAPIPkgReposMatchTypeArray,
+ GithubComKloudliteAPIPkgReposMatchTypeExact,
+ GithubComKloudliteAPIPkgReposMatchTypeNotInArray,
+ GithubComKloudliteAPIPkgReposMatchTypeRegex,
+}
+
+func (e GithubComKloudliteAPIPkgReposMatchType) IsValid() bool {
+ switch e {
+ case GithubComKloudliteAPIPkgReposMatchTypeArray, GithubComKloudliteAPIPkgReposMatchTypeExact, GithubComKloudliteAPIPkgReposMatchTypeNotInArray, GithubComKloudliteAPIPkgReposMatchTypeRegex:
+ return true
+ }
+ return false
+}
+
+func (e GithubComKloudliteAPIPkgReposMatchType) String() string {
+ return string(e)
+}
+
+func (e *GithubComKloudliteAPIPkgReposMatchType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = GithubComKloudliteAPIPkgReposMatchType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid Github__com___kloudlite___api___pkg___repos__MatchType", str)
+ }
+ return nil
+}
+
+func (e GithubComKloudliteAPIPkgReposMatchType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
diff --git a/apps/comms/internal/app/graph/notification.resolvers.go b/apps/comms/internal/app/graph/notification.resolvers.go
new file mode 100644
index 000000000..5999dfa74
--- /dev/null
+++ b/apps/comms/internal/app/graph/notification.resolvers.go
@@ -0,0 +1,57 @@
+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.45
+
+import (
+ "context"
+ "fmt"
+ "time"
+
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/generated"
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/model"
+ "github.com/kloudlite/api/apps/comms/types"
+ "github.com/kloudlite/api/pkg/functions"
+)
+
+// Content is the resolver for the content field.
+func (r *notificationResolver) Content(ctx context.Context, obj *types.Notification) (*model.GithubComKloudliteAPIAppsCommsTypesNotifyContent, error) {
+ if obj == nil {
+ return nil, fmt.Errorf("nil object")
+ }
+
+ return functions.JsonConvertP[model.GithubComKloudliteAPIAppsCommsTypesNotifyContent](obj.Content)
+}
+
+// CreationTime is the resolver for the creationTime field.
+func (r *notificationResolver) CreationTime(ctx context.Context, obj *types.Notification) (string, error) {
+ if obj == nil {
+ return "", fmt.Errorf("obj is nil")
+ }
+
+ return obj.CreationTime.Format(time.RFC3339), nil
+}
+
+// NotificationType is the resolver for the notificationType field.
+func (r *notificationResolver) NotificationType(ctx context.Context, obj *types.Notification) (model.GithubComKloudliteAPIAppsCommsTypesNotificationType, error) {
+ if obj == nil {
+ return "", fmt.Errorf("nil object")
+ }
+
+ return functions.JsonConvert[model.GithubComKloudliteAPIAppsCommsTypesNotificationType](obj.Type)
+}
+
+// UpdateTime is the resolver for the updateTime field.
+func (r *notificationResolver) UpdateTime(ctx context.Context, obj *types.Notification) (string, error) {
+ if obj == nil {
+ return "", fmt.Errorf("obj is nil")
+ }
+
+ return obj.UpdateTime.Format(time.RFC3339), nil
+}
+
+// Notification returns generated.NotificationResolver implementation.
+func (r *Resolver) Notification() generated.NotificationResolver { return ¬ificationResolver{r} }
+
+type notificationResolver struct{ *Resolver }
diff --git a/apps/comms/internal/app/graph/notificationconf.resolvers.go b/apps/comms/internal/app/graph/notificationconf.resolvers.go
new file mode 100644
index 000000000..cd353bfed
--- /dev/null
+++ b/apps/comms/internal/app/graph/notificationconf.resolvers.go
@@ -0,0 +1,145 @@
+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.45
+
+import (
+ "context"
+ "fmt"
+ "time"
+
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/generated"
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/model"
+ "github.com/kloudlite/api/apps/comms/internal/domain/entities"
+ fn "github.com/kloudlite/api/pkg/functions"
+)
+
+// CreationTime is the resolver for the creationTime field.
+func (r *notificationConfResolver) CreationTime(ctx context.Context, obj *entities.NotificationConf) (string, error) {
+ if obj == nil {
+ return "", fmt.Errorf("obj is nil")
+ }
+
+ return obj.CreationTime.Format(time.RFC3339), nil
+}
+
+// Email is the resolver for the email field.
+func (r *notificationConfResolver) Email(ctx context.Context, obj *entities.NotificationConf) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail, error) {
+ if obj == nil {
+ return nil, fmt.Errorf("obj is nil")
+ }
+
+ return fn.JsonConvertP[model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmail](obj.Email)
+}
+
+// Slack is the resolver for the slack field.
+func (r *notificationConfResolver) Slack(ctx context.Context, obj *entities.NotificationConf) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack, error) {
+ if obj == nil {
+ return nil, fmt.Errorf("obj is nil")
+ }
+
+ return fn.JsonConvertP[model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlack](obj.Slack)
+}
+
+// Telegram is the resolver for the telegram field.
+func (r *notificationConfResolver) Telegram(ctx context.Context, obj *entities.NotificationConf) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram, error) {
+ if obj == nil {
+ return nil, fmt.Errorf("obj is nil")
+ }
+
+ return fn.JsonConvertP[model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegram](obj.Telegram)
+}
+
+// UpdateTime is the resolver for the updateTime field.
+func (r *notificationConfResolver) UpdateTime(ctx context.Context, obj *entities.NotificationConf) (string, error) {
+ if obj == nil {
+ return "", fmt.Errorf("obj is nil")
+ }
+
+ return obj.UpdateTime.Format(time.RFC3339), nil
+}
+
+// Webhook is the resolver for the webhook field.
+func (r *notificationConfResolver) Webhook(ctx context.Context, obj *entities.NotificationConf) (*model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook, error) {
+ if obj.Webhook == nil {
+ return nil, nil
+ }
+
+ return fn.JsonConvertP[model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhook](obj.Webhook)
+}
+
+// Email is the resolver for the email field.
+func (r *notificationConfInResolver) Email(ctx context.Context, obj *entities.NotificationConf, data *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesEmailIn) error {
+ if obj == nil {
+ return fmt.Errorf("obj is nil")
+ }
+
+ gckacideeci, err := fn.JsonConvertP[entities.Email](data)
+ if err != nil {
+ return err
+ }
+
+ obj.Email = gckacideeci
+
+ return nil
+}
+
+// Slack is the resolver for the slack field.
+func (r *notificationConfInResolver) Slack(ctx context.Context, obj *entities.NotificationConf, data *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesSlackIn) error {
+ if obj == nil {
+ return fmt.Errorf("obj is nil")
+ }
+
+ gckacideesci, err := fn.JsonConvertP[entities.Slack](data)
+ if err != nil {
+ return err
+ }
+
+ obj.Slack = gckacideesci
+ return nil
+}
+
+// Telegram is the resolver for the telegram field.
+func (r *notificationConfInResolver) Telegram(ctx context.Context, obj *entities.NotificationConf, data *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesTelegramIn) error {
+ if obj == nil {
+ return fmt.Errorf("obj is nil")
+ }
+
+ gckacideetci, err := fn.JsonConvertP[entities.Telegram](data)
+ if err != nil {
+ return err
+ }
+
+ obj.Telegram = gckacideetci
+
+ return nil
+}
+
+// Webhook is the resolver for the webhook field.
+func (r *notificationConfInResolver) Webhook(ctx context.Context, obj *entities.NotificationConf, data *model.GithubComKloudliteAPIAppsCommsInternalDomainEntitiesWebhookIn) error {
+ if obj == nil {
+ return fmt.Errorf("obj is nil")
+ }
+
+ gckacideesci, err := fn.JsonConvertP[entities.Webhook](data)
+ if err != nil {
+ return err
+ }
+
+ obj.Webhook = gckacideesci
+ return nil
+}
+
+// NotificationConf returns generated.NotificationConfResolver implementation.
+func (r *Resolver) NotificationConf() generated.NotificationConfResolver {
+ return ¬ificationConfResolver{r}
+}
+
+// NotificationConfIn returns generated.NotificationConfInResolver implementation.
+func (r *Resolver) NotificationConfIn() generated.NotificationConfInResolver {
+ return ¬ificationConfInResolver{r}
+}
+
+type notificationConfResolver struct{ *Resolver }
+type notificationConfInResolver struct{ *Resolver }
diff --git a/apps/comms/internal/app/graph/resolver.go b/apps/comms/internal/app/graph/resolver.go
new file mode 100644
index 000000000..912366da3
--- /dev/null
+++ b/apps/comms/internal/app/graph/resolver.go
@@ -0,0 +1,15 @@
+package graph
+
+import (
+ "github.com/kloudlite/api/apps/comms/internal/domain"
+ "github.com/kloudlite/api/apps/comms/internal/env"
+)
+
+// This file will not be regenerated automatically.
+//
+// It serves as dependency injection for your app, add any dependencies you require here.
+
+type Resolver struct {
+ Domain domain.Domain
+ Env *env.Env
+}
diff --git a/apps/comms/internal/app/graph/schema.graphqls b/apps/comms/internal/app/graph/schema.graphqls
new file mode 100644
index 000000000..f7ded99fb
--- /dev/null
+++ b/apps/comms/internal/app/graph/schema.graphqls
@@ -0,0 +1,15 @@
+directive @isLoggedInAndVerified on FIELD_DEFINITION
+directive @hasAccount on FIELD_DEFINITION
+
+type Query {
+ comms_listNotifications(pagination: CursorPaginationIn): NotificationPaginatedRecords @isLoggedInAndVerified @hasAccount
+ comms_getNotificationConfig: NotificationConf @isLoggedInAndVerified @hasAccount
+ comms_getSubscriptionConfig(id: ID!): Subscription
+}
+
+type Mutation {
+ comms_updateNotificationConfig(config: NotificationConfIn!): NotificationConf @isLoggedInAndVerified @hasAccount
+ comms_updateSubscriptionConfig(config: SubscriptionIn!, id: ID!): Subscription
+
+ comms_markNotificationAsRead(id: ID!): Notification @isLoggedInAndVerified @hasAccount
+}
diff --git a/apps/comms/internal/app/graph/schema.resolvers.go b/apps/comms/internal/app/graph/schema.resolvers.go
new file mode 100644
index 000000000..c1d9f286b
--- /dev/null
+++ b/apps/comms/internal/app/graph/schema.resolvers.go
@@ -0,0 +1,90 @@
+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.45
+
+import (
+ "context"
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/generated"
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/model"
+ "github.com/kloudlite/api/apps/comms/internal/domain/entities"
+ "github.com/kloudlite/api/apps/comms/types"
+ "github.com/kloudlite/api/pkg/errors"
+ fn "github.com/kloudlite/api/pkg/functions"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+// CommsUpdateNotificationConfig is the resolver for the comms_updateNotificationConfig field.
+func (r *mutationResolver) CommsUpdateNotificationConfig(ctx context.Context, config entities.NotificationConf) (*entities.NotificationConf, error) {
+ cc, err := toCommsContext(ctx)
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+
+ return r.Domain.UpdateNotificationConfig(cc, config)
+}
+
+// CommsUpdateSubscriptionConfig is the resolver for the comms_updateSubscriptionConfig field.
+func (r *mutationResolver) CommsUpdateSubscriptionConfig(ctx context.Context, config entities.Subscription, id repos.ID) (*entities.Subscription, error) {
+ cc, err := toCommsContext(ctx)
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+
+ return r.Domain.UpdateSubscriptionConfig(cc, id, config)
+}
+
+// CommsMarkNotificationAsRead is the resolver for the comms_markNotificationAsRead field.
+func (r *mutationResolver) CommsMarkNotificationAsRead(ctx context.Context, id repos.ID) (*types.Notification, error) {
+ cc, err := toCommsContext(ctx)
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+
+ return r.Domain.MarkNotificationAsRead(cc, id)
+}
+
+// CommsListNotifications is the resolver for the comms_listNotifications field.
+func (r *queryResolver) CommsListNotifications(ctx context.Context, pagination *repos.CursorPagination) (*model.NotificationPaginatedRecords, error) {
+ cc, err := toCommsContext(ctx)
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+
+ pr, err := r.Domain.ListNotifications(cc, fn.DefaultIfNil(pagination, repos.DefaultCursorPagination))
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+
+ return fn.JsonConvertP[model.NotificationPaginatedRecords](pr)
+}
+
+// CommsGetNotificationConfig is the resolver for the comms_getNotificationConfig field.
+func (r *queryResolver) CommsGetNotificationConfig(ctx context.Context) (*entities.NotificationConf, error) {
+ cc, err := toCommsContext(ctx)
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+
+ return r.Domain.GetNotificationConfig(cc)
+}
+
+// CommsGetSubscriptionConfig is the resolver for the comms_getSubscriptionConfig field.
+func (r *queryResolver) CommsGetSubscriptionConfig(ctx context.Context, id repos.ID) (*entities.Subscription, error) {
+ cc, err := toCommsContext(ctx)
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+
+ return r.Domain.GetSubscriptionConfig(cc, id)
+}
+
+// Mutation returns generated.MutationResolver implementation.
+func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResolver{r} }
+
+// Query returns generated.QueryResolver implementation.
+func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }
+
+type mutationResolver struct{ *Resolver }
+type queryResolver struct{ *Resolver }
diff --git a/apps/comms/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/comms/internal/app/graph/struct-to-graphql/common-types.graphqls
new file mode 100644
index 000000000..94ce581b3
--- /dev/null
+++ b/apps/comms/internal/app/graph/struct-to-graphql/common-types.graphqls
@@ -0,0 +1,75 @@
+type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email @shareable {
+ enabled: Boolean!
+ mailAddress: String!
+}
+
+type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack @shareable {
+ enabled: Boolean!
+ url: String!
+}
+
+type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram @shareable {
+ chatId: String!
+ enabled: Boolean!
+ token: String!
+}
+
+type Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook @shareable {
+ enabled: Boolean!
+ url: String!
+}
+
+type Github__com___kloudlite___api___apps___comms___types__NotifyContent @shareable {
+ body: String!
+ image: String!
+ link: String!
+ subject: String!
+ title: String!
+}
+
+type Github__com___kloudlite___api___common__CreatedOrUpdatedBy @shareable {
+ userEmail: String!
+ userId: String!
+ userName: String!
+}
+
+type PageInfo @shareable {
+ endCursor: String
+ hasNextPage: Boolean
+ hasPreviousPage: Boolean
+ startCursor: String
+}
+
+input Github__com___kloudlite___api___apps___comms___internal___domain___entities__EmailIn {
+ enabled: Boolean!
+ mailAddress: String!
+}
+
+input Github__com___kloudlite___api___apps___comms___internal___domain___entities__SlackIn {
+ enabled: Boolean!
+ url: String!
+}
+
+input Github__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramIn {
+ chatId: String!
+ enabled: Boolean!
+ token: String!
+}
+
+input Github__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookIn {
+ enabled: Boolean!
+ url: String!
+}
+
+enum Github__com___kloudlite___api___apps___comms___types__NotificationType {
+ alert
+ notification
+}
+
+enum Github__com___kloudlite___api___pkg___repos__MatchType {
+ array
+ exact
+ not_in_array
+ regex
+}
+
diff --git a/apps/comms/internal/app/graph/struct-to-graphql/cursorpagination.graphqls b/apps/comms/internal/app/graph/struct-to-graphql/cursorpagination.graphqls
new file mode 100644
index 000000000..58815e858
--- /dev/null
+++ b/apps/comms/internal/app/graph/struct-to-graphql/cursorpagination.graphqls
@@ -0,0 +1,23 @@
+type CursorPagination @shareable {
+ after: String
+ before: String
+ first: Int
+ last: Int
+ orderBy: String
+ sortDirection: CursorPaginationSortDirection
+}
+
+input CursorPaginationIn {
+ after: String
+ before: String
+ first: Int
+ last: Int
+ orderBy: String = "_id"
+ sortDirection: CursorPaginationSortDirection = "ASC"
+}
+
+enum CursorPaginationSortDirection {
+ ASC
+ DESC
+}
+
diff --git a/apps/comms/internal/app/graph/struct-to-graphql/directives.graphqls b/apps/comms/internal/app/graph/struct-to-graphql/directives.graphqls
new file mode 100644
index 000000000..59d6b45c6
--- /dev/null
+++ b/apps/comms/internal/app/graph/struct-to-graphql/directives.graphqls
@@ -0,0 +1,6 @@
+extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable", "@external"])
+
+directive @goField(
+ forceResolver: Boolean
+ name: String
+) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION
diff --git a/apps/comms/internal/app/graph/struct-to-graphql/matchfilter.graphqls b/apps/comms/internal/app/graph/struct-to-graphql/matchfilter.graphqls
new file mode 100644
index 000000000..e1e59fb4d
--- /dev/null
+++ b/apps/comms/internal/app/graph/struct-to-graphql/matchfilter.graphqls
@@ -0,0 +1,16 @@
+type MatchFilter @shareable {
+ array: [Any!]
+ exact: Any
+ matchType: Github__com___kloudlite___api___pkg___repos__MatchType!
+ notInArray: [Any!]
+ regex: String
+}
+
+input MatchFilterIn {
+ array: [Any!]
+ exact: Any
+ matchType: Github__com___kloudlite___api___pkg___repos__MatchType!
+ notInArray: [Any!]
+ regex: String
+}
+
diff --git a/apps/comms/internal/app/graph/struct-to-graphql/notification.graphqls b/apps/comms/internal/app/graph/struct-to-graphql/notification.graphqls
new file mode 100644
index 000000000..0065207ca
--- /dev/null
+++ b/apps/comms/internal/app/graph/struct-to-graphql/notification.graphqls
@@ -0,0 +1,24 @@
+type Notification @shareable {
+ accountName: String!
+ content: Github__com___kloudlite___api___apps___comms___types__NotifyContent!
+ creationTime: Date!
+ id: ID!
+ markedForDeletion: Boolean
+ notificationType: Github__com___kloudlite___api___apps___comms___types__NotificationType!
+ priority: Int!
+ read: Boolean!
+ recordVersion: Int!
+ updateTime: Date!
+}
+
+type NotificationEdge @shareable {
+ cursor: String!
+ node: Notification!
+}
+
+type NotificationPaginatedRecords @shareable {
+ edges: [NotificationEdge!]!
+ pageInfo: PageInfo!
+ totalCount: Int!
+}
+
diff --git a/apps/comms/internal/app/graph/struct-to-graphql/notificationconf.graphqls b/apps/comms/internal/app/graph/struct-to-graphql/notificationconf.graphqls
new file mode 100644
index 000000000..eca8489dd
--- /dev/null
+++ b/apps/comms/internal/app/graph/struct-to-graphql/notificationconf.graphqls
@@ -0,0 +1,22 @@
+type NotificationConf @shareable {
+ accountName: String!
+ createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ creationTime: Date!
+ email: Github__com___kloudlite___api___apps___comms___internal___domain___entities__Email
+ id: ID!
+ lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ markedForDeletion: Boolean
+ recordVersion: Int!
+ slack: Github__com___kloudlite___api___apps___comms___internal___domain___entities__Slack
+ telegram: Github__com___kloudlite___api___apps___comms___internal___domain___entities__Telegram
+ updateTime: Date!
+ webhook: Github__com___kloudlite___api___apps___comms___internal___domain___entities__Webhook
+}
+
+input NotificationConfIn {
+ email: Github__com___kloudlite___api___apps___comms___internal___domain___entities__EmailIn
+ slack: Github__com___kloudlite___api___apps___comms___internal___domain___entities__SlackIn
+ telegram: Github__com___kloudlite___api___apps___comms___internal___domain___entities__TelegramIn
+ webhook: Github__com___kloudlite___api___apps___comms___internal___domain___entities__WebhookIn
+}
+
diff --git a/apps/comms/internal/app/graph/struct-to-graphql/pagination.graphqls b/apps/comms/internal/app/graph/struct-to-graphql/pagination.graphqls
new file mode 100644
index 000000000..c3bd803a3
--- /dev/null
+++ b/apps/comms/internal/app/graph/struct-to-graphql/pagination.graphqls
@@ -0,0 +1,10 @@
+type Pagination @shareable {
+ page: Int
+ per_page: Int
+}
+
+input PaginationIn {
+ page: Int
+ per_page: Int
+}
+
diff --git a/apps/comms/internal/app/graph/struct-to-graphql/scalars.graphqls b/apps/comms/internal/app/graph/struct-to-graphql/scalars.graphqls
new file mode 100644
index 000000000..1f83443a9
--- /dev/null
+++ b/apps/comms/internal/app/graph/struct-to-graphql/scalars.graphqls
@@ -0,0 +1,4 @@
+scalar Any
+scalar Json
+scalar Map
+scalar Date
diff --git a/apps/comms/internal/app/graph/struct-to-graphql/subscription.graphqls b/apps/comms/internal/app/graph/struct-to-graphql/subscription.graphqls
new file mode 100644
index 000000000..930c02954
--- /dev/null
+++ b/apps/comms/internal/app/graph/struct-to-graphql/subscription.graphqls
@@ -0,0 +1,18 @@
+type Subscription @shareable {
+ accountName: String!
+ createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ creationTime: Date!
+ enabled: Boolean!
+ id: ID!
+ lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy!
+ mailAddress: String!
+ markedForDeletion: Boolean
+ recordVersion: Int!
+ updateTime: Date!
+}
+
+input SubscriptionIn {
+ enabled: Boolean!
+ mailAddress: String!
+}
+
diff --git a/apps/comms/internal/app/graph/subscription.resolvers.go b/apps/comms/internal/app/graph/subscription.resolvers.go
new file mode 100644
index 000000000..6b0560f0a
--- /dev/null
+++ b/apps/comms/internal/app/graph/subscription.resolvers.go
@@ -0,0 +1,69 @@
+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.45
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/kloudlite/api/apps/comms/internal/app/graph/generated"
+ "github.com/kloudlite/api/common"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+// AccountName is the resolver for the accountName field.
+func (r *subscriptionResolver) AccountName(ctx context.Context) (<-chan string, error) {
+ panic(fmt.Errorf("not implemented: AccountName - accountName"))
+}
+
+// CreatedBy is the resolver for the createdBy field.
+func (r *subscriptionResolver) CreatedBy(ctx context.Context) (<-chan *common.CreatedOrUpdatedBy, error) {
+ panic(fmt.Errorf("not implemented: CreatedBy - createdBy"))
+}
+
+// CreationTime is the resolver for the creationTime field.
+func (r *subscriptionResolver) CreationTime(ctx context.Context) (<-chan string, error) {
+ panic(fmt.Errorf("not implemented: CreationTime - creationTime"))
+}
+
+// Enabled is the resolver for the enabled field.
+func (r *subscriptionResolver) Enabled(ctx context.Context) (<-chan bool, error) {
+ panic(fmt.Errorf("not implemented: Enabled - enabled"))
+}
+
+// ID is the resolver for the id field.
+func (r *subscriptionResolver) ID(ctx context.Context) (<-chan repos.ID, error) {
+ panic(fmt.Errorf("not implemented: ID - id"))
+}
+
+// LastUpdatedBy is the resolver for the lastUpdatedBy field.
+func (r *subscriptionResolver) LastUpdatedBy(ctx context.Context) (<-chan *common.CreatedOrUpdatedBy, error) {
+ panic(fmt.Errorf("not implemented: LastUpdatedBy - lastUpdatedBy"))
+}
+
+// MailAddress is the resolver for the mailAddress field.
+func (r *subscriptionResolver) MailAddress(ctx context.Context) (<-chan string, error) {
+ panic(fmt.Errorf("not implemented: MailAddress - mailAddress"))
+}
+
+// MarkedForDeletion is the resolver for the markedForDeletion field.
+func (r *subscriptionResolver) MarkedForDeletion(ctx context.Context) (<-chan *bool, error) {
+ panic(fmt.Errorf("not implemented: MarkedForDeletion - markedForDeletion"))
+}
+
+// RecordVersion is the resolver for the recordVersion field.
+func (r *subscriptionResolver) RecordVersion(ctx context.Context) (<-chan int, error) {
+ panic(fmt.Errorf("not implemented: RecordVersion - recordVersion"))
+}
+
+// UpdateTime is the resolver for the updateTime field.
+func (r *subscriptionResolver) UpdateTime(ctx context.Context) (<-chan string, error) {
+ panic(fmt.Errorf("not implemented: UpdateTime - updateTime"))
+}
+
+// Subscription returns generated.SubscriptionResolver implementation.
+func (r *Resolver) Subscription() generated.SubscriptionResolver { return &subscriptionResolver{r} }
+
+type subscriptionResolver struct{ *Resolver }
diff --git a/apps/comms/internal/app/graph/util.go b/apps/comms/internal/app/graph/util.go
new file mode 100644
index 000000000..e2bae37ec
--- /dev/null
+++ b/apps/comms/internal/app/graph/util.go
@@ -0,0 +1,50 @@
+package graph
+
+import (
+ "context"
+ "fmt"
+ "strings"
+
+ "github.com/kloudlite/api/apps/comms/internal/domain"
+ "github.com/kloudlite/api/common"
+ "github.com/kloudlite/api/pkg/errors"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+func getUserId(ctx context.Context) (repos.ID, error) {
+ session, ok := ctx.Value("user-session").(*common.AuthSession)
+
+ if !ok {
+ return "", errors.NewE(errors.Newf("context values %q is missing", "user-session"))
+ }
+
+ return session.UserId, nil
+}
+
+func toCommsContext(ctx context.Context) (domain.CommsContext, error) {
+ errMsgs := []string{}
+
+ session, ok := ctx.Value("user-session").(*common.AuthSession)
+ if !ok {
+ errMsgs = append(errMsgs, fmt.Sprintf("context values %q is missing", "user-session"))
+ }
+
+ accountName, ok := ctx.Value("account-name").(string)
+ if !ok {
+ errMsgs = append(errMsgs, fmt.Sprintf("context values %q is missing", "account-name"))
+ }
+
+ var err error
+ if len(errMsgs) != 0 {
+ err = errors.NewE(errors.Newf("%v", strings.Join(errMsgs, ",")))
+ }
+
+ return domain.CommsContext{
+ Context: ctx,
+ AccountName: accountName,
+
+ UserId: session.UserId,
+ UserName: session.UserName,
+ UserEmail: session.UserEmail,
+ }, errors.NewE(err)
+}
diff --git a/apps/comms/internal/app/grpc-server.go b/apps/comms/internal/app/grpc-server.go
index 08f48fe00..9e9a88e64 100644
--- a/apps/comms/internal/app/grpc-server.go
+++ b/apps/comms/internal/app/grpc-server.go
@@ -4,6 +4,8 @@ import (
"bytes"
"context"
"fmt"
+
+ "github.com/kloudlite/api/apps/comms/internal/domain"
"github.com/kloudlite/api/apps/comms/internal/env"
"github.com/kloudlite/api/pkg/errors"
@@ -19,12 +21,7 @@ type commsSvc struct {
ev *env.Env
- accountInviteEmail AccountInviteEmail
- projectInviteEmail ProjectInviteEmail
- resetPasswordEmail RestPasswordEmail
- userVerificationEmail UserVerificationEmail
- welcomeEmail WelcomeEmail
- waitingEmail WaitingEmail
+ eTemplattes *domain.EmailTemplates
}
func (r *commsSvc) sendSupportEmail(ctx context.Context, subject string, toEmail string, toName string, plainText string, htmlContent string) error {
@@ -57,16 +54,16 @@ func (r *commsSvc) SendAccountMemberInviteEmail(ctx context.Context, input *comm
"Link": fmt.Sprintf("%v?token=%v", r.ev.AccountsWebInviteUrl, input.InvitationToken),
}
- if err := r.accountInviteEmail.PlainText.Execute(plainText, args); err != nil {
+ if err := r.eTemplattes.AccountInviteEmail.PlainText.Execute(plainText, args); err != nil {
return nil, errors.NewEf(err, "failed to execute plain-text template")
}
html := new(bytes.Buffer)
- if err := r.accountInviteEmail.Html.Execute(html, args); err != nil {
+ if err := r.eTemplattes.AccountInviteEmail.Html.Execute(html, args); err != nil {
return nil, errors.NewEf(err, "failed to execute html template")
}
- if err := r.sendSupportEmail(ctx, r.accountInviteEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
+ if err := r.sendSupportEmail(ctx, r.eTemplattes.AccountInviteEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
return nil, errors.NewE(err)
}
return &comms.Void{}, nil
@@ -86,16 +83,16 @@ func (r *commsSvc) SendProjectMemberInviteEmail(ctx context.Context, input *comm
"Link": fmt.Sprintf("%v?token=%v", r.ev.ProjectsWebInviteUrl, input.InvitationToken),
}
- if err := r.projectInviteEmail.PlainText.Execute(plainText, args); err != nil {
+ if err := r.eTemplattes.ProjectInviteEmail.PlainText.Execute(plainText, args); err != nil {
return nil, errors.NewEf(err, "failed to execute plain-text template")
}
html := new(bytes.Buffer)
- if err := r.projectInviteEmail.Html.Execute(html, args); err != nil {
+ if err := r.eTemplattes.ProjectInviteEmail.Html.Execute(html, args); err != nil {
return nil, errors.NewEf(err, "failed to execute html template")
}
- if err := r.sendSupportEmail(ctx, r.projectInviteEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
+ if err := r.sendSupportEmail(ctx, r.eTemplattes.ProjectInviteEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
return nil, errors.NewE(err)
}
@@ -114,16 +111,16 @@ func (r *commsSvc) SendPasswordResetEmail(ctx context.Context, input *comms.Pass
"Link": fmt.Sprintf("%v?token=%v", r.ev.ResetPasswordWebUrl, input.ResetToken),
}
- if err := r.resetPasswordEmail.PlainText.Execute(plainText, args); err != nil {
+ if err := r.eTemplattes.ResetPasswordEmail.PlainText.Execute(plainText, args); err != nil {
return nil, errors.NewEf(err, "failed to execute plain text template")
}
html := new(bytes.Buffer)
- if err := r.resetPasswordEmail.Html.Execute(html, args); err != nil {
+ if err := r.eTemplattes.ResetPasswordEmail.Html.Execute(html, args); err != nil {
return nil, errors.NewEf(err, "failed to execute html template")
}
- if err := r.sendSupportEmail(ctx, r.resetPasswordEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
+ if err := r.sendSupportEmail(ctx, r.eTemplattes.ResetPasswordEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
return nil, errors.NewE(err)
}
@@ -141,16 +138,16 @@ func (r *commsSvc) SendWelcomeEmail(ctx context.Context, input *comms.WelcomeEma
}(),
}
- if err := r.welcomeEmail.PlainText.Execute(plainText, args); err != nil {
+ if err := r.eTemplattes.WelcomeEmail.PlainText.Execute(plainText, args); err != nil {
return nil, errors.NewEf(err, "failed to execute plain text template")
}
html := new(bytes.Buffer)
- if err := r.welcomeEmail.Html.Execute(html, args); err != nil {
+ if err := r.eTemplattes.WelcomeEmail.Html.Execute(html, args); err != nil {
return nil, errors.NewEf(err, "failed to execute html template")
}
- if err := r.sendSupportEmail(ctx, r.welcomeEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
+ if err := r.sendSupportEmail(ctx, r.eTemplattes.WelcomeEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
return nil, errors.NewE(err)
}
@@ -168,16 +165,16 @@ func (r *commsSvc) SendWaitingEmail(ctx context.Context, input *comms.WelcomeEma
}(),
}
- if err := r.waitingEmail.PlainText.Execute(plainText, args); err != nil {
+ if err := r.eTemplattes.WaitingEmail.PlainText.Execute(plainText, args); err != nil {
return nil, errors.NewEf(err, "failed to execute plain text template")
}
html := new(bytes.Buffer)
- if err := r.waitingEmail.Html.Execute(html, args); err != nil {
+ if err := r.eTemplattes.WaitingEmail.Html.Execute(html, args); err != nil {
return nil, errors.NewEf(err, "failed to execute html template")
}
- if err := r.sendSupportEmail(ctx, r.waitingEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
+ if err := r.sendSupportEmail(ctx, r.eTemplattes.WaitingEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
return nil, errors.NewE(err)
}
return &comms.Void{}, nil
@@ -195,30 +192,25 @@ func (r *commsSvc) SendVerificationEmail(ctx context.Context, input *comms.Verif
"Link": fmt.Sprintf("%v?token=%v", r.ev.VerifyEmailWebUrl, input.VerificationToken),
}
- if err := r.userVerificationEmail.PlainText.Execute(plainText, args); err != nil {
+ if err := r.eTemplattes.UserVerificationEmail.PlainText.Execute(plainText, args); err != nil {
return nil, errors.NewEf(err, "failed to execute plain text template")
}
html := new(bytes.Buffer)
- if err := r.userVerificationEmail.Html.Execute(html, args); err != nil {
+ if err := r.eTemplattes.UserVerificationEmail.Html.Execute(html, args); err != nil {
return nil, errors.NewEf(err, "failed to execute html template")
}
- if err := r.sendSupportEmail(ctx, r.userVerificationEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
+ if err := r.sendSupportEmail(ctx, r.eTemplattes.UserVerificationEmail.Subject, input.Email, input.Name, plainText.String(), html.String()); err != nil {
return nil, errors.NewE(err)
}
return &comms.Void{}, nil
}
-func newCommsSvc(mailer mail.Mailer, ev *env.Env, ai AccountInviteEmail, pi ProjectInviteEmail, rp RestPasswordEmail, uv UserVerificationEmail, nwl WaitingEmail, wl WelcomeEmail) comms.CommsServer {
+func newCommsSvc(mailer mail.Mailer, ev *env.Env, et *domain.EmailTemplates) comms.CommsServer {
return &commsSvc{
- mailer: mailer,
- supportEmail: ev.SupportEmail,
- ev: ev,
- accountInviteEmail: ai,
- projectInviteEmail: pi,
- resetPasswordEmail: rp,
- userVerificationEmail: uv,
- welcomeEmail: wl,
- waitingEmail: nwl,
+ mailer: mailer,
+ supportEmail: ev.SupportEmail,
+ ev: ev,
+ eTemplattes: et,
}
}
diff --git a/apps/comms/internal/app/notify-publish.go b/apps/comms/internal/app/notify-publish.go
new file mode 100644
index 000000000..ee863ccb9
--- /dev/null
+++ b/apps/comms/internal/app/notify-publish.go
@@ -0,0 +1,22 @@
+package app
+
+import (
+ "github.com/kloudlite/api/apps/comms/internal/domain"
+ "github.com/kloudlite/api/pkg/logging"
+ "github.com/kloudlite/api/pkg/nats"
+)
+
+type ResourceEventPublisherImpl struct {
+ cli *nats.Client
+ logger logging.Logger
+}
+
+func (r *ResourceEventPublisherImpl) publish(subject string, msg domain.PublishMsg) {
+ if err := r.cli.Conn.Publish(subject, []byte(msg)); err != nil {
+ r.logger.Errorf(err, "failed to publish message to subject %q", subject)
+ }
+}
+
+func NewResourceEventPublisher(cli *nats.Client, logger logging.Logger) domain.ResourceEventPublisher {
+ return &ResourceEventPublisherImpl{cli, logger}
+}
diff --git a/apps/comms/internal/app/process-notification.go b/apps/comms/internal/app/process-notification.go
new file mode 100644
index 000000000..aa86b3654
--- /dev/null
+++ b/apps/comms/internal/app/process-notification.go
@@ -0,0 +1,30 @@
+package app
+
+import (
+ "context"
+
+ "github.com/kloudlite/api/apps/comms/internal/domain"
+ "github.com/kloudlite/api/pkg/logging"
+ "github.com/kloudlite/api/pkg/messaging/types"
+
+ ntypes "github.com/kloudlite/api/apps/comms/types"
+)
+
+func processNotification(ctx context.Context, d domain.Domain, consumer NotificationConsumer, logr logging.Logger) error {
+ return consumer.Consume(func(msg *types.ConsumeMsg) error {
+ logr.Infof("received notification %s (%s)", msg.Subject)
+
+ notif := ntypes.Notification{}
+ if err := notif.ParseBytes(msg.Payload); err != nil {
+ return err
+ }
+
+ return d.Notify(context.Background(), ¬if)
+ },
+ types.ConsumeOpts{
+ OnError: func(err error) error {
+ logr.Errorf(err, "could not consume notification")
+ return nil
+ },
+ })
+}
diff --git a/apps/comms/internal/domain/api.go b/apps/comms/internal/domain/api.go
new file mode 100644
index 000000000..78a7f8f6a
--- /dev/null
+++ b/apps/comms/internal/domain/api.go
@@ -0,0 +1,34 @@
+package domain
+
+import (
+ "context"
+
+ "github.com/kloudlite/api/apps/comms/internal/domain/entities"
+ "github.com/kloudlite/api/apps/comms/types"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+type Domain interface {
+ ListNotifications(ctx CommsContext, pagination repos.CursorPagination) (*repos.PaginatedRecord[*types.Notification], error)
+ MarkNotificationAsRead(ctx CommsContext, id repos.ID) (*types.Notification, error)
+
+ GetNotificationConfig(ctx CommsContext) (*entities.NotificationConf, error)
+ UpdateNotificationConfig(ctx CommsContext, config entities.NotificationConf) (*entities.NotificationConf, error)
+
+ UpdateSubscriptionConfig(ctx CommsContext, id repos.ID, config entities.Subscription) (*entities.Subscription, error)
+ GetSubscriptionConfig(ctx CommsContext, id repos.ID) (*entities.Subscription, error)
+
+ Notify(ctx context.Context, notification *types.Notification) error
+}
+
+type PublishMsg string
+
+const (
+ PublishAdd PublishMsg = "added"
+ PublishDelete PublishMsg = "deleted"
+ PublishUpdate PublishMsg = "updated"
+)
+
+type ResourceEventPublisher interface {
+ // PublishBuildNotification(cluster *types.Notification, msg PublishMsg)
+}
diff --git a/apps/comms/internal/domain/context.go b/apps/comms/internal/domain/context.go
new file mode 100644
index 000000000..dbf59ea41
--- /dev/null
+++ b/apps/comms/internal/domain/context.go
@@ -0,0 +1,29 @@
+package domain
+
+import (
+ "context"
+
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+type CommsContext struct {
+ context.Context
+ UserId repos.ID
+ UserName string
+ AccountName string
+ UserEmail string
+}
+
+func (c CommsContext) GetAccountName() string {
+ return c.AccountName
+}
+
+func (c CommsContext) GetUserId() repos.ID {
+ return c.UserId
+}
+func (c CommsContext) GetUserEmail() string {
+ return c.UserEmail
+}
+func (c CommsContext) GetUserName() string {
+ return c.UserName
+}
diff --git a/apps/comms/internal/domain/entities/field-constants/gen.go b/apps/comms/internal/domain/entities/field-constants/gen.go
new file mode 100644
index 000000000..05b8bcf15
--- /dev/null
+++ b/apps/comms/internal/domain/entities/field-constants/gen.go
@@ -0,0 +1,5 @@
+package field_constants
+
+//go:generate go run github.com/kloudlite/api/cmd/struct-json-path --pkg github.com/kloudlite/api/apps/comms/internal/domain/entities --common-path "metadata" --common-path "apiVersion" --common-path "kind" --common-path "status" --common-path "syncStatus" --common-path "lastUpdatedBy" --common-path "createdBy" --common-path "displayName" --common-path "creationTime" --common-path "updateTime" --common-path "id" --common-path "recordVersion" --common-path "accountName" --common-path "clusterName" --common-path "markedForDeletion" --out-file ./generated_constants.go --banner "package field_constants" --ignore-nesting "time.Time" --ignore-nesting "k8s.io/apimachinery/pkg/apis/meta/v1.Time"
+
+//go:generate go run github.com/kloudlite/api/cmd/struct-json-path --pkg github.com/kloudlite/api/apps/comms/types --out-file ./generated_constants_notification.go --banner "package field_constants" --ignore-nesting "time.Time" --ignore-nesting "k8s.io/apimachinery/pkg/apis/meta/v1.Time"
diff --git a/apps/comms/internal/domain/entities/field-constants/generated_constants.go b/apps/comms/internal/domain/entities/field-constants/generated_constants.go
new file mode 100644
index 000000000..9167e08f1
--- /dev/null
+++ b/apps/comms/internal/domain/entities/field-constants/generated_constants.go
@@ -0,0 +1,69 @@
+// DO NOT EDIT. generated by "github.com/kloudlite/api/cmd/struct-json-path"
+
+package field_constants
+
+// constant vars generated for struct Email
+const (
+ EmailEnabled = "enabled"
+ EmailMailAddress = "mailAddress"
+)
+
+// constant vars generated for struct NotificationConf
+const (
+ NotificationConfEmail = "email"
+ NotificationConfEmailEnabled = "email.enabled"
+ NotificationConfEmailMailAddress = "email.mailAddress"
+ NotificationConfSlack = "slack"
+ NotificationConfSlackEnabled = "slack.enabled"
+ NotificationConfSlackUrl = "slack.url"
+ NotificationConfTelegram = "telegram"
+ NotificationConfTelegramChatId = "telegram.chatId"
+ NotificationConfTelegramEnabled = "telegram.enabled"
+ NotificationConfTelegramToken = "telegram.token"
+ NotificationConfWebhook = "webhook"
+ NotificationConfWebhookEnabled = "webhook.enabled"
+ NotificationConfWebhookUrl = "webhook.url"
+)
+
+// constant vars generated for struct Slack
+const (
+ SlackEnabled = "enabled"
+ SlackUrl = "url"
+)
+
+// constant vars generated for struct Subscription
+const (
+ SubscriptionEnabled = "enabled"
+ SubscriptionMailAddress = "mailAddress"
+)
+
+// constant vars generated for struct Telegram
+const (
+ TelegramChatId = "chatId"
+ TelegramEnabled = "enabled"
+ TelegramToken = "token"
+)
+
+// constant vars generated for struct Webhook
+const (
+ WebhookEnabled = "enabled"
+ WebhookUrl = "url"
+)
+
+// constant vars generated for struct
+const (
+ AccountName = "accountName"
+ CreatedBy = "createdBy"
+ CreatedByUserEmail = "createdBy.userEmail"
+ CreatedByUserId = "createdBy.userId"
+ CreatedByUserName = "createdBy.userName"
+ CreationTime = "creationTime"
+ Id = "id"
+ LastUpdatedBy = "lastUpdatedBy"
+ LastUpdatedByUserEmail = "lastUpdatedBy.userEmail"
+ LastUpdatedByUserId = "lastUpdatedBy.userId"
+ LastUpdatedByUserName = "lastUpdatedBy.userName"
+ MarkedForDeletion = "markedForDeletion"
+ RecordVersion = "recordVersion"
+ UpdateTime = "updateTime"
+)
diff --git a/apps/comms/internal/domain/entities/field-constants/generated_constants_notification.go b/apps/comms/internal/domain/entities/field-constants/generated_constants_notification.go
new file mode 100644
index 000000000..a0aebf9a6
--- /dev/null
+++ b/apps/comms/internal/domain/entities/field-constants/generated_constants_notification.go
@@ -0,0 +1,33 @@
+// DO NOT EDIT. generated by "github.com/kloudlite/api/cmd/struct-json-path"
+
+package field_constants
+
+// constant vars generated for struct Notification
+const (
+ NotificationAccountName = "accountName"
+ NotificationContent = "content"
+ NotificationContentBody = "content.body"
+ NotificationContentImage = "content.image"
+ NotificationContentLink = "content.link"
+ NotificationContentSubject = "content.subject"
+ NotificationContentTitle = "content.title"
+ NotificationCreationTime = "creationTime"
+ NotificationId = "id"
+ NotificationMarkedForDeletion = "markedForDeletion"
+ NotificationNotificationType = "notificationType"
+ NotificationRead = "read"
+ NotificationRecordVersion = "recordVersion"
+ NotificationUpdateTime = "updateTime"
+)
+
+// constant vars generated for struct NotifyContent
+const (
+ NotifyContentBody = "body"
+ NotifyContentImage = "image"
+ NotifyContentLink = "link"
+ NotifyContentSubject = "subject"
+ NotifyContentTitle = "title"
+)
+
+// constant vars generated for struct
+const ()
diff --git a/apps/comms/internal/domain/entities/notification-configuration.go b/apps/comms/internal/domain/entities/notification-configuration.go
new file mode 100644
index 000000000..c1d3eb8be
--- /dev/null
+++ b/apps/comms/internal/domain/entities/notification-configuration.go
@@ -0,0 +1,55 @@
+package entities
+
+import (
+ "github.com/kloudlite/api/common"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+type Email struct {
+ Enabled bool `json:"enabled"`
+ MailAddress string `json:"mailAddress"`
+}
+
+type Slack struct {
+ Enabled bool `json:"enabled"`
+ Url string `json:"url"`
+}
+
+type Telegram struct {
+ Enabled bool `json:"enabled"`
+ Token string `json:"token"`
+ ChatID string `json:"chatId"`
+}
+
+type Webhook struct {
+ Enabled bool `json:"enabled"`
+ URL string `json:"url"`
+}
+
+type NotificationConf struct {
+ repos.BaseEntity `json:",inline" graphql:"noinput"`
+ CreatedBy common.CreatedOrUpdatedBy `json:"createdBy" graphql:"noinput"`
+ LastUpdatedBy common.CreatedOrUpdatedBy `json:"lastUpdatedBy" graphql:"noinput"`
+
+ Email *Email `json:"email"`
+ Slack *Slack `json:"slack"`
+ Telegram *Telegram `json:"telegram"`
+ Webhook *Webhook `json:"webhook"`
+
+ AccountName string `json:"accountName" graphql:"noinput"`
+}
+
+var NotificationConfIndexes = []repos.IndexField{
+ {
+ Field: []repos.IndexKey{
+ {Key: "id", Value: repos.IndexAsc},
+ },
+ Unique: true,
+ },
+ {
+ Field: []repos.IndexKey{
+ {Key: "accountName", Value: repos.IndexAsc},
+ },
+ Unique: true,
+ },
+}
diff --git a/apps/comms/internal/domain/entities/subscription.go b/apps/comms/internal/domain/entities/subscription.go
new file mode 100644
index 000000000..4212d2f61
--- /dev/null
+++ b/apps/comms/internal/domain/entities/subscription.go
@@ -0,0 +1,39 @@
+package entities
+
+import (
+ "github.com/kloudlite/api/common"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+// type SubscriptionConf struct {
+// AlertsEnabled bool `json:"alertsEnabled"`
+// NotificationsEnabled bool `json:"notificationsEnabled"`
+// }
+
+type Subscription struct {
+ repos.BaseEntity `json:",inline" graphql:"noinput"`
+
+ CreatedBy common.CreatedOrUpdatedBy `json:"createdBy" graphql:"noinput"`
+ LastUpdatedBy common.CreatedOrUpdatedBy `json:"lastUpdatedBy" graphql:"noinput"`
+
+ AccountName string `json:"accountName" graphql:"noinput"`
+ MailAddress string `json:"mailAddress"`
+
+ // Configurations *SubscriptionConf `json:"configurations"`
+ Enabled bool `json:"enabled"`
+}
+
+var SubscriptionIndexes = []repos.IndexField{
+ {
+ Field: []repos.IndexKey{
+ {Key: "id", Value: repos.IndexAsc},
+ },
+ Unique: true,
+ },
+ {
+ Field: []repos.IndexKey{
+ {Key: "accountName", Value: repos.IndexAsc},
+ },
+ Unique: true,
+ },
+}
diff --git a/apps/comms/internal/domain/mail-parser.go b/apps/comms/internal/domain/mail-parser.go
new file mode 100644
index 000000000..5f4ad5a18
--- /dev/null
+++ b/apps/comms/internal/domain/mail-parser.go
@@ -0,0 +1,99 @@
+package domain
+
+import (
+ "embed"
+ "fmt"
+ "text/template"
+
+ "github.com/kloudlite/api/pkg/errors"
+)
+
+type EmailTemplatesDir struct {
+ embed.FS
+}
+
+type EmailTemplate struct {
+ Subject string
+ Html *template.Template
+ PlainText *template.Template
+}
+
+type EmailTemplates struct {
+ AccountInviteEmail *EmailTemplate
+ ProjectInviteEmail *EmailTemplate
+ ResetPasswordEmail *EmailTemplate
+ UserVerificationEmail *EmailTemplate
+ WelcomeEmail *EmailTemplate
+ WaitingEmail *EmailTemplate
+ AlertEmail *EmailTemplate
+}
+
+func parseMailTemplate(et EmailTemplatesDir, templateName string, subject string) (*EmailTemplate, error) {
+ txtFile, err := et.ReadFile(fmt.Sprintf("email-templates/%v/email.txt", templateName))
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+ txt, err := template.New("email-text").Parse(string(txtFile))
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+
+ htmlFile, err := et.ReadFile(fmt.Sprintf("email-templates/%v/email.html", templateName))
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+ html, err := template.New(templateName).Parse(string(htmlFile))
+ if err != nil {
+ return nil, errors.NewE(err)
+ }
+
+ return &EmailTemplate{
+ Subject: subject,
+ Html: html,
+ PlainText: txt,
+ }, nil
+}
+
+func GetEmailTemplates(et EmailTemplatesDir) (*EmailTemplates, error) {
+ accountInvite, err := parseMailTemplate(et, "account-invite", "[Kloudlite] Account Invite")
+ if err != nil {
+ return nil, err
+ }
+
+ projectInvite, err := parseMailTemplate(et, "project-invite", "[Kloudlite] Project Invite")
+ if err != nil {
+ return nil, err
+ }
+
+ restPassword, err := parseMailTemplate(et, "reset-password", "[Kloudlite] Reset Password")
+ if err != nil {
+ return nil, err
+ }
+
+ userVerification, err := parseMailTemplate(et, "user-verification", "[Kloudlite] Verify Email")
+ if err != nil {
+ return nil, err
+ }
+
+ welcome, err := parseMailTemplate(et, "welcome", "[Kloudlite] Welcome to Kloudlite")
+ if err != nil {
+ return nil, err
+ }
+
+ waiting, err := parseMailTemplate(et, "waiting", "[Kloudlite] Welcome to Kloudlite")
+ if err != nil {
+ return nil, err
+ }
+
+ alert, err := parseMailTemplate(et, "alert", "[Kloudlite] Console Notification")
+
+ return &EmailTemplates{
+ AccountInviteEmail: accountInvite,
+ ProjectInviteEmail: projectInvite,
+ ResetPasswordEmail: restPassword,
+ UserVerificationEmail: userVerification,
+ WelcomeEmail: welcome,
+ WaitingEmail: waiting,
+ AlertEmail: alert,
+ }, nil
+}
diff --git a/apps/comms/internal/domain/main.go b/apps/comms/internal/domain/main.go
new file mode 100644
index 000000000..3e893fc8e
--- /dev/null
+++ b/apps/comms/internal/domain/main.go
@@ -0,0 +1,63 @@
+package domain
+
+import (
+ "github.com/kloudlite/api/apps/comms/internal/domain/entities"
+ "github.com/kloudlite/api/apps/comms/internal/env"
+ "github.com/kloudlite/api/apps/comms/types"
+ "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam"
+ // "github.com/kloudlite/api/pkg/kv"
+ "github.com/kloudlite/api/pkg/logging"
+ "github.com/kloudlite/api/pkg/mail"
+ "github.com/kloudlite/api/pkg/repos"
+ "go.uber.org/fx"
+)
+
+type Impl struct {
+ notificationRepo repos.DbRepo[*types.Notification]
+ subscriptionRepo repos.DbRepo[*entities.Subscription]
+ notificationConfigRepo repos.DbRepo[*entities.NotificationConf]
+
+ iamClient iam.IAMClient
+ envs *env.Env
+ logger logging.Logger
+ // cacheClient kv.BinaryDataRepo
+ // authClient auth.AuthClient
+
+ eTemplates *EmailTemplates
+
+ resourceEventPublisher ResourceEventPublisher
+
+ mailer mail.Mailer
+
+ // CommsServer CommsServer
+}
+
+var Module = fx.Module("domain", fx.Provide(func(e *env.Env,
+ notificationRepo repos.DbRepo[*types.Notification],
+ subscriptionRepo repos.DbRepo[*entities.Subscription],
+ notificationConfigRepo repos.DbRepo[*entities.NotificationConf],
+
+ logger logging.Logger,
+ iamClient iam.IAMClient,
+ // cacheClient kv.BinaryDataRepo,
+ // authClient auth.AuthClient,
+ resourceEventPublisher ResourceEventPublisher,
+
+ eTemplates *EmailTemplates,
+ mailer mail.Mailer,
+) (Domain, error) {
+ return &Impl{
+ iamClient: iamClient,
+ envs: e,
+ logger: logger,
+ // cacheClient: cacheClient,
+ // authClient: authClient,
+ resourceEventPublisher: resourceEventPublisher,
+
+ notificationRepo: notificationRepo,
+ subscriptionRepo: subscriptionRepo,
+ notificationConfigRepo: notificationConfigRepo,
+ mailer: mailer,
+ eTemplates: eTemplates,
+ }, nil
+}))
diff --git a/apps/comms/internal/domain/notification-config.go b/apps/comms/internal/domain/notification-config.go
new file mode 100644
index 000000000..0a2ab6a29
--- /dev/null
+++ b/apps/comms/internal/domain/notification-config.go
@@ -0,0 +1,86 @@
+package domain
+
+import (
+ "github.com/kloudlite/api/apps/comms/internal/domain/entities"
+ iamT "github.com/kloudlite/api/apps/iam/types"
+ "github.com/kloudlite/api/common"
+ "github.com/kloudlite/api/common/fields"
+ "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam"
+ "github.com/kloudlite/api/pkg/errors"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+func (d *Impl) GetNotificationConfig(ctx CommsContext) (*entities.NotificationConf, error) {
+ co, err := d.iamClient.Can(ctx, &iam.CanIn{
+ UserId: string(ctx.UserId),
+ ResourceRefs: []string{iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName)},
+ Action: string(iamT.GetAccount),
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ if !co.Status {
+ return nil, errors.NewE(errors.Newf("user %s does not have permission to get account %s", ctx.UserId, ctx.AccountName))
+ }
+
+ nc, err := d.notificationConfigRepo.FindOne(ctx, repos.Filter{})
+ if err != nil {
+ return nil, err
+ }
+
+ if nc == nil {
+ n, err := d.notificationConfigRepo.Create(ctx, &entities.NotificationConf{
+ CreatedBy: common.CreatedOrUpdatedBy{
+ UserId: ctx.UserId,
+ UserName: ctx.UserName,
+ UserEmail: ctx.UserEmail,
+ },
+ AccountName: ctx.AccountName,
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ nc = n
+ }
+
+ return nc, nil
+}
+
+func (d *Impl) UpdateNotificationConfig(ctx CommsContext, config entities.NotificationConf) (*entities.NotificationConf, error) {
+ co, err := d.iamClient.Can(ctx, &iam.CanIn{
+ UserId: string(ctx.UserId),
+ ResourceRefs: []string{
+ iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName),
+ },
+ Action: string(iamT.UpdateAccount),
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ if !co.Status {
+ return nil, errors.NewE(errors.Newf("user %s does not have permission to update account %s", ctx.UserId, ctx.AccountName))
+ }
+
+ xnc, err := d.notificationConfigRepo.FindOne(ctx, repos.Filter{
+ fields.AccountName: ctx.AccountName,
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ if xnc == nil {
+ return nil, errors.NewE(errors.Newf("notification config not found"))
+ }
+
+ // TODO:(@abdheshnayak) - check for subscription
+
+ xnc.Email = config.Email
+ xnc.Slack = config.Slack
+ xnc.Telegram = config.Telegram
+ xnc.Webhook = config.Webhook
+
+ return d.notificationConfigRepo.UpdateById(ctx, xnc.Id, xnc)
+}
diff --git a/apps/comms/internal/domain/notification.go b/apps/comms/internal/domain/notification.go
new file mode 100644
index 000000000..3442d497c
--- /dev/null
+++ b/apps/comms/internal/domain/notification.go
@@ -0,0 +1,97 @@
+package domain
+
+import (
+ "context"
+
+ "github.com/kloudlite/api/apps/comms/types"
+ iamT "github.com/kloudlite/api/apps/iam/types"
+ "github.com/kloudlite/api/common/fields"
+ "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam"
+ "github.com/kloudlite/api/pkg/errors"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+func (d *Impl) ListNotifications(ctx CommsContext, pagination repos.CursorPagination) (*repos.PaginatedRecord[*types.Notification], error) {
+ co, err := d.iamClient.Can(ctx, &iam.CanIn{
+ UserId: string(ctx.UserId),
+ ResourceRefs: []string{iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName)},
+ Action: string(iamT.GetAccount),
+ })
+
+ if err != nil {
+ return nil, err
+ }
+
+ if !co.Status {
+ return nil, errors.NewE(errors.Newf("user %s does not have permission to get account %s", ctx.UserId, ctx.AccountName))
+ }
+
+ n, err := d.notificationRepo.FindPaginated(ctx, repos.Filter{
+ fields.AccountName: ctx.AccountName,
+ }, pagination)
+ if err != nil {
+ return nil, err
+ }
+
+ return n, nil
+}
+
+func (d *Impl) MarkNotificationAsRead(ctx CommsContext, id repos.ID) (*types.Notification, error) {
+ co, err := d.iamClient.Can(ctx, &iam.CanIn{
+ UserId: string(ctx.UserId),
+ ResourceRefs: []string{iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName)},
+ Action: string(iamT.UpdateAccount),
+ })
+
+ if err != nil {
+ return nil, err
+ }
+
+ if !co.Status {
+ return nil, errors.NewE(errors.Newf("user %s does not have permission to update account %s", ctx.UserId, ctx.AccountName))
+ }
+
+ xnotf, err := d.notificationRepo.FindOne(ctx, repos.Filter{
+ fields.AccountName: ctx.AccountName,
+ fields.Id: id,
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ if xnotf == nil {
+ return nil, errors.NewE(errors.Newf("notification with id %s not found", id))
+ }
+
+ xnotf.Read = true
+
+ n, err := d.notificationRepo.UpdateById(ctx, id, xnotf)
+ if err != nil {
+ return nil, err
+ }
+
+ return n, nil
+}
+
+func (d *Impl) Notify(ctx context.Context, notification *types.Notification) error {
+ _, err := d.notificationRepo.Create(ctx, notification)
+ if err != nil {
+ return err
+ }
+
+ nc, err := d.notificationConfigRepo.FindOne(ctx, repos.Filter{})
+ if err != nil {
+ return err
+ }
+
+ if nc == nil {
+ return errors.NewE(errors.Newf("notification config not found"))
+ }
+
+ np := newNotificationProcessor(context.Background(), d, notification, nc)
+ if err := np.Send(); err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/apps/comms/internal/domain/process-notification.go b/apps/comms/internal/domain/process-notification.go
new file mode 100644
index 000000000..b693c44a6
--- /dev/null
+++ b/apps/comms/internal/domain/process-notification.go
@@ -0,0 +1,186 @@
+package domain
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/kloudlite/api/apps/comms/internal/domain/entities"
+ "github.com/kloudlite/api/apps/comms/types"
+ "github.com/kloudlite/api/pkg/mail"
+)
+
+type notificationProcessor interface {
+ Send() error
+}
+
+type npClient struct {
+ domain *Impl
+ ctx context.Context
+ n *types.Notification
+ nc *entities.NotificationConf
+}
+
+func newNotificationProcessor(ctx context.Context, domain *Impl, n *types.Notification, nc *entities.NotificationConf) notificationProcessor {
+ return &npClient{
+ domain: domain,
+ ctx: ctx,
+ n: n,
+ nc: nc,
+ }
+}
+
+func (c *npClient) Send() error {
+ logger := c.domain.logger
+
+ if err := c.handleTelegram(); err != nil {
+ logger.Errorf(err, "failed to send telegram notification")
+ }
+
+ if err := c.handleSlack(); err != nil {
+ logger.Errorf(err, "failed to send slack notification")
+ }
+
+ if err := c.handleEmail(); err != nil {
+ logger.Errorf(err, "failed to send email notification")
+ }
+
+ if err := c.handleWebhook(); err != nil {
+ logger.Errorf(err, "failed to send webhook notification")
+ }
+
+ if err := c.handleConsoleUpdate(); err != nil {
+ logger.Errorf(err, "failed to send console update notification")
+ }
+
+ return nil
+}
+
+func (c *npClient) handleConsoleUpdate() error {
+ // TODO: (@abdheshnayak) - needs to be implemented
+ c.domain.logger.Warnf("console update notification is not implemented")
+
+ return nil
+}
+
+func (c *npClient) handleEmail() error {
+ if c.nc.Email == nil || !c.nc.Email.Enabled {
+ return nil
+ }
+
+ // TODO: (@abdheshnayak) - check for subscription
+
+ // subs, err := c.domain.subscriptionRepo.FindOne(c.ctx, repos.Filter{
+ // fields.AccountName: c.n.AccountName,
+ // fc.SubscriptionMailAddress: c.nc.Email.MailAddress,
+ // })
+
+ // if err != nil {
+ // return err
+ // }
+ // if subs == nil {
+ // return fmt.Errorf("subscription not found")
+ // }
+ //
+ // if !subs.Enabled {
+ // return fmt.Errorf("subscription is not enabled")
+ // }
+
+ args := map[string]any{
+ "Type": c.n.Type,
+ "Title": c.n.Content.Title,
+ "Body": c.n.Content.Body,
+ "Link": c.n.Content.Link,
+ }
+
+ plainText := new(bytes.Buffer)
+ html := new(bytes.Buffer)
+ if err := c.domain.eTemplates.AlertEmail.PlainText.Execute(plainText, args); err != nil {
+ return err
+ }
+ if err := c.domain.eTemplates.AlertEmail.Html.Execute(html, args); err != nil {
+ return err
+ }
+
+ if err := c.domain.mailer.SendEmail(c.ctx, mail.Email{
+ FromEmailAddress: c.domain.envs.SupportEmail,
+ FromName: "Kloudlite Support",
+ Subject: c.n.Content.Subject,
+ ToEmailAddress: c.nc.Email.MailAddress,
+ ToName: c.n.AccountName,
+ PlainText: plainText.String(),
+ HtmlText: html.String(),
+ }); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (c *npClient) handleSlack() error {
+ if c.nc.Slack == nil || !c.nc.Slack.Enabled {
+ return nil
+ }
+
+ m := &struct {
+ Text string `json:"text"`
+ }{c.n.ToPlain()}
+
+ b, err := json.Marshal(m)
+ if err != nil {
+ return err
+ }
+
+ return c.HttpsPost(c.nc.Slack.Url, b)
+}
+
+func (c *npClient) handleTelegram() error {
+ if c.nc.Telegram == nil || !c.nc.Telegram.Enabled {
+ return nil
+ }
+
+ url := fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage", c.nc.Telegram.Token)
+
+ m := &struct {
+ ChatID string `json:"chat_id"`
+ Text string `json:"text"`
+ }{c.nc.Telegram.ChatID, c.n.ToPlain()}
+
+ b, err := json.Marshal(m)
+ if err != nil {
+ return err
+ }
+
+ return c.HttpsPost(url, []byte(b))
+}
+
+func (c *npClient) handleWebhook() error {
+ if c.nc.Webhook == nil || !c.nc.Webhook.Enabled {
+ return nil
+ }
+
+ return c.HttpsPost(c.nc.Webhook.URL, []byte(c.n.ToPlain()))
+}
+
+func (c *npClient) HttpsPost(url string, body []byte) error {
+ client := &http.Client{
+ Timeout: time.Second * 10,
+ }
+ req, err := http.NewRequest("POST", url, bytes.NewBuffer(body))
+ if err != nil {
+ return err
+ }
+
+ req.Header.Set("Content-Type", "application/json")
+
+ resp, err := client.Do(req)
+ if err != nil {
+ return err
+ }
+ defer resp.Body.Close()
+
+ return nil
+}
diff --git a/apps/comms/internal/domain/subscription.go b/apps/comms/internal/domain/subscription.go
new file mode 100644
index 000000000..5b1951890
--- /dev/null
+++ b/apps/comms/internal/domain/subscription.go
@@ -0,0 +1,49 @@
+package domain
+
+import (
+ "github.com/kloudlite/api/apps/comms/internal/domain/entities"
+ fc "github.com/kloudlite/api/apps/comms/internal/domain/entities/field-constants"
+ "github.com/kloudlite/api/common/fields"
+ "github.com/kloudlite/api/pkg/errors"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+func (d *Impl) isMailAddressValid(ctx CommsContext, id, mailAddress string) bool {
+ if mailAddress == "" {
+ return false
+ }
+
+ if id == "" {
+ return false
+ }
+
+ s, err := d.subscriptionRepo.FindOne(ctx, repos.Filter{
+ fc.SubscriptionMailAddress: mailAddress,
+ fields.Id: id,
+ })
+
+ if err != nil {
+ return false
+ }
+
+ return s != nil
+}
+
+func (d *Impl) UpdateSubscriptionConfig(ctx CommsContext, id repos.ID, config entities.Subscription) (*entities.Subscription, error) {
+ if config.MailAddress == "" {
+ return nil, errors.NewE(errors.New("mail address is required"))
+ }
+
+ b := d.isMailAddressValid(ctx, string(id), config.MailAddress)
+ if !b {
+ return nil, errors.NewE(errors.New("mail address is not valid"))
+ }
+
+ return d.subscriptionRepo.UpdateOne(ctx, repos.Filter{
+ fields.Id: id,
+ }, &config)
+}
+
+func (d *Impl) GetSubscriptionConfig(ctx CommsContext, id repos.ID) (*entities.Subscription, error) {
+ return d.subscriptionRepo.FindOne(ctx, repos.Filter{fields.Id: id})
+}
diff --git a/apps/comms/internal/env/env.go b/apps/comms/internal/env/env.go
index 4fddf1497..4ccada7d2 100644
--- a/apps/comms/internal/env/env.go
+++ b/apps/comms/internal/env/env.go
@@ -16,6 +16,22 @@ type Env struct {
ResetPasswordWebUrl string `env:"RESET_PASSWORD_WEB_URL" required:"true"`
VerifyEmailWebUrl string `env:"VERIFY_EMAIL_WEB_URL" required:"true"`
+
+ AccountCookieName string `env:"ACCOUNT_COOKIE_NAME" required:"true"`
+
+ NatsURL string `env:"NATS_URL" required:"true"`
+
+ // NATS:start
+ NotificationNatsStream string `env:"NOTIFICATION_NATS_STREAM" required:"true"`
+ // NATS:start
+
+ IsDev bool
+
+ SessionKVBucket string `env:"SESSION_KV_BUCKET" required:"true"`
+ IAMGrpcAddr string `env:"IAM_GRPC_ADDR" required:"true"`
+
+ CommsDBUri string `env:"MONGO_URI" required:"true"`
+ CommsDBName string `env:"MONGO_DB_NAME" required:"true"`
}
func LoadEnv() (*Env, error) {
diff --git a/apps/comms/internal/framework/framework.go b/apps/comms/internal/framework/framework.go
index 23c466da2..e2fa8194f 100644
--- a/apps/comms/internal/framework/framework.go
+++ b/apps/comms/internal/framework/framework.go
@@ -3,19 +3,49 @@ package framework
import (
"context"
"fmt"
+ "time"
+
"github.com/kloudlite/api/apps/comms/internal/app"
"github.com/kloudlite/api/apps/comms/internal/env"
+ "github.com/kloudlite/api/common"
"github.com/kloudlite/api/pkg/errors"
"github.com/kloudlite/api/pkg/grpc"
+ rpc "github.com/kloudlite/api/pkg/grpc"
+ httpServer "github.com/kloudlite/api/pkg/http-server"
+ "github.com/kloudlite/api/pkg/kv"
"github.com/kloudlite/api/pkg/logging"
"github.com/kloudlite/api/pkg/mail"
+ "github.com/kloudlite/api/pkg/nats"
+ mongoDb "github.com/kloudlite/api/pkg/repos"
"go.uber.org/fx"
- "time"
)
+type fm struct {
+ ev *env.Env
+}
+
+func (fm *fm) GetMongoConfig() (url string, dbName string) {
+ return fm.ev.CommsDBUri, fm.ev.CommsDBName
+}
+
var Module = fx.Module(
"framework",
+ fx.Provide(func(ev *env.Env) *fm {
+ return &fm{ev}
+ }),
+
+ fx.Provide(func(ev *env.Env, logger logging.Logger) (*nats.Client, error) {
+ return nats.NewClient(ev.NatsURL, nats.ClientOpts{
+ Name: "comms",
+ Logger: logger,
+ })
+ }),
+
+ fx.Provide(func(c *nats.Client) (*nats.JetstreamClient, error) {
+ return nats.NewJetstreamClient(c)
+ }),
+
fx.Provide(func(ev *env.Env) mail.Mailer {
return mail.NewSendgridMailer(ev.SendgridApiKey)
}),
@@ -26,6 +56,24 @@ var Module = fx.Module(
app.Module,
+ fx.Provide(func(logger logging.Logger, e *env.Env) httpServer.Server {
+ corsOrigins := "https://studio.apollographql.com"
+ return httpServer.NewServer(httpServer.ServerArgs{Logger: logger, CorsAllowOrigins: &corsOrigins, IsDev: e.IsDev})
+ }),
+
+ fx.Provide(
+ func(ev *env.Env, jc *nats.JetstreamClient) (kv.Repo[*common.AuthSession], error) {
+ cxt := context.TODO()
+ return kv.NewNatsKVRepo[*common.AuthSession](cxt, ev.SessionKVBucket, jc)
+ },
+ ),
+
+ fx.Provide(func(ev *env.Env) (app.IAMGrpcClient, error) {
+ return rpc.NewGrpcClient(ev.IAMGrpcAddr)
+ }),
+
+ mongoDb.NewMongoClientFx[*fm](),
+
fx.Invoke(func(lf fx.Lifecycle, server app.CommsGrpcServer, ev *env.Env, logger logging.Logger) {
lf.Append(fx.Hook{
OnStart: func(ctx context.Context) error {
diff --git a/apps/comms/main.go b/apps/comms/main.go
index c808af88a..b1d880522 100644
--- a/apps/comms/main.go
+++ b/apps/comms/main.go
@@ -7,7 +7,7 @@ import (
"os"
"time"
- "github.com/kloudlite/api/apps/comms/internal/app"
+ "github.com/kloudlite/api/apps/comms/internal/domain"
"github.com/kloudlite/api/apps/comms/internal/env"
"github.com/kloudlite/api/apps/comms/internal/framework"
"github.com/kloudlite/api/common"
@@ -38,8 +38,8 @@ func main() {
fx.Provide(func() (*env.Env, error) {
return env.LoadEnv()
}),
- fx.Provide(func() app.EmailTemplatesDir {
- return app.EmailTemplatesDir{
+ fx.Provide(func() domain.EmailTemplatesDir {
+ return domain.EmailTemplatesDir{
FS: EmailTemplatesDir,
}
}),
diff --git a/apps/comms/types/types.go b/apps/comms/types/types.go
new file mode 100644
index 000000000..4c608e487
--- /dev/null
+++ b/apps/comms/types/types.go
@@ -0,0 +1,61 @@
+package types
+
+import (
+ "fmt"
+
+ "github.com/kloudlite/api/pkg/egob"
+ "github.com/kloudlite/api/pkg/repos"
+)
+
+type NotificationType string
+
+const (
+ NotifyTypeAlert NotificationType = "alert"
+ NotifyTypeNotify NotificationType = "notification"
+)
+
+type NotifyContent struct {
+ Title string `json:"title" graphql:"noinput"`
+ Subject string `json:"subject" graphql:"noinput"`
+ Body string `json:"body" graphql:"noinput"`
+ Link string `json:"link" graphql:"noinput"`
+ Image string `json:"image" graphql:"noinput"`
+}
+
+type Notification struct {
+ repos.BaseEntity `json:",inline" graphql:"noinput"`
+ Type NotificationType `json:"notificationType" graphql:"noinput"`
+
+ Content NotifyContent `json:"content" graphql:"noinput"`
+ Priority int `json:"priority" graphql:"noinput"`
+ AccountName string `json:"accountName" graphql:"noinput"`
+ Read bool `json:"read" graphql:"noinput"`
+}
+
+func (obj *Notification) ToPlain() string {
+ return fmt.Sprintf(`%s
+
+%s
+
+%s
+
+Account: %s
+`, obj.Type, obj.Content.Title, obj.Content.Body, obj.AccountName)
+}
+
+func (obj *Notification) ToBytes() ([]byte, error) {
+ return egob.Marshal(obj)
+}
+
+func (obj *Notification) ParseBytes(data []byte) error {
+ return egob.Unmarshal(data, obj)
+}
+
+var NotificationIndexes = []repos.IndexField{
+ {
+ Field: []repos.IndexKey{
+ {Key: "id", Value: repos.IndexAsc},
+ },
+ Unique: true,
+ },
+}
diff --git a/apps/console/internal/app/app.go b/apps/console/internal/app/app.go
index faf59d2d3..88a94b0bb 100644
--- a/apps/console/internal/app/app.go
+++ b/apps/console/internal/app/app.go
@@ -182,6 +182,7 @@ var Module = fx.Module("app",
},
})
}),
+
fx.Invoke(func(lf fx.Lifecycle, consumer ResourceUpdateConsumer, d domain.Domain, logger logging.Logger) {
lf.Append(fx.Hook{
OnStart: func(context.Context) error {
diff --git a/apps/gateway/generate-schema.sh b/apps/gateway/generate-schema.sh
index f125eb675..230c1c402 100644
--- a/apps/gateway/generate-schema.sh
+++ b/apps/gateway/generate-schema.sh
@@ -10,6 +10,10 @@ cat ../accounts/internal/app/graph/struct-to-graphql/*.graphqls >>./schemas/acco
cat ../console/internal/app/graph/*.graphqls >./schemas/console-api.schema
cat ../console/internal/app/graph/struct-to-graphql/*.graphqls >>./schemas/console-api.schema
+cat ../comms/internal/app/graph/*.graphqls >./schemas/comms-api.schema
+cat ../comms/internal/app/graph/struct-to-graphql/*.graphqls >>./schemas/comms-api.schema
+
+
cat ../container-registry/internal/app/graph/*.graphqls >./schemas/container-registry-api.schema
cat ../container-registry/internal/app/graph/struct-to-graphql/*.graphqls >>./schemas/container-registry-api.schema
diff --git a/apps/gateway/supergraph.yml b/apps/gateway/supergraph.yml
index dc0469425..a3180ab5f 100644
--- a/apps/gateway/supergraph.yml
+++ b/apps/gateway/supergraph.yml
@@ -16,6 +16,10 @@ subgraphs:
routing_url: http://console-api:3000/query
schema:
file: ./schemas/console-api.schema
+ comms-api:
+ routing_url: http://comms-api:3000/query
+ schema:
+ file: ./schemas/comms-api.schema
infra-api:
routing_url: http://infra-api:3000/query
schema:
diff --git a/apps/iam/internal/domain/domain_test.go b/apps/iam/internal/domain/domain_test.go
index b6f41dadc..8c144c80f 100644
--- a/apps/iam/internal/domain/domain_test.go
+++ b/apps/iam/internal/domain/domain_test.go
@@ -1,182 +1,182 @@
package domain_test
-import (
- "context"
- "errors"
-
- "github.com/kloudlite/api/apps/iam/internal/domain"
- "github.com/kloudlite/api/apps/iam/internal/entities"
- t "github.com/kloudlite/api/apps/iam/types"
- "github.com/kloudlite/api/common"
- reposMock "github.com/kloudlite/api/mocks/pkg/repos"
- "github.com/kloudlite/api/pkg/repos"
- . "github.com/onsi/ginkgo/v2"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("domain.AddRoleBinding() says", func() {
- var rbRepo *reposMock.DbRepo[*entities.RoleBinding]
- // var roleBindingMap map[t.Action][]t.Role
-
- BeforeEach(func() {
- rbRepo = reposMock.NewDbRepo[*entities.RoleBinding]()
- })
-
- When("role binding already exists", func() {
- BeforeEach(func() {
- rbRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.RoleBinding, error) {
- return &entities.RoleBinding{}, nil
- }
- })
-
- It("should return error", func() {
- d := domain.NewDomain(rbRepo, nil)
- _, err := d.AddRoleBinding(context.Background(), entities.RoleBinding{
- UserId: "sample",
- ResourceType: "sample",
- ResourceRef: "sample",
- Role: "sample",
- })
- Expect(err).To(HaveOccurred())
- Expect(err.Error()).To(ContainSubstring("already exists"))
- })
- })
-
- When("role binding does not exist", func() {
- BeforeEach(func() {
- rbRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.RoleBinding, error) {
- return nil, nil
- }
- })
-
- It("creating an empty role binding should throw validation error", func() {
- d := domain.NewDomain(rbRepo, nil)
- _, err := d.AddRoleBinding(context.Background(), entities.RoleBinding{})
- Expect(err).To(HaveOccurred())
- Expect(errors.As(err, &common.ValidationError{})).To(BeTrue())
- })
-
- It("should create a new role binding", func() {
- rbRepo.MockCreate = func(ctx context.Context, data *entities.RoleBinding) (*entities.RoleBinding, error) {
- return data, nil
- }
- d := domain.NewDomain(rbRepo, nil)
- _, err := d.AddRoleBinding(context.Background(), entities.RoleBinding{
- UserId: "sample",
- ResourceType: "sample",
- ResourceRef: "sample",
- Role: "sample",
- })
- Expect(err).NotTo(HaveOccurred())
- })
- })
-})
-
-var _ = Describe("domain.Can() says", func() {
- var rbRepo *reposMock.DbRepo[*entities.RoleBinding]
-
- BeforeEach(func() {
- rbRepo = reposMock.NewDbRepo[*entities.RoleBinding]()
- })
-
- When("no action-role-binding map exists", func() {
- It("should fail with error", func() {
- d := domain.NewDomain(rbRepo, nil)
- _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample")
- Expect(err).To(HaveOccurred())
- Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue())
- })
- })
-
- Context("when action-role-binging map exists", func() {
- When("no role bindings exist in db", func() {
- It("should fail with error", func() {
- rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) {
- return nil, nil
- }
- d := domain.NewDomain(rbRepo, map[t.Action][]t.Role{"sample": {"sample"}})
- _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample")
- Expect(err).To(HaveOccurred())
- Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue())
- })
- })
-
- When("action is not permitted for the role", func() {
- It("1. if allowed roles is empty, should fail with error", func() {
- rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) {
- return []*entities.RoleBinding{
- {
- UserId: "sample",
- ResourceType: "sample-resource",
- ResourceRef: "sample",
- Role: "sample",
- },
- }, nil
- }
-
- actionRoleBindings := map[t.Action][]t.Role{
- "sample-action": {},
- }
-
- d := domain.NewDomain(rbRepo, actionRoleBindings)
- _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample-action")
- Expect(err).To(HaveOccurred())
- Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue())
- })
-
- It("2. if allowed roles does not contain current role, should fail with error", func() {
- rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) {
- return []*entities.RoleBinding{
- {
- UserId: "sample-userid",
- ResourceType: "sample-resource",
- ResourceRef: "sample-resourceRef",
- Role: "sample-role",
- },
- }, nil
- }
-
- actionRoleBindings := map[t.Action][]t.Role{
- "sample-action": {"example-role"},
- }
-
- d := domain.NewDomain(rbRepo, actionRoleBindings)
- _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample-action")
- Expect(err).To(HaveOccurred())
- Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue())
- })
- })
-
- When("action is permitted for the role", func() {
- It("should return true", func() {
- rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) {
- return []*entities.RoleBinding{
- {
- UserId: "sample-userid",
- ResourceType: "sample-resource",
- ResourceRef: "sample-resourceRef",
- Role: "sample-role",
- },
- }, nil
- }
-
- actionRoleBindings := map[t.Action][]t.Role{
- "sample-action": {"sample-role"},
- }
-
- d := domain.NewDomain(rbRepo, actionRoleBindings)
- _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample-action")
- Expect(err).NotTo(HaveOccurred())
- })
- })
- })
-
- Context("when system is internally accessing resources", func() {
- It("should allow", func() {
- d := domain.NewDomain(rbRepo, map[t.Action][]t.Role{"sample-action": {"sample"}})
- can, err := d.Can(context.Background(), "sys-user", []string{"sample"}, "sample-action")
- Expect(err).NotTo(HaveOccurred())
- Expect(can).To(BeTrue())
- })
- })
-})
+// import (
+// "context"
+// "errors"
+//
+// "github.com/kloudlite/api/apps/iam/internal/domain"
+// "github.com/kloudlite/api/apps/iam/internal/entities"
+// t "github.com/kloudlite/api/apps/iam/types"
+// "github.com/kloudlite/api/common"
+// reposMock "github.com/kloudlite/api/mocks/pkg/repos"
+// "github.com/kloudlite/api/pkg/repos"
+// . "github.com/onsi/ginkgo/v2"
+// . "github.com/onsi/gomega"
+// )
+//
+// var _ = Describe("domain.AddRoleBinding() says", func() {
+// var rbRepo *reposMock.DbRepo[*entities.RoleBinding]
+// // var roleBindingMap map[t.Action][]t.Role
+//
+// BeforeEach(func() {
+// rbRepo = reposMock.NewDbRepo[*entities.RoleBinding]()
+// })
+//
+// When("role binding already exists", func() {
+// BeforeEach(func() {
+// rbRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.RoleBinding, error) {
+// return &entities.RoleBinding{}, nil
+// }
+// })
+//
+// It("should return error", func() {
+// d := domain.NewDomain(rbRepo, nil)
+// _, err := d.AddRoleBinding(context.Background(), entities.RoleBinding{
+// UserId: "sample",
+// ResourceType: "sample",
+// ResourceRef: "sample",
+// Role: "sample",
+// })
+// Expect(err).To(HaveOccurred())
+// Expect(err.Error()).To(ContainSubstring("already exists"))
+// })
+// })
+//
+// When("role binding does not exist", func() {
+// BeforeEach(func() {
+// rbRepo.MockFindOne = func(ctx context.Context, filter repos.Filter) (*entities.RoleBinding, error) {
+// return nil, nil
+// }
+// })
+//
+// It("creating an empty role binding should throw validation error", func() {
+// d := domain.NewDomain(rbRepo, nil)
+// _, err := d.AddRoleBinding(context.Background(), entities.RoleBinding{})
+// Expect(err).To(HaveOccurred())
+// Expect(errors.As(err, &common.ValidationError{})).To(BeTrue())
+// })
+//
+// It("should create a new role binding", func() {
+// rbRepo.MockCreate = func(ctx context.Context, data *entities.RoleBinding) (*entities.RoleBinding, error) {
+// return data, nil
+// }
+// d := domain.NewDomain(rbRepo, nil)
+// _, err := d.AddRoleBinding(context.Background(), entities.RoleBinding{
+// UserId: "sample",
+// ResourceType: "sample",
+// ResourceRef: "sample",
+// Role: "sample",
+// })
+// Expect(err).NotTo(HaveOccurred())
+// })
+// })
+// })
+//
+// var _ = Describe("domain.Can() says", func() {
+// var rbRepo *reposMock.DbRepo[*entities.RoleBinding]
+//
+// BeforeEach(func() {
+// rbRepo = reposMock.NewDbRepo[*entities.RoleBinding]()
+// })
+//
+// When("no action-role-binding map exists", func() {
+// It("should fail with error", func() {
+// d := domain.NewDomain(rbRepo, nil)
+// _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample")
+// Expect(err).To(HaveOccurred())
+// Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue())
+// })
+// })
+//
+// Context("when action-role-binging map exists", func() {
+// When("no role bindings exist in db", func() {
+// It("should fail with error", func() {
+// rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) {
+// return nil, nil
+// }
+// d := domain.NewDomain(rbRepo, map[t.Action][]t.Role{"sample": {"sample"}})
+// _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample")
+// Expect(err).To(HaveOccurred())
+// Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue())
+// })
+// })
+//
+// When("action is not permitted for the role", func() {
+// It("1. if allowed roles is empty, should fail with error", func() {
+// rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) {
+// return []*entities.RoleBinding{
+// {
+// UserId: "sample",
+// ResourceType: "sample-resource",
+// ResourceRef: "sample",
+// Role: "sample",
+// },
+// }, nil
+// }
+//
+// actionRoleBindings := map[t.Action][]t.Role{
+// "sample-action": {},
+// }
+//
+// d := domain.NewDomain(rbRepo, actionRoleBindings)
+// _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample-action")
+// Expect(err).To(HaveOccurred())
+// Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue())
+// })
+//
+// It("2. if allowed roles does not contain current role, should fail with error", func() {
+// rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) {
+// return []*entities.RoleBinding{
+// {
+// UserId: "sample-userid",
+// ResourceType: "sample-resource",
+// ResourceRef: "sample-resourceRef",
+// Role: "sample-role",
+// },
+// }, nil
+// }
+//
+// actionRoleBindings := map[t.Action][]t.Role{
+// "sample-action": {"example-role"},
+// }
+//
+// d := domain.NewDomain(rbRepo, actionRoleBindings)
+// _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample-action")
+// Expect(err).To(HaveOccurred())
+// Expect(errors.As(err, &domain.UnAuthorizedError{})).To(BeTrue())
+// })
+// })
+//
+// When("action is permitted for the role", func() {
+// It("should return true", func() {
+// rbRepo.MockFind = func(ctx context.Context, query repos.Query) ([]*entities.RoleBinding, error) {
+// return []*entities.RoleBinding{
+// {
+// UserId: "sample-userid",
+// ResourceType: "sample-resource",
+// ResourceRef: "sample-resourceRef",
+// Role: "sample-role",
+// },
+// }, nil
+// }
+//
+// actionRoleBindings := map[t.Action][]t.Role{
+// "sample-action": {"sample-role"},
+// }
+//
+// d := domain.NewDomain(rbRepo, actionRoleBindings)
+// _, err := d.Can(context.Background(), "sample", []string{"sample"}, "sample-action")
+// Expect(err).NotTo(HaveOccurred())
+// })
+// })
+// })
+//
+// Context("when system is internally accessing resources", func() {
+// It("should allow", func() {
+// d := domain.NewDomain(rbRepo, map[t.Action][]t.Role{"sample-action": {"sample"}})
+// can, err := d.Can(context.Background(), "sys-user", []string{"sample"}, "sample-action")
+// Expect(err).NotTo(HaveOccurred())
+// Expect(can).To(BeTrue())
+// })
+// })
+// })
diff --git a/common/kafka-topic-name.go b/common/kafka-topic-name.go
index 8645bf5a5..ba46731a2 100644
--- a/common/kafka-topic-name.go
+++ b/common/kafka-topic-name.go
@@ -7,6 +7,7 @@ type topicName string
const (
GitWebhookTopicName topicName = "events.webhooks.git"
AuditEventLogTopicName topicName = "events.audit.event-log"
+ NotificationTopicName topicName = "events.notification"
)
func GetKafkaTopicName(accountName string, clusterName string) string {
diff --git a/go.mod b/go.mod
index b74e94603..0687e18c4 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/kloudlite/api
go 1.21.1
require (
- github.com/99designs/gqlgen v0.17.39
+ github.com/99designs/gqlgen v0.17.45
github.com/Masterminds/sprig/v3 v3.2.3
github.com/aws/aws-sdk-go v1.50.10
github.com/bradleyfalzon/ghinstallation/v2 v2.0.4
@@ -148,10 +148,10 @@ require (
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
go.uber.org/dig v1.14.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/crypto v0.21.0 // indirect
- golang.org/x/mod v0.16.0 // indirect
- golang.org/x/sys v0.18.0 // indirect
- golang.org/x/term v0.18.0 // indirect
+ golang.org/x/crypto v0.22.0 // indirect
+ golang.org/x/mod v0.17.0 // indirect
+ golang.org/x/sys v0.19.0 // indirect
+ golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.19.0
diff --git a/go.sum b/go.sum
index 70b8d4ebf..3aa15fa46 100644
--- a/go.sum
+++ b/go.sum
@@ -2,14 +2,16 @@ cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiV
cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
-github.com/99designs/gqlgen v0.17.39 h1:wPTAyc2fqVjAWT5DsJ21k/lLudgnXzURwbsjVNegFpU=
-github.com/99designs/gqlgen v0.17.39/go.mod h1:b62q1USk82GYIVjC60h02YguAZLqYZtvWml8KkhJps4=
+github.com/99designs/gqlgen v0.17.45 h1:bH0AH67vIJo8JKNKPJP+pOPpQhZeuVRQLf53dKIpDik=
+github.com/99designs/gqlgen v0.17.45/go.mod h1:Bas0XQ+Jiu/Xm5E33jC8sES3G+iC2esHBMXcq0fUPs0=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g=
github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA=
github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM=
+github.com/PuerkitoBio/goquery v1.9.1 h1:mTL6XjbJTZdpfL+Gwl5U2h1l9yEkJjhmlTeV9VPW7UI=
+github.com/PuerkitoBio/goquery v1.9.1/go.mod h1:cW1n6TmIMDoORQU5IU/P1T3tGFunOeXEpGP2WHRwkbY=
github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8=
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
@@ -17,6 +19,8 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
+github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
+github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
github.com/aws/aws-sdk-go v1.50.10 h1:H3NQvqRUKG+9oysCKTIyylpkqfPA7MiBtzTnu/cIGqE=
@@ -161,8 +165,6 @@ github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLA
github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55 h1:YnZh3TL6AG4EfoInx1/L5zcPHd2QxgLKseJB1KtHjdQ=
github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55/go.mod h1:GZj3wZmIw/qCciclRhgQTgmGiqe8wxoVzMXQjbOfnbc=
-github.com/kloudlite/operator v1.0.4-0.20240524130112-c32c133c28cc h1:/A6XGjylgXUyCPq0Yl7PlxOT62YOK46Lu7PHiRUwMqc=
-github.com/kloudlite/operator v1.0.4-0.20240524130112-c32c133c28cc/go.mod h1:sz3ByFoE3ngJC+ai+BZLP5GAfoeLmgkyBLMEcWv7WcI=
github.com/kloudlite/operator v1.0.4-0.20240527133630-1d49143c0ba2 h1:RimxlSiX2vlXbeTQc12ACQCvGE1Ez2wXUbSZqltC8q0=
github.com/kloudlite/operator v1.0.4-0.20240527133630-1d49143c0ba2/go.mod h1:sz3ByFoE3ngJC+ai+BZLP5GAfoeLmgkyBLMEcWv7WcI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
@@ -348,15 +350,15 @@ golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
-golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
-golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
+golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
+golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
-golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=
-golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
+golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -399,13 +401,13 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
-golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
+golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
-golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
-golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
+golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q=
+golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
diff --git a/pkg/egob/main.go b/pkg/egob/main.go
new file mode 100644
index 000000000..e9be6b37e
--- /dev/null
+++ b/pkg/egob/main.go
@@ -0,0 +1,24 @@
+package egob
+
+import (
+ "bytes"
+ "encoding/gob"
+)
+
+func Marshal(obj any) ([]byte, error) {
+ var buf bytes.Buffer
+ enc := gob.NewEncoder(&buf)
+ if err := enc.Encode(obj); err != nil {
+ return nil, err
+ }
+ return buf.Bytes(), nil
+}
+
+func Unmarshal(data []byte, obj any) error {
+ buf := bytes.NewBuffer(data)
+ dec := gob.NewDecoder(buf)
+ if err := dec.Decode(obj); err != nil {
+ return err
+ }
+ return nil
+}
diff --git a/pkg/http-server/http-server.go b/pkg/http-server/http-server.go
index 0c3d9d112..a6b0399ad 100644
--- a/pkg/http-server/http-server.go
+++ b/pkg/http-server/http-server.go
@@ -66,6 +66,7 @@ type ServerArgs struct {
IsDev bool
Logger logging.Logger
CorsAllowOrigins *string
+ IAMGrpcAddr string `env:"IAM_GRPC_ADDR" required:"true"`
}
func NewServer(args ServerArgs) Server {