Skip to content

Commit

Permalink
Merge pull request #4 from theplant/genx
Browse files Browse the repository at this point in the history
pageInfo omitempty at Connection
  • Loading branch information
molon authored Nov 15, 2024
2 parents 7f27935 + d3e9e71 commit c0ceb83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paginaition.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type PageInfo struct {
type Connection[T any] struct {
Edges []*Edge[T] `json:"edges,omitempty"`
Nodes []T `json:"nodes,omitempty"`
PageInfo *PageInfo `json:"pageInfo"`
PageInfo *PageInfo `json:"pageInfo,omitempty"`
TotalCount *int `json:"totalCount,omitempty"`
}

Expand Down Expand Up @@ -87,7 +87,7 @@ func paginate[T any](ctx context.Context, req *PaginateRequest[T], applyCursorsF
dups := lo.FindDuplicatesBy(orderBys, func(item OrderBy) string {
return item.Field
})
if (len(dups)) > 0 {
if len(dups) > 0 {
return nil, errors.Errorf("duplicated order by fields %v", lo.Map(dups, func(item OrderBy, _ int) string {
return item.Field
}))
Expand Down

0 comments on commit c0ceb83

Please sign in to comment.