Skip to content

Commit 276a132

Browse files
committed
Add setting a name to the paginated queries
1 parent c373520 commit 276a132

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

internal/result.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func buildStructs(req *plugin.GenerateRequest, options *opts.Options) []Struct {
8282
Name: StructName(structName, options),
8383
Comment: table.Comment,
8484
}
85+
s.ModelPath = options.Package + "." + s.Name
8586
for _, column := range table.Columns {
8687
s.Fields = append(
8788
s.Fields, Field{
@@ -541,7 +542,8 @@ func addPageStruct(original Struct, structs []Struct) []Struct {
541542
}
542543
}
543544
pageStruct := Struct{
544-
Name: pageName,
545+
Name: pageName,
546+
ModelPath: original.ModelPath + "Page",
545547
Fields: []Field{
546548
{
547549
Name: "Items",
@@ -581,7 +583,8 @@ func addConnectionStruct(original Struct, structs []Struct) []Struct {
581583
}
582584

583585
edgeStruct := Struct{
584-
Name: edgeName,
586+
Name: edgeName,
587+
ModelPath: original.ModelPath + "Edge",
585588
Fields: []Field{
586589
{
587590
Name: "Node",
@@ -607,7 +610,8 @@ func addConnectionStruct(original Struct, structs []Struct) []Struct {
607610
}
608611

609612
connectionStruct := Struct{
610-
Name: connectionName,
613+
Name: connectionName,
614+
ModelPath: original.ModelPath + "Connection",
611615
Fields: []Field{
612616
{
613617
Name: "Edges",

0 commit comments

Comments
 (0)