Add framework node query support
Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
@@ -124,6 +124,13 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
||||
}
|
||||
|
||||
return types.NewVendor(vendor), nil
|
||||
case coredata.FrameworkEntityType:
|
||||
framework, err := r.svc.GetFramework(ctx, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return types.NewFramework(framework), nil
|
||||
default:
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,26 @@ func (s Service) GetVendor(
|
||||
return vendor, nil
|
||||
}
|
||||
|
||||
func (s Service) GetFramework(
|
||||
ctx context.Context,
|
||||
frameworkID gid.GID,
|
||||
) (*coredata.Framework, error) {
|
||||
framework := &coredata.Framework{}
|
||||
|
||||
err := s.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
return framework.LoadByID(ctx, conn, s.scope, frameworkID)
|
||||
},
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return framework, nil
|
||||
}
|
||||
|
||||
func (s Service) ListOrganizationFrameworks(
|
||||
ctx context.Context,
|
||||
organizationID gid.GID,
|
||||
|
||||
Reference in New Issue
Block a user