Skip to content

Commit

Permalink
Merge pull request 99designs#1100 from sonatard/fast
Browse files Browse the repository at this point in the history
Gnerate to fast by exec codegen.GenerateCode before plugin GenerateCode
  • Loading branch information
vektah authored Mar 12, 2020
2 parents 019e74a + 25a7113 commit 7698970
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func Generate(cfg *config.Config, option ...Option) error {
return errors.Wrap(err, "merging type systems failed")
}

if err = codegen.GenerateCode(data); err != nil {
return errors.Wrap(err, "generating core failed")
}

for _, p := range plugins {
if mut, ok := p.(plugin.CodeGenerator); ok {
err := mut.GenerateCode(data)
Expand All @@ -83,10 +87,6 @@ func Generate(cfg *config.Config, option ...Option) error {
}
}

if err = codegen.GenerateCode(data); err != nil {
return errors.Wrap(err, "generating core failed")
}

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

0 comments on commit 7698970

Please sign in to comment.