mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 18:29:17 +00:00
Fix gqlgen (#1105)
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
package resolvers
|
||||
|
||||
// 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.55
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
api "github.com/photoview/photoview/api/graphql"
|
||||
"github.com/photoview/photoview/api/graphql/auth"
|
||||
"github.com/photoview/photoview/api/graphql/models"
|
||||
"github.com/photoview/photoview/api/graphql/notification"
|
||||
)
|
||||
|
||||
// Notification is the resolver for the notification field.
|
||||
func (r *subscriptionResolver) Notification(ctx context.Context) (<-chan *models.Notification, error) {
|
||||
|
||||
user := auth.UserFromContext(ctx)
|
||||
if user == nil {
|
||||
return nil, auth.ErrUnauthorized
|
||||
@@ -26,3 +31,8 @@ func (r *subscriptionResolver) Notification(ctx context.Context) (<-chan *models
|
||||
|
||||
return notificationChannel, nil
|
||||
}
|
||||
|
||||
// Subscription returns api.SubscriptionResolver implementation.
|
||||
func (r *Resolver) Subscription() api.SubscriptionResolver { return &subscriptionResolver{r} }
|
||||
|
||||
type subscriptionResolver struct{ *Resolver }
|
||||
|
||||
Reference in New Issue
Block a user