From 4c6127537b4affd3a62b61fc47eb1de4eef7677b Mon Sep 17 00:00:00 2001 From: gearnode Date: Sun, 26 Jan 2025 13:44:16 +0100 Subject: [PATCH] Add control graphql encoding Signed-off-by: gearnode --- pkg/api/console/v1/types/control.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkg/api/console/v1/types/control.go b/pkg/api/console/v1/types/control.go index 3a6efc44b..5e8bd22c7 100644 --- a/pkg/api/console/v1/types/control.go +++ b/pkg/api/console/v1/types/control.go @@ -32,13 +32,19 @@ func NewControlConnection(p *page.Page[*coredata.Control]) *ControlConnection { } } -func NewControlEdge(f *coredata.Control) *ControlEdge { +func NewControlEdge(c *coredata.Control) *ControlEdge { return &ControlEdge{ - Cursor: f.CursorKey(), - Node: NewControl(f), + Cursor: c.CursorKey(), + Node: NewControl(c), } } -func NewControl(e *coredata.Control) *Control { - return &Control{} +func NewControl(c *coredata.Control) *Control { + return &Control{ + ID: c.ID, + Name: c.Name, + Description: c.Description, + CreatedAt: c.CreatedAt, + UpdatedAt: c.UpdatedAt, + } }