mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 19:39:19 +00:00
Add dataloaders to combine database queries (#190)
See also https://gqlgen.com/reference/dataloaders/
This commit is contained in:
committed by
GitHub
parent
54a83a4dc6
commit
ce3090394b
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/photoview/photoview/api/database"
|
||||
"github.com/photoview/photoview/api/graphql/auth"
|
||||
"github.com/photoview/photoview/api/graphql/dataloader"
|
||||
"github.com/photoview/photoview/api/routes"
|
||||
"github.com/photoview/photoview/api/scanner"
|
||||
"github.com/photoview/photoview/api/server"
|
||||
@@ -52,6 +53,7 @@ func main() {
|
||||
|
||||
rootRouter := mux.NewRouter()
|
||||
|
||||
rootRouter.Use(dataloader.Middleware(db))
|
||||
rootRouter.Use(auth.Middleware(db))
|
||||
rootRouter.Use(server.LoggingMiddleware)
|
||||
rootRouter.Use(server.CORSMiddleware(devMode))
|
||||
|
||||
Reference in New Issue
Block a user