Skip to content

Commit

Permalink
Generate GraphQL types for empty proto messages (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
alehechka authored Jul 27, 2022
1 parent ee09942 commit 500bd85
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 0 additions & 4 deletions protoc-gen-graphql/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ func (g *Generator) generateFile(file *spec.File, tmpl string, services []*spec.
var packages []*spec.Package

for _, m := range g.messages {
// skip empty field message, otherwise graphql-go raise error
if len(m.Fields()) == 0 {
continue
}
if m.IsDepended(spec.DependTypeMessage, file.Package()) {
switch {
case file.Package() == m.Package():
Expand Down
16 changes: 14 additions & 2 deletions protoc-gen-graphql/template.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 500bd85

Please sign in to comment.