Skip to content

Commit

Permalink
fix: Migrate to lru v2 (uses generics)
Browse files Browse the repository at this point in the history
  • Loading branch information
carstendietrich committed Sep 18, 2024
1 parent d8b9876 commit 4cad452
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions module.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/99designs/gqlgen/graphql/handler/transport"
"github.com/99designs/gqlgen/graphql/playground"
"github.com/spf13/cobra"
"github.com/vektah/gqlparser/v2/ast"
)

// Service defines the interface for graphql services
Expand Down Expand Up @@ -114,10 +115,10 @@ func (r *routes) Routes(registry *web.RouterRegistry) {
srv.AddTransport(transport.MultipartForm{
MaxUploadSize: r.uploadMaxSize,
})
srv.SetQueryCache(lru.New(1000))
srv.SetQueryCache(lru.New[*ast.QueryDocument](1000))

srv.Use(extension.AutomaticPersistedQuery{
Cache: lru.New(100),
Cache: lru.New[string](100),
})

if r.introspectionEnabled {
Expand Down

0 comments on commit 4cad452

Please sign in to comment.