Skip to content

Commit

Permalink
add skip_validation flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vikstrous committed Nov 26, 2019
1 parent d3f6384 commit bd353b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ func Generate(cfg *config.Config, option ...Option) error {
}
}

if err := validate(cfg); err != nil {
return errors.Wrap(err, "validation failed")
if !cfg.SkipValidation {
if err := validate(cfg); err != nil {
return errors.Wrap(err, "validation failed")
}
}

return nil
Expand Down
1 change: 1 addition & 0 deletions codegen/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type Config struct {
StructTag string `yaml:"struct_tag,omitempty"`
Directives map[string]DirectiveConfig `yaml:"directives,omitempty"`
OmitSliceElementPointers bool `yaml:"omit_slice_element_pointers,omitempty"`
SkipValidation bool `yaml:"skip_validation,omitempty"`
}

var cfgFilenames = []string{".gqlgen.yml", "gqlgen.yml", "gqlgen.yaml"}
Expand Down

0 comments on commit bd353b3

Please sign in to comment.