Files
photoview/api/graphql/resolvers/resolver.go
Googol Lee 06acd165f2 Bump golang from 1.23-bookworm to 1.24-bookworm, as well as gqlgen. (#1172)
* Bump golang from 1.23-bookworm to 1.24-bookworm

Bumps golang from 1.23-bookworm to 1.24-bookworm.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update to use `go tool`, see https://go.dev/doc/go1.24#go-command.

* Update go.mod to go 1.24

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 18:45:30 +01:00

25 lines
400 B
Go

package resolvers
import (
"context"
"gorm.io/gorm"
)
//go:generate go tool github.com/99designs/gqlgen
type Resolver struct {
database *gorm.DB
}
func NewRootResolver(db *gorm.DB) Resolver {
return Resolver{
database: db,
}
}
// DB returns a database instance that is tied to the given context
func (r *Resolver) DB(ctx context.Context) *gorm.DB {
return r.database.WithContext(ctx)
}