Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds subscriptions for review creation and acceptance #160

Merged
merged 1 commit into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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