Skip to content

Commit

Permalink
feat(tests): Add make command for tests, fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
ldebruijn committed Sep 24, 2023
1 parent cb2c936 commit d83edcf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions internal/app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down

0 comments on commit d83edcf

Please sign in to comment.