resolver.go 462 B

12345678910111213141516171819202122232425
  1. package graphql
  2. import (
  3. "context"
  4. "gshopper.com/gshopify/admin-product/db"
  5. )
  6. // This file will not be regenerated automatically.
  7. //
  8. // It serves as dependency injection for your app, add any dependencies you require here.
  9. type Resolver struct {
  10. db db.Database
  11. }
  12. func New(ctx context.Context, debug bool) (*Resolver, error) {
  13. r := Resolver{}
  14. var err error
  15. if r.db, err = db.Clickhouse(ctx, debug); err != nil {
  16. return nil, err
  17. }
  18. return &r, nil
  19. }