diff --git a/cmd/main.go b/cmd/main.go index ea4659b..f15bb17 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -50,7 +50,7 @@ func run(ctx context.Context, log *slog.Logger) error { log.Info("Starting proxy", "target", cfg.Target.Host) - pxy, err := proxy.NewProxy(cfg.Target) + pxy, err := proxy.NewProxy(cfg.Target, cfg.FieldSuggestions) if err != nil { log.Error("ErrorPayload creating proxy", "err", err) return nil diff --git a/internal/app/config/config.go b/internal/app/config/config.go index be5e0c5..614e15f 100644 --- a/internal/app/config/config.go +++ b/internal/app/config/config.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/ardanlabs/conf/v3" "github.com/ardanlabs/conf/v3/yaml" + "github.com/ldebruijn/go-graphql-armor/internal/business/field_suggestions" "github.com/ldebruijn/go-graphql-armor/internal/business/persisted_operations" "github.com/ldebruijn/go-graphql-armor/internal/business/proxy" "os" @@ -24,6 +25,7 @@ type Config struct { } Target proxy.Config `yaml:"target"` PersistedOperations persisted_operations.Config ` yaml:"persisted_operations"` + FieldSuggestions field_suggestions.Config `yaml:"field_suggestions"` } func NewConfig() (*Config, error) { diff --git a/makefile b/makefile index a9a8bb6..a166b71 100644 --- a/makefile +++ b/makefile @@ -13,6 +13,10 @@ dev.setup: build: go build -ldflags "$(LDFLAGS)" ./cmd/main.go +.PHONY: test +test: + go test -v ./... + .PHONY: run_container build_container: docker build github.com/ldebruijn/go-graphql-armor -t go-graphql-armor .