Hi @a8m,
We need to add additional fields to generated connect objects by pagination template.
https://github.com/facebookincubator/ent-contrib/blob/master/entgql/template/pagination.tmpl
{{/* A template for adding additional fields to specific types. */}}
{{ define "model/fields/additional" }}
{{- /* Add static fields to the "Card" entity. */}}
{{- if eq $.Name "Card" }}
// StaticField defined by templates.
StaticField string `json:"static_field,omitempty"`
{{- end }}
{{ end }}
Just like above if you can add support to override a template to add more fields to the connections object then it will help us to extend them as per our needs.
Thanks,
Dilip
Solved using a different approach so this is not needed at this moment.
Great @dilipkk-foyernet.
Feel free to share your workaround for future readers. Thanks 馃槉
// DeviceConnection is for constructing device search response
type DeviceConnection struct {
*ent.DeviceConnection
CountByType []*DeviceCountByType
}
I am extending ent connection object and adding custom fields.
@a8m if you have time then can you tell me what I am doing wrong here: https://github.com/facebookincubator/ent-contrib/pull/19, just for my understanding. Thanks for your support as always :+1:
Most helpful comment
Great @dilipkk-foyernet.
Feel free to share your workaround for future readers. Thanks 馃槉