Update graphql api to allow use of @prepend and @delete relay attr
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -103,6 +103,8 @@ func (cm ControlMeasure) Delete(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
|
controlID gid.GID,
|
||||||
|
measureID gid.GID,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
DELETE
|
DELETE
|
||||||
@@ -115,8 +117,8 @@ WHERE
|
|||||||
`
|
`
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"control_id": cm.ControlID,
|
"control_id": controlID,
|
||||||
"measure_id": cm.MeasureID,
|
"measure_id": measureID,
|
||||||
}
|
}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ func (cp ControlPolicy) Delete(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
|
controlID gid.GID,
|
||||||
|
policyID gid.GID,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
DELETE
|
DELETE
|
||||||
@@ -83,8 +85,8 @@ WHERE
|
|||||||
`
|
`
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"control_id": cp.ControlID,
|
"control_id": controlID,
|
||||||
"policy_id": cp.PolicyID,
|
"policy_id": policyID,
|
||||||
}
|
}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ func (s ControlService) CreateMeasureMapping(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
controlID gid.GID,
|
controlID gid.GID,
|
||||||
measureID gid.GID,
|
measureID gid.GID,
|
||||||
) error {
|
) (*coredata.Control, *coredata.Measure, error) {
|
||||||
controlMeasure := &coredata.ControlMeasure{
|
controlMeasure := &coredata.ControlMeasure{
|
||||||
ControlID: controlID,
|
ControlID: controlID,
|
||||||
MeasureID: measureID,
|
MeasureID: measureID,
|
||||||
@@ -122,7 +122,7 @@ func (s ControlService) CreateMeasureMapping(
|
|||||||
control := &coredata.Control{}
|
control := &coredata.Control{}
|
||||||
measure := &coredata.Measure{}
|
measure := &coredata.Measure{}
|
||||||
|
|
||||||
return s.svc.pg.WithConn(
|
err := s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
if err := control.LoadByID(ctx, conn, s.svc.scope, controlID); err != nil {
|
if err := control.LoadByID(ctx, conn, s.svc.scope, controlID); err != nil {
|
||||||
@@ -136,24 +136,23 @@ func (s ControlService) CreateMeasureMapping(
|
|||||||
return controlMeasure.Insert(ctx, conn, s.svc.scope)
|
return controlMeasure.Insert(ctx, conn, s.svc.scope)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, fmt.Errorf("cannot create control measure mapping: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return control, measure, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ControlService) DeleteMeasureMapping(
|
func (s ControlService) DeleteMeasureMapping(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
controlID gid.GID,
|
controlID gid.GID,
|
||||||
measureID gid.GID,
|
measureID gid.GID,
|
||||||
) error {
|
) (*coredata.Control, *coredata.Measure, error) {
|
||||||
controlMeasure := &coredata.ControlMeasure{
|
|
||||||
ControlID: controlID,
|
|
||||||
MeasureID: measureID,
|
|
||||||
TenantID: s.svc.scope.GetTenantID(),
|
|
||||||
CreatedAt: time.Now(),
|
|
||||||
}
|
|
||||||
|
|
||||||
control := &coredata.Control{}
|
control := &coredata.Control{}
|
||||||
measure := &coredata.Measure{}
|
measure := &coredata.Measure{}
|
||||||
|
|
||||||
return s.svc.pg.WithConn(
|
err := s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
if err := control.LoadByID(ctx, conn, s.svc.scope, controlID); err != nil {
|
if err := control.LoadByID(ctx, conn, s.svc.scope, controlID); err != nil {
|
||||||
@@ -164,27 +163,31 @@ func (s ControlService) DeleteMeasureMapping(
|
|||||||
return fmt.Errorf("cannot load measure: %w", err)
|
return fmt.Errorf("cannot load measure: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return controlMeasure.Delete(ctx, conn, s.svc.scope)
|
controlMeasure := &coredata.ControlMeasure{}
|
||||||
|
if err := controlMeasure.Delete(ctx, conn, s.svc.scope, control.ID, measure.ID); err != nil {
|
||||||
|
return fmt.Errorf("cannot delete control measure mapping: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, fmt.Errorf("cannot delete control measure mapping: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return control, measure, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ControlService) CreatePolicyMapping(
|
func (s ControlService) CreatePolicyMapping(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
controlID gid.GID,
|
controlID gid.GID,
|
||||||
policyID gid.GID,
|
policyID gid.GID,
|
||||||
) error {
|
) (*coredata.Control, *coredata.Policy, error) {
|
||||||
controlPolicy := &coredata.ControlPolicy{
|
|
||||||
ControlID: controlID,
|
|
||||||
PolicyID: policyID,
|
|
||||||
TenantID: s.svc.scope.GetTenantID(),
|
|
||||||
CreatedAt: time.Now(),
|
|
||||||
}
|
|
||||||
|
|
||||||
control := &coredata.Control{}
|
control := &coredata.Control{}
|
||||||
policy := &coredata.Policy{}
|
policy := &coredata.Policy{}
|
||||||
|
|
||||||
return s.svc.pg.WithConn(
|
err := s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
if err := control.LoadByID(ctx, conn, s.svc.scope, controlID); err != nil {
|
if err := control.LoadByID(ctx, conn, s.svc.scope, controlID); err != nil {
|
||||||
@@ -195,27 +198,37 @@ func (s ControlService) CreatePolicyMapping(
|
|||||||
return fmt.Errorf("cannot load policy: %w", err)
|
return fmt.Errorf("cannot load policy: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return controlPolicy.Insert(ctx, conn, s.svc.scope)
|
controlPolicy := &coredata.ControlPolicy{
|
||||||
|
ControlID: control.ID,
|
||||||
|
PolicyID: policy.ID,
|
||||||
|
TenantID: s.svc.scope.GetTenantID(),
|
||||||
|
CreatedAt: time.Now(),
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := controlPolicy.Insert(ctx, conn, s.svc.scope); err != nil {
|
||||||
|
return fmt.Errorf("cannot insert control policy: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, fmt.Errorf("cannot create control policy mapping: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return control, policy, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ControlService) DeletePolicyMapping(
|
func (s ControlService) DeletePolicyMapping(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
controlID gid.GID,
|
controlID gid.GID,
|
||||||
policyID gid.GID,
|
policyID gid.GID,
|
||||||
) error {
|
) (*coredata.Control, *coredata.Policy, error) {
|
||||||
controlPolicy := &coredata.ControlPolicy{
|
|
||||||
ControlID: controlID,
|
|
||||||
PolicyID: policyID,
|
|
||||||
TenantID: s.svc.scope.GetTenantID(),
|
|
||||||
CreatedAt: time.Now(),
|
|
||||||
}
|
|
||||||
|
|
||||||
control := &coredata.Control{}
|
control := &coredata.Control{}
|
||||||
policy := &coredata.Policy{}
|
policy := &coredata.Policy{}
|
||||||
|
|
||||||
return s.svc.pg.WithConn(
|
err := s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
if err := control.LoadByID(ctx, conn, s.svc.scope, controlID); err != nil {
|
if err := control.LoadByID(ctx, conn, s.svc.scope, controlID); err != nil {
|
||||||
@@ -226,9 +239,20 @@ func (s ControlService) DeletePolicyMapping(
|
|||||||
return fmt.Errorf("cannot load policy: %w", err)
|
return fmt.Errorf("cannot load policy: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return controlPolicy.Delete(ctx, conn, s.svc.scope)
|
controlPolicy := &coredata.ControlPolicy{}
|
||||||
|
if err := controlPolicy.Delete(ctx, conn, s.svc.scope, control.ID, policy.ID); err != nil {
|
||||||
|
return fmt.Errorf("cannot delete control policy mapping: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, fmt.Errorf("cannot delete control policy mapping: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return control, policy, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ControlService) Create(
|
func (s ControlService) Create(
|
||||||
|
|||||||
@@ -1468,19 +1468,23 @@ type UnassignTaskPayload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlMeasureMappingPayload {
|
type CreateControlMeasureMappingPayload {
|
||||||
success: Boolean!
|
controlEdge: ControlEdge!
|
||||||
|
measureEdge: MeasureEdge!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlPolicyMappingPayload {
|
type CreateControlPolicyMappingPayload {
|
||||||
success: Boolean!
|
controlEdge: ControlEdge!
|
||||||
|
policyEdge: PolicyEdge!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteControlMeasureMappingPayload {
|
type DeleteControlMeasureMappingPayload {
|
||||||
success: Boolean!
|
deletedControlId: ID!
|
||||||
|
deletedMeasureId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteControlPolicyMappingPayload {
|
type DeleteControlPolicyMappingPayload {
|
||||||
success: Boolean!
|
deletedControlId: ID!
|
||||||
|
deletedPolicyId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateRiskPayload {
|
type CreateRiskPayload {
|
||||||
|
|||||||
@@ -114,11 +114,13 @@ type ComplexityRoot struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CreateControlMeasureMappingPayload struct {
|
CreateControlMeasureMappingPayload struct {
|
||||||
Success func(childComplexity int) int
|
ControlEdge func(childComplexity int) int
|
||||||
|
MeasureEdge func(childComplexity int) int
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateControlPolicyMappingPayload struct {
|
CreateControlPolicyMappingPayload struct {
|
||||||
Success func(childComplexity int) int
|
ControlEdge func(childComplexity int) int
|
||||||
|
PolicyEdge func(childComplexity int) int
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateDraftPolicyVersionPayload struct {
|
CreateDraftPolicyVersionPayload struct {
|
||||||
@@ -177,11 +179,13 @@ type ComplexityRoot struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DeleteControlMeasureMappingPayload struct {
|
DeleteControlMeasureMappingPayload struct {
|
||||||
Success func(childComplexity int) int
|
DeletedControlID func(childComplexity int) int
|
||||||
|
DeletedMeasureID func(childComplexity int) int
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteControlPolicyMappingPayload struct {
|
DeleteControlPolicyMappingPayload struct {
|
||||||
Success func(childComplexity int) int
|
DeletedControlID func(childComplexity int) int
|
||||||
|
DeletedPolicyID func(childComplexity int) int
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteEvidencePayload struct {
|
DeleteEvidencePayload struct {
|
||||||
@@ -1090,19 +1094,33 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
|||||||
|
|
||||||
return e.complexity.ControlEdge.Node(childComplexity), true
|
return e.complexity.ControlEdge.Node(childComplexity), true
|
||||||
|
|
||||||
case "CreateControlMeasureMappingPayload.success":
|
case "CreateControlMeasureMappingPayload.controlEdge":
|
||||||
if e.complexity.CreateControlMeasureMappingPayload.Success == nil {
|
if e.complexity.CreateControlMeasureMappingPayload.ControlEdge == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
return e.complexity.CreateControlMeasureMappingPayload.Success(childComplexity), true
|
return e.complexity.CreateControlMeasureMappingPayload.ControlEdge(childComplexity), true
|
||||||
|
|
||||||
case "CreateControlPolicyMappingPayload.success":
|
case "CreateControlMeasureMappingPayload.measureEdge":
|
||||||
if e.complexity.CreateControlPolicyMappingPayload.Success == nil {
|
if e.complexity.CreateControlMeasureMappingPayload.MeasureEdge == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
return e.complexity.CreateControlPolicyMappingPayload.Success(childComplexity), true
|
return e.complexity.CreateControlMeasureMappingPayload.MeasureEdge(childComplexity), true
|
||||||
|
|
||||||
|
case "CreateControlPolicyMappingPayload.controlEdge":
|
||||||
|
if e.complexity.CreateControlPolicyMappingPayload.ControlEdge == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.CreateControlPolicyMappingPayload.ControlEdge(childComplexity), true
|
||||||
|
|
||||||
|
case "CreateControlPolicyMappingPayload.policyEdge":
|
||||||
|
if e.complexity.CreateControlPolicyMappingPayload.PolicyEdge == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.CreateControlPolicyMappingPayload.PolicyEdge(childComplexity), true
|
||||||
|
|
||||||
case "CreateDraftPolicyVersionPayload.policyVersionEdge":
|
case "CreateDraftPolicyVersionPayload.policyVersionEdge":
|
||||||
if e.complexity.CreateDraftPolicyVersionPayload.PolicyVersionEdge == nil {
|
if e.complexity.CreateDraftPolicyVersionPayload.PolicyVersionEdge == nil {
|
||||||
@@ -1216,19 +1234,33 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
|||||||
|
|
||||||
return e.complexity.CreateVendorRiskAssessmentPayload.VendorRiskAssessmentEdge(childComplexity), true
|
return e.complexity.CreateVendorRiskAssessmentPayload.VendorRiskAssessmentEdge(childComplexity), true
|
||||||
|
|
||||||
case "DeleteControlMeasureMappingPayload.success":
|
case "DeleteControlMeasureMappingPayload.deletedControlId":
|
||||||
if e.complexity.DeleteControlMeasureMappingPayload.Success == nil {
|
if e.complexity.DeleteControlMeasureMappingPayload.DeletedControlID == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
return e.complexity.DeleteControlMeasureMappingPayload.Success(childComplexity), true
|
return e.complexity.DeleteControlMeasureMappingPayload.DeletedControlID(childComplexity), true
|
||||||
|
|
||||||
case "DeleteControlPolicyMappingPayload.success":
|
case "DeleteControlMeasureMappingPayload.deletedMeasureId":
|
||||||
if e.complexity.DeleteControlPolicyMappingPayload.Success == nil {
|
if e.complexity.DeleteControlMeasureMappingPayload.DeletedMeasureID == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
return e.complexity.DeleteControlPolicyMappingPayload.Success(childComplexity), true
|
return e.complexity.DeleteControlMeasureMappingPayload.DeletedMeasureID(childComplexity), true
|
||||||
|
|
||||||
|
case "DeleteControlPolicyMappingPayload.deletedControlId":
|
||||||
|
if e.complexity.DeleteControlPolicyMappingPayload.DeletedControlID == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.DeleteControlPolicyMappingPayload.DeletedControlID(childComplexity), true
|
||||||
|
|
||||||
|
case "DeleteControlPolicyMappingPayload.deletedPolicyId":
|
||||||
|
if e.complexity.DeleteControlPolicyMappingPayload.DeletedPolicyID == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.DeleteControlPolicyMappingPayload.DeletedPolicyID(childComplexity), true
|
||||||
|
|
||||||
case "DeleteEvidencePayload.deletedEvidenceId":
|
case "DeleteEvidencePayload.deletedEvidenceId":
|
||||||
if e.complexity.DeleteEvidencePayload.DeletedEvidenceID == nil {
|
if e.complexity.DeleteEvidencePayload.DeletedEvidenceID == nil {
|
||||||
@@ -5471,19 +5503,23 @@ type UnassignTaskPayload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlMeasureMappingPayload {
|
type CreateControlMeasureMappingPayload {
|
||||||
success: Boolean!
|
controlEdge: ControlEdge!
|
||||||
|
measureEdge: MeasureEdge!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlPolicyMappingPayload {
|
type CreateControlPolicyMappingPayload {
|
||||||
success: Boolean!
|
controlEdge: ControlEdge!
|
||||||
|
policyEdge: PolicyEdge!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteControlMeasureMappingPayload {
|
type DeleteControlMeasureMappingPayload {
|
||||||
success: Boolean!
|
deletedControlId: ID!
|
||||||
|
deletedMeasureId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteControlPolicyMappingPayload {
|
type DeleteControlPolicyMappingPayload {
|
||||||
success: Boolean!
|
deletedControlId: ID!
|
||||||
|
deletedPolicyId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateRiskPayload {
|
type CreateRiskPayload {
|
||||||
@@ -10824,8 +10860,8 @@ func (ec *executionContext) fieldContext_ControlEdge_node(_ context.Context, fie
|
|||||||
return fc, nil
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _CreateControlMeasureMappingPayload_success(ctx context.Context, field graphql.CollectedField, obj *types.CreateControlMeasureMappingPayload) (ret graphql.Marshaler) {
|
func (ec *executionContext) _CreateControlMeasureMappingPayload_controlEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateControlMeasureMappingPayload) (ret graphql.Marshaler) {
|
||||||
fc, err := ec.fieldContext_CreateControlMeasureMappingPayload_success(ctx, field)
|
fc, err := ec.fieldContext_CreateControlMeasureMappingPayload_controlEdge(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
@@ -10838,7 +10874,7 @@ func (ec *executionContext) _CreateControlMeasureMappingPayload_success(ctx cont
|
|||||||
}()
|
}()
|
||||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
ctx = rctx // use context from middleware stack in children
|
ctx = rctx // use context from middleware stack in children
|
||||||
return obj.Success, nil
|
return obj.ControlEdge, nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ec.Error(ctx, err)
|
ec.Error(ctx, err)
|
||||||
@@ -10850,26 +10886,32 @@ func (ec *executionContext) _CreateControlMeasureMappingPayload_success(ctx cont
|
|||||||
}
|
}
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
res := resTmp.(bool)
|
res := resTmp.(*types.ControlEdge)
|
||||||
fc.Result = res
|
fc.Result = res
|
||||||
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
return ec.marshalNControlEdge2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlEdge(ctx, field.Selections, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) fieldContext_CreateControlMeasureMappingPayload_success(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
func (ec *executionContext) fieldContext_CreateControlMeasureMappingPayload_controlEdge(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
fc = &graphql.FieldContext{
|
fc = &graphql.FieldContext{
|
||||||
Object: "CreateControlMeasureMappingPayload",
|
Object: "CreateControlMeasureMappingPayload",
|
||||||
Field: field,
|
Field: field,
|
||||||
IsMethod: false,
|
IsMethod: false,
|
||||||
IsResolver: false,
|
IsResolver: false,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
return nil, errors.New("field of type Boolean does not have child fields")
|
switch field.Name {
|
||||||
|
case "cursor":
|
||||||
|
return ec.fieldContext_ControlEdge_cursor(ctx, field)
|
||||||
|
case "node":
|
||||||
|
return ec.fieldContext_ControlEdge_node(ctx, field)
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("no field named %q was found under type ControlEdge", field.Name)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return fc, nil
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _CreateControlPolicyMappingPayload_success(ctx context.Context, field graphql.CollectedField, obj *types.CreateControlPolicyMappingPayload) (ret graphql.Marshaler) {
|
func (ec *executionContext) _CreateControlMeasureMappingPayload_measureEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateControlMeasureMappingPayload) (ret graphql.Marshaler) {
|
||||||
fc, err := ec.fieldContext_CreateControlPolicyMappingPayload_success(ctx, field)
|
fc, err := ec.fieldContext_CreateControlMeasureMappingPayload_measureEdge(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
@@ -10882,7 +10924,7 @@ func (ec *executionContext) _CreateControlPolicyMappingPayload_success(ctx conte
|
|||||||
}()
|
}()
|
||||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
ctx = rctx // use context from middleware stack in children
|
ctx = rctx // use context from middleware stack in children
|
||||||
return obj.Success, nil
|
return obj.MeasureEdge, nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ec.Error(ctx, err)
|
ec.Error(ctx, err)
|
||||||
@@ -10894,19 +10936,125 @@ func (ec *executionContext) _CreateControlPolicyMappingPayload_success(ctx conte
|
|||||||
}
|
}
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
res := resTmp.(bool)
|
res := resTmp.(*types.MeasureEdge)
|
||||||
fc.Result = res
|
fc.Result = res
|
||||||
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
return ec.marshalNMeasureEdge2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐMeasureEdge(ctx, field.Selections, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) fieldContext_CreateControlPolicyMappingPayload_success(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
func (ec *executionContext) fieldContext_CreateControlMeasureMappingPayload_measureEdge(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
|
fc = &graphql.FieldContext{
|
||||||
|
Object: "CreateControlMeasureMappingPayload",
|
||||||
|
Field: field,
|
||||||
|
IsMethod: false,
|
||||||
|
IsResolver: false,
|
||||||
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
|
switch field.Name {
|
||||||
|
case "cursor":
|
||||||
|
return ec.fieldContext_MeasureEdge_cursor(ctx, field)
|
||||||
|
case "node":
|
||||||
|
return ec.fieldContext_MeasureEdge_node(ctx, field)
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("no field named %q was found under type MeasureEdge", field.Name)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _CreateControlPolicyMappingPayload_controlEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateControlPolicyMappingPayload) (ret graphql.Marshaler) {
|
||||||
|
fc, err := ec.fieldContext_CreateControlPolicyMappingPayload_controlEdge(ctx, field)
|
||||||
|
if err != nil {
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
ctx = graphql.WithFieldContext(ctx, fc)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
ec.Error(ctx, ec.Recover(ctx, r))
|
||||||
|
ret = graphql.Null
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
|
ctx = rctx // use context from middleware stack in children
|
||||||
|
return obj.ControlEdge, nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
ec.Error(ctx, err)
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
if resTmp == nil {
|
||||||
|
if !graphql.HasFieldError(ctx, fc) {
|
||||||
|
ec.Errorf(ctx, "must not be null")
|
||||||
|
}
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
res := resTmp.(*types.ControlEdge)
|
||||||
|
fc.Result = res
|
||||||
|
return ec.marshalNControlEdge2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐControlEdge(ctx, field.Selections, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) fieldContext_CreateControlPolicyMappingPayload_controlEdge(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
fc = &graphql.FieldContext{
|
fc = &graphql.FieldContext{
|
||||||
Object: "CreateControlPolicyMappingPayload",
|
Object: "CreateControlPolicyMappingPayload",
|
||||||
Field: field,
|
Field: field,
|
||||||
IsMethod: false,
|
IsMethod: false,
|
||||||
IsResolver: false,
|
IsResolver: false,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
return nil, errors.New("field of type Boolean does not have child fields")
|
switch field.Name {
|
||||||
|
case "cursor":
|
||||||
|
return ec.fieldContext_ControlEdge_cursor(ctx, field)
|
||||||
|
case "node":
|
||||||
|
return ec.fieldContext_ControlEdge_node(ctx, field)
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("no field named %q was found under type ControlEdge", field.Name)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _CreateControlPolicyMappingPayload_policyEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateControlPolicyMappingPayload) (ret graphql.Marshaler) {
|
||||||
|
fc, err := ec.fieldContext_CreateControlPolicyMappingPayload_policyEdge(ctx, field)
|
||||||
|
if err != nil {
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
ctx = graphql.WithFieldContext(ctx, fc)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
ec.Error(ctx, ec.Recover(ctx, r))
|
||||||
|
ret = graphql.Null
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
|
ctx = rctx // use context from middleware stack in children
|
||||||
|
return obj.PolicyEdge, nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
ec.Error(ctx, err)
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
if resTmp == nil {
|
||||||
|
if !graphql.HasFieldError(ctx, fc) {
|
||||||
|
ec.Errorf(ctx, "must not be null")
|
||||||
|
}
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
res := resTmp.(*types.PolicyEdge)
|
||||||
|
fc.Result = res
|
||||||
|
return ec.marshalNPolicyEdge2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐPolicyEdge(ctx, field.Selections, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) fieldContext_CreateControlPolicyMappingPayload_policyEdge(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
|
fc = &graphql.FieldContext{
|
||||||
|
Object: "CreateControlPolicyMappingPayload",
|
||||||
|
Field: field,
|
||||||
|
IsMethod: false,
|
||||||
|
IsResolver: false,
|
||||||
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
|
switch field.Name {
|
||||||
|
case "cursor":
|
||||||
|
return ec.fieldContext_PolicyEdge_cursor(ctx, field)
|
||||||
|
case "node":
|
||||||
|
return ec.fieldContext_PolicyEdge_node(ctx, field)
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("no field named %q was found under type PolicyEdge", field.Name)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return fc, nil
|
return fc, nil
|
||||||
@@ -11712,8 +11860,8 @@ func (ec *executionContext) fieldContext_CreateVendorRiskAssessmentPayload_vendo
|
|||||||
return fc, nil
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _DeleteControlMeasureMappingPayload_success(ctx context.Context, field graphql.CollectedField, obj *types.DeleteControlMeasureMappingPayload) (ret graphql.Marshaler) {
|
func (ec *executionContext) _DeleteControlMeasureMappingPayload_deletedControlId(ctx context.Context, field graphql.CollectedField, obj *types.DeleteControlMeasureMappingPayload) (ret graphql.Marshaler) {
|
||||||
fc, err := ec.fieldContext_DeleteControlMeasureMappingPayload_success(ctx, field)
|
fc, err := ec.fieldContext_DeleteControlMeasureMappingPayload_deletedControlId(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
@@ -11726,7 +11874,7 @@ func (ec *executionContext) _DeleteControlMeasureMappingPayload_success(ctx cont
|
|||||||
}()
|
}()
|
||||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
ctx = rctx // use context from middleware stack in children
|
ctx = rctx // use context from middleware stack in children
|
||||||
return obj.Success, nil
|
return obj.DeletedControlID, nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ec.Error(ctx, err)
|
ec.Error(ctx, err)
|
||||||
@@ -11738,26 +11886,26 @@ func (ec *executionContext) _DeleteControlMeasureMappingPayload_success(ctx cont
|
|||||||
}
|
}
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
res := resTmp.(bool)
|
res := resTmp.(gid.GID)
|
||||||
fc.Result = res
|
fc.Result = res
|
||||||
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
return ec.marshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, field.Selections, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) fieldContext_DeleteControlMeasureMappingPayload_success(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
func (ec *executionContext) fieldContext_DeleteControlMeasureMappingPayload_deletedControlId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
fc = &graphql.FieldContext{
|
fc = &graphql.FieldContext{
|
||||||
Object: "DeleteControlMeasureMappingPayload",
|
Object: "DeleteControlMeasureMappingPayload",
|
||||||
Field: field,
|
Field: field,
|
||||||
IsMethod: false,
|
IsMethod: false,
|
||||||
IsResolver: false,
|
IsResolver: false,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
return nil, errors.New("field of type Boolean does not have child fields")
|
return nil, errors.New("field of type ID does not have child fields")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return fc, nil
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _DeleteControlPolicyMappingPayload_success(ctx context.Context, field graphql.CollectedField, obj *types.DeleteControlPolicyMappingPayload) (ret graphql.Marshaler) {
|
func (ec *executionContext) _DeleteControlMeasureMappingPayload_deletedMeasureId(ctx context.Context, field graphql.CollectedField, obj *types.DeleteControlMeasureMappingPayload) (ret graphql.Marshaler) {
|
||||||
fc, err := ec.fieldContext_DeleteControlPolicyMappingPayload_success(ctx, field)
|
fc, err := ec.fieldContext_DeleteControlMeasureMappingPayload_deletedMeasureId(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
@@ -11770,7 +11918,7 @@ func (ec *executionContext) _DeleteControlPolicyMappingPayload_success(ctx conte
|
|||||||
}()
|
}()
|
||||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
ctx = rctx // use context from middleware stack in children
|
ctx = rctx // use context from middleware stack in children
|
||||||
return obj.Success, nil
|
return obj.DeletedMeasureID, nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ec.Error(ctx, err)
|
ec.Error(ctx, err)
|
||||||
@@ -11782,19 +11930,107 @@ func (ec *executionContext) _DeleteControlPolicyMappingPayload_success(ctx conte
|
|||||||
}
|
}
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
res := resTmp.(bool)
|
res := resTmp.(gid.GID)
|
||||||
fc.Result = res
|
fc.Result = res
|
||||||
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
return ec.marshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, field.Selections, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) fieldContext_DeleteControlPolicyMappingPayload_success(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
func (ec *executionContext) fieldContext_DeleteControlMeasureMappingPayload_deletedMeasureId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
|
fc = &graphql.FieldContext{
|
||||||
|
Object: "DeleteControlMeasureMappingPayload",
|
||||||
|
Field: field,
|
||||||
|
IsMethod: false,
|
||||||
|
IsResolver: false,
|
||||||
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
|
return nil, errors.New("field of type ID does not have child fields")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _DeleteControlPolicyMappingPayload_deletedControlId(ctx context.Context, field graphql.CollectedField, obj *types.DeleteControlPolicyMappingPayload) (ret graphql.Marshaler) {
|
||||||
|
fc, err := ec.fieldContext_DeleteControlPolicyMappingPayload_deletedControlId(ctx, field)
|
||||||
|
if err != nil {
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
ctx = graphql.WithFieldContext(ctx, fc)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
ec.Error(ctx, ec.Recover(ctx, r))
|
||||||
|
ret = graphql.Null
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
|
ctx = rctx // use context from middleware stack in children
|
||||||
|
return obj.DeletedControlID, nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
ec.Error(ctx, err)
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
if resTmp == nil {
|
||||||
|
if !graphql.HasFieldError(ctx, fc) {
|
||||||
|
ec.Errorf(ctx, "must not be null")
|
||||||
|
}
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
res := resTmp.(gid.GID)
|
||||||
|
fc.Result = res
|
||||||
|
return ec.marshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, field.Selections, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) fieldContext_DeleteControlPolicyMappingPayload_deletedControlId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
fc = &graphql.FieldContext{
|
fc = &graphql.FieldContext{
|
||||||
Object: "DeleteControlPolicyMappingPayload",
|
Object: "DeleteControlPolicyMappingPayload",
|
||||||
Field: field,
|
Field: field,
|
||||||
IsMethod: false,
|
IsMethod: false,
|
||||||
IsResolver: false,
|
IsResolver: false,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
return nil, errors.New("field of type Boolean does not have child fields")
|
return nil, errors.New("field of type ID does not have child fields")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _DeleteControlPolicyMappingPayload_deletedPolicyId(ctx context.Context, field graphql.CollectedField, obj *types.DeleteControlPolicyMappingPayload) (ret graphql.Marshaler) {
|
||||||
|
fc, err := ec.fieldContext_DeleteControlPolicyMappingPayload_deletedPolicyId(ctx, field)
|
||||||
|
if err != nil {
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
ctx = graphql.WithFieldContext(ctx, fc)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
ec.Error(ctx, ec.Recover(ctx, r))
|
||||||
|
ret = graphql.Null
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
|
ctx = rctx // use context from middleware stack in children
|
||||||
|
return obj.DeletedPolicyID, nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
ec.Error(ctx, err)
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
if resTmp == nil {
|
||||||
|
if !graphql.HasFieldError(ctx, fc) {
|
||||||
|
ec.Errorf(ctx, "must not be null")
|
||||||
|
}
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
res := resTmp.(gid.GID)
|
||||||
|
fc.Result = res
|
||||||
|
return ec.marshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, field.Selections, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) fieldContext_DeleteControlPolicyMappingPayload_deletedPolicyId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
|
fc = &graphql.FieldContext{
|
||||||
|
Object: "DeleteControlPolicyMappingPayload",
|
||||||
|
Field: field,
|
||||||
|
IsMethod: false,
|
||||||
|
IsResolver: false,
|
||||||
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
|
return nil, errors.New("field of type ID does not have child fields")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return fc, nil
|
return fc, nil
|
||||||
@@ -16035,8 +16271,10 @@ func (ec *executionContext) fieldContext_Mutation_createControlMeasureMapping(ct
|
|||||||
IsResolver: true,
|
IsResolver: true,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "success":
|
case "controlEdge":
|
||||||
return ec.fieldContext_CreateControlMeasureMappingPayload_success(ctx, field)
|
return ec.fieldContext_CreateControlMeasureMappingPayload_controlEdge(ctx, field)
|
||||||
|
case "measureEdge":
|
||||||
|
return ec.fieldContext_CreateControlMeasureMappingPayload_measureEdge(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type CreateControlMeasureMappingPayload", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type CreateControlMeasureMappingPayload", field.Name)
|
||||||
},
|
},
|
||||||
@@ -16094,8 +16332,10 @@ func (ec *executionContext) fieldContext_Mutation_createControlPolicyMapping(ctx
|
|||||||
IsResolver: true,
|
IsResolver: true,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "success":
|
case "controlEdge":
|
||||||
return ec.fieldContext_CreateControlPolicyMappingPayload_success(ctx, field)
|
return ec.fieldContext_CreateControlPolicyMappingPayload_controlEdge(ctx, field)
|
||||||
|
case "policyEdge":
|
||||||
|
return ec.fieldContext_CreateControlPolicyMappingPayload_policyEdge(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type CreateControlPolicyMappingPayload", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type CreateControlPolicyMappingPayload", field.Name)
|
||||||
},
|
},
|
||||||
@@ -16153,8 +16393,10 @@ func (ec *executionContext) fieldContext_Mutation_deleteControlMeasureMapping(ct
|
|||||||
IsResolver: true,
|
IsResolver: true,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "success":
|
case "deletedControlId":
|
||||||
return ec.fieldContext_DeleteControlMeasureMappingPayload_success(ctx, field)
|
return ec.fieldContext_DeleteControlMeasureMappingPayload_deletedControlId(ctx, field)
|
||||||
|
case "deletedMeasureId":
|
||||||
|
return ec.fieldContext_DeleteControlMeasureMappingPayload_deletedMeasureId(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type DeleteControlMeasureMappingPayload", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type DeleteControlMeasureMappingPayload", field.Name)
|
||||||
},
|
},
|
||||||
@@ -16212,8 +16454,10 @@ func (ec *executionContext) fieldContext_Mutation_deleteControlPolicyMapping(ctx
|
|||||||
IsResolver: true,
|
IsResolver: true,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "success":
|
case "deletedControlId":
|
||||||
return ec.fieldContext_DeleteControlPolicyMappingPayload_success(ctx, field)
|
return ec.fieldContext_DeleteControlPolicyMappingPayload_deletedControlId(ctx, field)
|
||||||
|
case "deletedPolicyId":
|
||||||
|
return ec.fieldContext_DeleteControlPolicyMappingPayload_deletedPolicyId(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type DeleteControlPolicyMappingPayload", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type DeleteControlPolicyMappingPayload", field.Name)
|
||||||
},
|
},
|
||||||
@@ -33881,8 +34125,13 @@ func (ec *executionContext) _CreateControlMeasureMappingPayload(ctx context.Cont
|
|||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "__typename":
|
case "__typename":
|
||||||
out.Values[i] = graphql.MarshalString("CreateControlMeasureMappingPayload")
|
out.Values[i] = graphql.MarshalString("CreateControlMeasureMappingPayload")
|
||||||
case "success":
|
case "controlEdge":
|
||||||
out.Values[i] = ec._CreateControlMeasureMappingPayload_success(ctx, field, obj)
|
out.Values[i] = ec._CreateControlMeasureMappingPayload_controlEdge(ctx, field, obj)
|
||||||
|
if out.Values[i] == graphql.Null {
|
||||||
|
out.Invalids++
|
||||||
|
}
|
||||||
|
case "measureEdge":
|
||||||
|
out.Values[i] = ec._CreateControlMeasureMappingPayload_measureEdge(ctx, field, obj)
|
||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
out.Invalids++
|
out.Invalids++
|
||||||
}
|
}
|
||||||
@@ -33920,8 +34169,13 @@ func (ec *executionContext) _CreateControlPolicyMappingPayload(ctx context.Conte
|
|||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "__typename":
|
case "__typename":
|
||||||
out.Values[i] = graphql.MarshalString("CreateControlPolicyMappingPayload")
|
out.Values[i] = graphql.MarshalString("CreateControlPolicyMappingPayload")
|
||||||
case "success":
|
case "controlEdge":
|
||||||
out.Values[i] = ec._CreateControlPolicyMappingPayload_success(ctx, field, obj)
|
out.Values[i] = ec._CreateControlPolicyMappingPayload_controlEdge(ctx, field, obj)
|
||||||
|
if out.Values[i] == graphql.Null {
|
||||||
|
out.Invalids++
|
||||||
|
}
|
||||||
|
case "policyEdge":
|
||||||
|
out.Values[i] = ec._CreateControlPolicyMappingPayload_policyEdge(ctx, field, obj)
|
||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
out.Invalids++
|
out.Invalids++
|
||||||
}
|
}
|
||||||
@@ -34481,8 +34735,13 @@ func (ec *executionContext) _DeleteControlMeasureMappingPayload(ctx context.Cont
|
|||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "__typename":
|
case "__typename":
|
||||||
out.Values[i] = graphql.MarshalString("DeleteControlMeasureMappingPayload")
|
out.Values[i] = graphql.MarshalString("DeleteControlMeasureMappingPayload")
|
||||||
case "success":
|
case "deletedControlId":
|
||||||
out.Values[i] = ec._DeleteControlMeasureMappingPayload_success(ctx, field, obj)
|
out.Values[i] = ec._DeleteControlMeasureMappingPayload_deletedControlId(ctx, field, obj)
|
||||||
|
if out.Values[i] == graphql.Null {
|
||||||
|
out.Invalids++
|
||||||
|
}
|
||||||
|
case "deletedMeasureId":
|
||||||
|
out.Values[i] = ec._DeleteControlMeasureMappingPayload_deletedMeasureId(ctx, field, obj)
|
||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
out.Invalids++
|
out.Invalids++
|
||||||
}
|
}
|
||||||
@@ -34520,8 +34779,13 @@ func (ec *executionContext) _DeleteControlPolicyMappingPayload(ctx context.Conte
|
|||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "__typename":
|
case "__typename":
|
||||||
out.Values[i] = graphql.MarshalString("DeleteControlPolicyMappingPayload")
|
out.Values[i] = graphql.MarshalString("DeleteControlPolicyMappingPayload")
|
||||||
case "success":
|
case "deletedControlId":
|
||||||
out.Values[i] = ec._DeleteControlPolicyMappingPayload_success(ctx, field, obj)
|
out.Values[i] = ec._DeleteControlPolicyMappingPayload_deletedControlId(ctx, field, obj)
|
||||||
|
if out.Values[i] == graphql.Null {
|
||||||
|
out.Invalids++
|
||||||
|
}
|
||||||
|
case "deletedPolicyId":
|
||||||
|
out.Values[i] = ec._DeleteControlPolicyMappingPayload_deletedPolicyId(ctx, field, obj)
|
||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
out.Invalids++
|
out.Invalids++
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ type CreateControlMeasureMappingInput struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlMeasureMappingPayload struct {
|
type CreateControlMeasureMappingPayload struct {
|
||||||
Success bool `json:"success"`
|
ControlEdge *ControlEdge `json:"controlEdge"`
|
||||||
|
MeasureEdge *MeasureEdge `json:"measureEdge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlPolicyMappingInput struct {
|
type CreateControlPolicyMappingInput struct {
|
||||||
@@ -103,7 +104,8 @@ type CreateControlPolicyMappingInput struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlPolicyMappingPayload struct {
|
type CreateControlPolicyMappingPayload struct {
|
||||||
Success bool `json:"success"`
|
ControlEdge *ControlEdge `json:"controlEdge"`
|
||||||
|
PolicyEdge *PolicyEdge `json:"policyEdge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateDraftPolicyVersionInput struct {
|
type CreateDraftPolicyVersionInput struct {
|
||||||
@@ -274,7 +276,8 @@ type DeleteControlMeasureMappingInput struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DeleteControlMeasureMappingPayload struct {
|
type DeleteControlMeasureMappingPayload struct {
|
||||||
Success bool `json:"success"`
|
DeletedControlID gid.GID `json:"deletedControlId"`
|
||||||
|
DeletedMeasureID gid.GID `json:"deletedMeasureId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteControlPolicyMappingInput struct {
|
type DeleteControlPolicyMappingInput struct {
|
||||||
@@ -283,7 +286,8 @@ type DeleteControlPolicyMappingInput struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DeleteControlPolicyMappingPayload struct {
|
type DeleteControlPolicyMappingPayload struct {
|
||||||
Success bool `json:"success"`
|
DeletedControlID gid.GID `json:"deletedControlId"`
|
||||||
|
DeletedPolicyID gid.GID `json:"deletedPolicyId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteEvidenceInput struct {
|
type DeleteEvidenceInput struct {
|
||||||
|
|||||||
@@ -709,13 +709,14 @@ func (r *mutationResolver) DeleteMeasure(ctx context.Context, input types.Delete
|
|||||||
func (r *mutationResolver) CreateControlMeasureMapping(ctx context.Context, input types.CreateControlMeasureMappingInput) (*types.CreateControlMeasureMappingPayload, error) {
|
func (r *mutationResolver) CreateControlMeasureMapping(ctx context.Context, input types.CreateControlMeasureMappingInput) (*types.CreateControlMeasureMappingPayload, error) {
|
||||||
svc := GetTenantService(ctx, r.proboSvc, input.MeasureID.TenantID())
|
svc := GetTenantService(ctx, r.proboSvc, input.MeasureID.TenantID())
|
||||||
|
|
||||||
err := svc.Controls.CreateMeasureMapping(ctx, input.ControlID, input.MeasureID)
|
control, measure, err := svc.Controls.CreateMeasureMapping(ctx, input.ControlID, input.MeasureID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot create control measure mapping: %w", err))
|
panic(fmt.Errorf("cannot create control measure mapping: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.CreateControlMeasureMappingPayload{
|
return &types.CreateControlMeasureMappingPayload{
|
||||||
Success: true,
|
ControlEdge: types.NewControlEdge(control, coredata.ControlOrderFieldCreatedAt),
|
||||||
|
MeasureEdge: types.NewMeasureEdge(measure, coredata.MeasureOrderFieldCreatedAt),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -723,13 +724,14 @@ func (r *mutationResolver) CreateControlMeasureMapping(ctx context.Context, inpu
|
|||||||
func (r *mutationResolver) CreateControlPolicyMapping(ctx context.Context, input types.CreateControlPolicyMappingInput) (*types.CreateControlPolicyMappingPayload, error) {
|
func (r *mutationResolver) CreateControlPolicyMapping(ctx context.Context, input types.CreateControlPolicyMappingInput) (*types.CreateControlPolicyMappingPayload, error) {
|
||||||
svc := GetTenantService(ctx, r.proboSvc, input.PolicyID.TenantID())
|
svc := GetTenantService(ctx, r.proboSvc, input.PolicyID.TenantID())
|
||||||
|
|
||||||
err := svc.Controls.CreatePolicyMapping(ctx, input.ControlID, input.PolicyID)
|
control, policy, err := svc.Controls.CreatePolicyMapping(ctx, input.ControlID, input.PolicyID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot create control policy mapping: %w", err))
|
panic(fmt.Errorf("cannot create control policy mapping: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.CreateControlPolicyMappingPayload{
|
return &types.CreateControlPolicyMappingPayload{
|
||||||
Success: true,
|
ControlEdge: types.NewControlEdge(control, coredata.ControlOrderFieldCreatedAt),
|
||||||
|
PolicyEdge: types.NewPolicyEdge(policy, coredata.PolicyOrderFieldTitle),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -737,13 +739,14 @@ func (r *mutationResolver) CreateControlPolicyMapping(ctx context.Context, input
|
|||||||
func (r *mutationResolver) DeleteControlMeasureMapping(ctx context.Context, input types.DeleteControlMeasureMappingInput) (*types.DeleteControlMeasureMappingPayload, error) {
|
func (r *mutationResolver) DeleteControlMeasureMapping(ctx context.Context, input types.DeleteControlMeasureMappingInput) (*types.DeleteControlMeasureMappingPayload, error) {
|
||||||
svc := GetTenantService(ctx, r.proboSvc, input.MeasureID.TenantID())
|
svc := GetTenantService(ctx, r.proboSvc, input.MeasureID.TenantID())
|
||||||
|
|
||||||
err := svc.Controls.DeleteMeasureMapping(ctx, input.ControlID, input.MeasureID)
|
control, measure, err := svc.Controls.DeleteMeasureMapping(ctx, input.ControlID, input.MeasureID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot delete control measure mapping: %w", err))
|
panic(fmt.Errorf("cannot delete control measure mapping: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.DeleteControlMeasureMappingPayload{
|
return &types.DeleteControlMeasureMappingPayload{
|
||||||
Success: true,
|
DeletedControlID: control.ID,
|
||||||
|
DeletedMeasureID: measure.ID,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -751,13 +754,14 @@ func (r *mutationResolver) DeleteControlMeasureMapping(ctx context.Context, inpu
|
|||||||
func (r *mutationResolver) DeleteControlPolicyMapping(ctx context.Context, input types.DeleteControlPolicyMappingInput) (*types.DeleteControlPolicyMappingPayload, error) {
|
func (r *mutationResolver) DeleteControlPolicyMapping(ctx context.Context, input types.DeleteControlPolicyMappingInput) (*types.DeleteControlPolicyMappingPayload, error) {
|
||||||
svc := GetTenantService(ctx, r.proboSvc, input.PolicyID.TenantID())
|
svc := GetTenantService(ctx, r.proboSvc, input.PolicyID.TenantID())
|
||||||
|
|
||||||
err := svc.Controls.DeletePolicyMapping(ctx, input.ControlID, input.PolicyID)
|
control, policy, err := svc.Controls.DeletePolicyMapping(ctx, input.ControlID, input.PolicyID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot delete control policy mapping: %w", err))
|
panic(fmt.Errorf("cannot delete control policy mapping: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.DeleteControlPolicyMappingPayload{
|
return &types.DeleteControlPolicyMappingPayload{
|
||||||
Success: true,
|
DeletedControlID: control.ID,
|
||||||
|
DeletedPolicyID: policy.ID,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user