Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
vektah committed Jun 18, 2019
1 parent 1e54468 commit eb025d3
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 0 deletions.
204 changes: 204 additions & 0 deletions codegen/testserver/generated.go

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

4 changes: 4 additions & 0 deletions codegen/testserver/gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@ models:
model: "github.com/99designs/gqlgen/codegen/testserver.FallbackToStringEncoding"
Bytes:
model: "github.com/99designs/gqlgen/codegen/testserver.Bytes"
WrappedStruct:
model: "github.com/99designs/gqlgen/codegen/testserver.WrappedStruct"
WrappedScalar:
model: "github.com/99designs/gqlgen/codegen/testserver.WrappedScalar"
7 changes: 7 additions & 0 deletions codegen/testserver/otherpkg/model.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package otherpkg

type Scalar string

type Struct struct {
Name string
}
6 changes: 6 additions & 0 deletions codegen/testserver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ func (r *queryResolver) OptionalUnion(ctx context.Context) (TestUnion, error) {
func (r *queryResolver) ValidType(ctx context.Context) (*ValidType, error) {
panic("not implemented")
}
func (r *queryResolver) WrappedStruct(ctx context.Context) (*WrappedStruct, error) {
panic("not implemented")
}
func (r *queryResolver) WrappedScalar(ctx context.Context) (WrappedScalar, error) {
panic("not implemented")
}

type subscriptionResolver struct{ *Resolver }

Expand Down
8 changes: 8 additions & 0 deletions codegen/testserver/stub.go

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

6 changes: 6 additions & 0 deletions codegen/testserver/wrapped_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package testserver

import "github.com/99designs/gqlgen/codegen/testserver/otherpkg"

type WrappedScalar otherpkg.Scalar
type WrappedStruct otherpkg.Struct
9 changes: 9 additions & 0 deletions codegen/testserver/wrapped_type.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# regression test for https://github.com/99designs/gqlgen/issues/721

extend type Query {
wrappedStruct: WrappedStruct!
wrappedScalar: WrappedScalar!
}

type WrappedStruct { name: String! }
scalar WrappedScalar
Loading

0 comments on commit eb025d3

Please sign in to comment.