Skip to content

Commit

Permalink
Added reproduce test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathew Byrne committed Oct 1, 2018
1 parent 14cf46b commit f302b40
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
104 changes: 104 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 @@ -31,3 +31,5 @@ models:
field: { resolver: true }
Error:
model: "github.com/99designs/gqlgen/codegen/testserver.Error"
EmbeddedPointer:
model: "github.com/99designs/gqlgen/codegen/testserver.EmbeddedPointerModel"
9 changes: 9 additions & 0 deletions codegen/testserver/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ func (Error) ErrorOnNonRequiredField() (string, error) {
func (Error) NilOnRequiredField() *string {
return nil
}

type EmbeddedPointerModel struct {
*EmbeddedPointer
ID string
}

type EmbeddedPointer struct {
Title string
}
9 changes: 9 additions & 0 deletions codegen/testserver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (

type Resolver struct{}

func (r *Resolver) EmbeddedPointer() EmbeddedPointerResolver {
return &embeddedPointerResolver{r}
}
func (r *Resolver) ForcedResolver() ForcedResolverResolver {
return &forcedResolverResolver{r}
}
Expand All @@ -21,6 +24,12 @@ func (r *Resolver) Subscription() SubscriptionResolver {
return &subscriptionResolver{r}
}

type embeddedPointerResolver struct{ *Resolver }

func (r *embeddedPointerResolver) Title(ctx context.Context, obj *EmbeddedPointerModel) (*string, error) {
panic("not implemented")
}

type forcedResolverResolver struct{ *Resolver }

func (r *forcedResolverResolver) Field(ctx context.Context, obj *ForcedResolver) (*Circle, error) {
Expand Down
5 changes: 5 additions & 0 deletions codegen/testserver/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,8 @@ union ShapeUnion = Circle | Rectangle
type ForcedResolver {
field: Circle
}

type EmbeddedPointer {
ID: String
Title: String
}

0 comments on commit f302b40

Please sign in to comment.