Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
I didn't rename Reference yet, since I want to think about that a little
more.
  • Loading branch information
benjaminjkraft committed Aug 23, 2021
1 parent 5c3f806 commit c58bb03
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions generate/traverse.go → generate/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package generate

// This file implements the core type-generation logic of genqlient, whereby we
// traverse an operation-definition (and the schema against which it will be
// executed), and decide what Go types to generate for that operation. It
// returns data structures representing the types to be generated; these are
// defined, and converted into code, in types.go.
// executed), and convert that into Go types. It returns data structures
// representing the types to be generated; these are defined, and converted
// into code, in types.go.
//
// The entrypoints are convertOperation, which builds the response-type for a
// query, and convertInputType, which builds the argument-types.
Expand Down Expand Up @@ -84,7 +84,6 @@ var builtinTypes = map[string]string{
func (g *generator) typeName(prefix string, typ *ast.Definition) (name, nextPrefix string) {
typeGoName := upperFirst(typ.Name)
if typ.Kind == ast.Enum || typ.Kind == ast.InputObject {
// STOPSHIP: hopefully inline this
// If we're an enum or an input-object, there is only one type we
// will ever possibly generate for this type, so we don't need any
// of the qualifiers. This is especially helpful because the
Expand Down
2 changes: 1 addition & 1 deletion generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func Generate(config *Config) (map[string][]byte, error) {

// Step 2: For each operation, convert it into data structures representing
// Go types (defined in types.go). The bulk of this logic is in
// traverse.go.
// convert.go.
g := newGenerator(config, schema)
for _, op := range document.Operations {
if err = g.addOperation(op); err != nil {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion generate/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package generate

// This file defines the data structures from which genqlient generates types,
// and the code to write them out as actual Go code. The main entrypoint is
// goType, which represents such a type, but traverse.go also constructs each
// goType, which represents such a type, but convert.go also constructs each
// of the implementing types, by traversing the GraphQL operation and schema.

import (
Expand Down

0 comments on commit c58bb03

Please sign in to comment.