-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1172128
commit 4212cd5
Showing
5 changed files
with
2,632 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
schema: | ||
- "*.graphql" | ||
|
||
exec: | ||
filename: server.go | ||
package: embedded | ||
|
||
autobind: | ||
- "github.com/99designs/gqlgen/codegen/testserver/embedded" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package embedded | ||
|
||
import "context" | ||
|
||
//go:generate rm -f server-gen.go | ||
//go:generate go run ../../../testdata/gqlgen.go | ||
|
||
// ServerResolver model | ||
type ServerResolver struct{} | ||
|
||
// Query method | ||
func (*ServerResolver) Query() QueryResolver { | ||
return &queryResolver{} | ||
} | ||
|
||
type queryResolver struct{} | ||
|
||
// Hello query | ||
func (*queryResolver) Hello(ctx context.Context) (string, error) { | ||
return "", nil | ||
} | ||
|
||
// Case1 model | ||
type Case1 struct { | ||
Empty | ||
*ExportedEmbeddedPointerAfterInterface | ||
} | ||
|
||
// Empty interface | ||
type Empty interface{} | ||
|
||
// ExportedEmbeddedPointerAfterInterface model | ||
type ExportedEmbeddedPointerAfterInterface struct{} | ||
|
||
// ExportedEmbeddedPointerExportedMethod method | ||
func (*ExportedEmbeddedPointerAfterInterface) ExportedEmbeddedPointerExportedMethod() string { | ||
return "ExportedEmbeddedPointerExportedMethodResponse" | ||
} | ||
|
||
// Case2 model | ||
type Case2 struct { | ||
*unexportedEmbeddedPointer | ||
} | ||
|
||
type unexportedEmbeddedPointer struct{} | ||
|
||
// UnexportedEmbeddedPointerExportedMethod method | ||
func (*unexportedEmbeddedPointer) UnexportedEmbeddedPointerExportedMethod() string { | ||
return "UnexportedEmbeddedPointerExportedMethodResponse" | ||
} | ||
|
||
// Case3 model | ||
type Case3 interface { | ||
ExplicitInterfaceMethod() string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
directive @goModel(model: String, models: [String!]) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION | ||
|
||
type Query { | ||
hello: String! | ||
} | ||
|
||
type Case1 @goModel(model:"embedded.Case1") { | ||
exportedEmbeddedPointerExportedMethod: String! | ||
} | ||
|
||
type Case2 @goModel(model:"embedded.Case2") { | ||
unexportedEmbeddedPointerExportedMethod: String! | ||
} | ||
|
||
type Case3 @goModel(model:"embedded.Case3") { | ||
explicitInterfaceMethod: String! | ||
} |
Oops, something went wrong.