Skip to content

Commit

Permalink
feat: Adds subscriptions for review creation and acceptance
Browse files Browse the repository at this point in the history
  • Loading branch information
StealWonders committed Aug 6, 2023
1 parent 5772568 commit 14f3087
Show file tree
Hide file tree
Showing 6 changed files with 336 additions and 11 deletions.
228 changes: 228 additions & 0 deletions internal/graphql/gqlserver/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions internal/graphql/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ func graphqlHandler(params *GraphQLParams) gin.HandlerFunc {
gqlserver.NewExecutableSchema(
gqlserver.Config{
Resolvers: &resolvers.Resolver{
Database: params.Database,
JWTKeyStore: params.JWTKeyStore,
VCSBuildInfo: vscBuildInfo,
ImageUploader: params.ImageUploader,
ImageBaseURL: params.ImageBaseURL,
Database: params.Database,
JWTKeyStore: params.JWTKeyStore,
VCSBuildInfo: vscBuildInfo,
ImageUploader: params.ImageUploader,
ImageBaseURL: params.ImageBaseURL,
ReviewAcceptedChannels: map[string]chan *ent.Review{},
ReviewCreatedChannels: map[string]chan *ent.Review{},
},
Directives: gqlserver.DirectiveRoot{
Authenticated: directives.Authenticated,
Expand Down
25 changes: 24 additions & 1 deletion internal/graphql/resolvers/mutations.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions internal/graphql/resolvers/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ import (
ent "github.com/mensatt/backend/internal/database/ent"
"github.com/mensatt/backend/pkg/imageuploader"
"github.com/mensatt/backend/pkg/utils"
"sync"
)

// This file will not be regenerated automatically.
//
// It serves as dependency injection for your app, add any dependencies you require here.

type Resolver struct {
Database *ent.Client
JWTKeyStore *utils.JWTKeyStore
VCSBuildInfo *utils.VCSBuildInfo
ImageUploader *imageuploader.ImageUploader
ImageBaseURL string
Database *ent.Client
JWTKeyStore *utils.JWTKeyStore
VCSBuildInfo *utils.VCSBuildInfo
ImageUploader *imageuploader.ImageUploader
ImageBaseURL string
ReviewCreatedChannels map[string]chan *ent.Review
ReviewAcceptedChannels map[string]chan *ent.Review
mutex sync.Mutex
}
Loading

0 comments on commit 14f3087

Please sign in to comment.