2020-07-05 01:02:57 +02:00
|
|
|
//go:generate sh ../scripts/genSchema.sh
|
2020-04-10 04:40:22 +02:00
|
|
|
//go:generate go run github.com/99designs/gqlgen
|
2020-08-21 01:11:24 +02:00
|
|
|
|
2020-04-10 04:40:22 +02:00
|
|
|
package graph
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
|
2021-10-27 05:10:29 +02:00
|
|
|
"github.com/jordanknott/taskcafe/internal/config"
|
2020-08-07 03:50:35 +02:00
|
|
|
"github.com/jordanknott/taskcafe/internal/db"
|
2020-04-10 04:40:22 +02:00
|
|
|
)
|
|
|
|
|
2021-11-02 20:45:05 +01:00
|
|
|
type NotificationObservers struct {
|
|
|
|
Subscribers map[string]map[string]chan *Notified
|
|
|
|
Mu sync.Mutex
|
|
|
|
}
|
|
|
|
|
2020-08-21 01:11:24 +02:00
|
|
|
// Resolver handles resolving GraphQL queries & mutations
|
2020-04-10 04:40:22 +02:00
|
|
|
type Resolver struct {
|
2021-11-02 20:45:05 +01:00
|
|
|
Repository db.Repository
|
|
|
|
AppConfig config.AppConfig
|
|
|
|
Notifications NotificationObservers
|
2020-04-10 04:40:22 +02:00
|
|
|
}
|