Skip to content

Commit

Permalink
Test Fix parent column break pagination ent#562
Browse files Browse the repository at this point in the history
  • Loading branch information
W0lfer01 committed Nov 19, 2024
1 parent ed6bb39 commit 16c25bb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
38 changes: 21 additions & 17 deletions entgql/pagination.go

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

4 changes: 2 additions & 2 deletions entgql/template/pagination.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,15 @@ func ({{ $r }} *{{ $query }}) Paginate(
column: {{ $node.Package }}.{{ $f.Field.Constant }},
toTerm: {{ $node.Package }}.{{ $f.Field.OrderName }},
{{- else if $f.IsEdgeFieldTerm }}
column: {{ $f.VarField }},
column: fmt.Sprintf("\"t1\".\"%s\"", {{ $f.VarField }}),
toTerm: func(opts ...sql.OrderTermOption) {{ $node.Package }}.OrderOption {
return {{ $node.Package}}.{{ $f.Edge.OrderFieldName }}(
{{ $f.Type.Package }}.{{ $f.Field.Constant }},
append(opts, sql.OrderSelectAs({{ $f.VarField }}))...,
)
},
{{- else if $f.IsEdgeCountTerm }}
column: {{ $f.VarField }},
column: fmt.Sprintf("\"t1\".\"%s\"", {{ $f.VarField }}),
toTerm: func(opts ...sql.OrderTermOption) {{ $node.Package }}.OrderOption {
return {{ $node.Package}}.{{ $f.Edge.OrderCountName }}(
append(opts, sql.OrderSelectAs({{ $f.VarField }}))...,
Expand Down

0 comments on commit 16c25bb

Please sign in to comment.