Skip to content

Commit

Permalink
Test mapping object types onto go string
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMure authored and vektah committed May 15, 2019
1 parent cab4bab commit b0cd95a
Show file tree
Hide file tree
Showing 7 changed files with 359 additions and 0 deletions.
273 changes: 273 additions & 0 deletions codegen/testserver/generated.go

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

2 changes: 2 additions & 0 deletions codegen/testserver/gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ models:
model: "github.com/99designs/gqlgen/codegen/testserver.Autobind"
Primitive:
model: "github.com/99designs/gqlgen/codegen/testserver.Primitive"
PrimitiveString:
model: "github.com/99designs/gqlgen/codegen/testserver.PrimitiveString"
MapStringInterfaceInput:
model: "map[string]interface{}"
MapStringInterfaceType:
Expand Down
6 changes: 6 additions & 0 deletions codegen/testserver/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@ type Primitive int
func (p Primitive) Squared() int {
return int(p) * int(p)
}

type PrimitiveString string

func (s PrimitiveString) Doubled() string {
return string(s) + string(s)
}
Loading

0 comments on commit b0cd95a

Please sign in to comment.