Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion entx/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func WithFederation() ExtensionOption {
// WithConnectionNodes adds the templates for adding nodes to relay connections
func WithConnectionNodes() ExtensionOption {
return func(ex *Extension) error {
ex.templates = append(ex.templates, PaginationTemplate)
ex.templates = append(ex.templates, PaginationTemplate, CollectionTemplate)
ex.gqlSchemaHooks = append(ex.gqlSchemaHooks, addNodesToConnections)

return nil
Expand Down
3 changes: 3 additions & 0 deletions entx/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ var (
// PaginationTemplate adds support for adding the nodes field to relay connections
PaginationTemplate = parseT("template/pagination.tmpl")

// CollectionTemplate adds support for adding the nodes field to relay connections
CollectionTemplate = parseT("template/collection.tmpl")

// TemplateFuncs contains the extra template functions used by entx.
TemplateFuncs = template.FuncMap{
"contains": strings.Contains,
Expand Down
Loading
Loading