Update gqlgen and fix the code. (#1055)

This commit is contained in:
Googol Lee
2024-09-17 17:00:03 +02:00
committed by GitHub
parent 340c181442
commit a1263feac4
3 changed files with 25 additions and 22 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/photoview/photoview/api/graphql/resolvers"
"github.com/photoview/photoview/api/server"
"github.com/photoview/photoview/api/utils"
"github.com/vektah/gqlparser/v2/ast"
"gorm.io/gorm"
)
@@ -35,10 +36,10 @@ func GraphqlEndpoint(db *gorm.DB) *graphql_handler.Server {
graphqlServer.AddTransport(transport.POST{})
graphqlServer.AddTransport(transport.MultipartForm{})
graphqlServer.SetQueryCache(lru.New(1000))
graphqlServer.SetQueryCache(lru.New[*ast.QueryDocument](1000))
graphqlServer.Use(extension.AutomaticPersistedQuery{
Cache: lru.New(100),
Cache: lru.New[string](100),
})
if utils.DevelopmentMode() {