Skip to content

Commit

Permalink
v3.0.1 important bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardLindhout committed Dec 3, 2020
1 parent 7ccec69 commit 049ffb3
Showing 1 changed file with 2 additions and 39 deletions.
41 changes: 2 additions & 39 deletions resolver.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,50 +101,13 @@ const inputKey = "input"
{{- end }}
{{ end }}


// TODO: use these if no connection is used
// return {{ .Model.PluralName }}ToGraphQL(a), nil




mods = append(mods, {{.Model.Name}}FilterToMods(filter)...)

{{/*if after != "" {*/}}
{{/* parsedCursor := strings.Split(after, "-")*/}}
{{/* mods = append(mods, dm.LikeWhere.ID.GTE(parsedCursor[0]))*/}}
{{/*}*/}}

{{/*if first > 0 {*/}}
{{/* mods = append(mods, qm.Limit(first+1))*/}}
{{/*}*/}}

a, err := dm.{{ .Model.PluralName }}(mods...).All(ctx, r.db)
connection, err := {{.Model.Name}}Connection(ctx, r.db, mods, pagination, ordering)
if err != nil {
log.Error().Err(err).Msg({{ $resolver.PublicErrorKey }})
return nil, errors.New({{ $resolver.PublicErrorKey }})
}

edges := make([]*fm.{{.Model.Name}}Edge, len(a))
for i, row := range a {
edges[i] = &fm.{{.Model.Name}}Edge{
Cursor: "",
Node: {{.Model.Name}}ToGraphQL(row),
}
}

return &fm.{{.Model.Name}}Connection{
Edges: edges,
PageInfo: &fm.PageInfo{
HasNextPage: false,
HasPreviousPage: false,
StartCursor: nil,
EndCursor: nil,
},
}, nil



return connection, nil
{{- end -}}

{{- if .IsCreate }}
Expand Down

0 comments on commit 049ffb3

Please sign in to comment.