From 53c326d354357b96966c8a46ae3942eae2c0f70a Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Sun, 20 Apr 2025 21:23:18 -0700 Subject: [PATCH] Remove unused types Signed-off-by: Bryan Frimin --- pkg/server/api/console/v1/schema.graphql | 10 -- pkg/server/api/console/v1/schema/schema.go | 146 --------------------- pkg/server/api/console/v1/types/types.go | 10 -- 3 files changed, 166 deletions(-) diff --git a/pkg/server/api/console/v1/schema.graphql b/pkg/server/api/console/v1/schema.graphql index 757418102..dc01cd319 100644 --- a/pkg/server/api/console/v1/schema.graphql +++ b/pkg/server/api/console/v1/schema.graphql @@ -1258,12 +1258,6 @@ input RemoveUserInput { userId: ID! } -input InitiateConnectorInput { - organizationId: ID! - connectorId: String! - continueUrl: String! -} - # Payload Types type CreateOrganizationPayload { organizationEdge: OrganizationEdge! @@ -1440,7 +1434,3 @@ type InviteUserPayload { type RemoveUserPayload { success: Boolean! } - -type InitiateConnectorPayload { - redirectUrl: String! -} diff --git a/pkg/server/api/console/v1/schema/schema.go b/pkg/server/api/console/v1/schema/schema.go index 0e079d2c3..e18d2fc6c 100644 --- a/pkg/server/api/console/v1/schema/schema.go +++ b/pkg/server/api/console/v1/schema/schema.go @@ -267,10 +267,6 @@ type ComplexityRoot struct { MesureEdges func(childComplexity int) int } - InitiateConnectorPayload struct { - RedirectURL func(childComplexity int) int - } - InviteUserPayload struct { Success func(childComplexity int) int } @@ -1291,13 +1287,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ImportMesurePayload.MesureEdges(childComplexity), true - case "InitiateConnectorPayload.redirectUrl": - if e.complexity.InitiateConnectorPayload.RedirectURL == nil { - break - } - - return e.complexity.InitiateConnectorPayload.RedirectURL(childComplexity), true - case "InviteUserPayload.success": if e.complexity.InviteUserPayload.Success == nil { break @@ -3105,7 +3094,6 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputFulfillEvidenceInput, ec.unmarshalInputImportFrameworkInput, ec.unmarshalInputImportMesureInput, - ec.unmarshalInputInitiateConnectorInput, ec.unmarshalInputInviteUserInput, ec.unmarshalInputMesureOrder, ec.unmarshalInputOrganizationOrder, @@ -4485,12 +4473,6 @@ input RemoveUserInput { userId: ID! } -input InitiateConnectorInput { - organizationId: ID! - connectorId: String! - continueUrl: String! -} - # Payload Types type CreateOrganizationPayload { organizationEdge: OrganizationEdge! @@ -4667,10 +4649,6 @@ type InviteUserPayload { type RemoveUserPayload { success: Boolean! } - -type InitiateConnectorPayload { - redirectUrl: String! -} `, BuiltIn: false}, } var parsedSchema = gqlparser.MustLoadSchema(sources...) @@ -11489,50 +11467,6 @@ func (ec *executionContext) fieldContext_ImportMesurePayload_mesureEdges(_ conte return fc, nil } -func (ec *executionContext) _InitiateConnectorPayload_redirectUrl(ctx context.Context, field graphql.CollectedField, obj *types.InitiateConnectorPayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InitiateConnectorPayload_redirectUrl(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.RedirectURL, 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.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_InitiateConnectorPayload_redirectUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "InitiateConnectorPayload", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - func (ec *executionContext) _InviteUserPayload_success(ctx context.Context, field graphql.CollectedField, obj *types.InviteUserPayload) (ret graphql.Marshaler) { fc, err := ec.fieldContext_InviteUserPayload_success(ctx, field) if err != nil { @@ -25830,47 +25764,6 @@ func (ec *executionContext) unmarshalInputImportMesureInput(ctx context.Context, return it, nil } -func (ec *executionContext) unmarshalInputInitiateConnectorInput(ctx context.Context, obj any) (types.InitiateConnectorInput, error) { - var it types.InitiateConnectorInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"organizationId", "connectorId", "continueUrl"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "organizationId": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationId")) - data, err := ec.unmarshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v) - if err != nil { - return it, err - } - it.OrganizationID = data - case "connectorId": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorId")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.ConnectorID = data - case "continueUrl": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("continueUrl")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.ContinueURL = data - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputInviteUserInput(ctx context.Context, obj any) (types.InviteUserInput, error) { var it types.InviteUserInput asMap := map[string]any{} @@ -29028,45 +28921,6 @@ func (ec *executionContext) _ImportMesurePayload(ctx context.Context, sel ast.Se return out } -var initiateConnectorPayloadImplementors = []string{"InitiateConnectorPayload"} - -func (ec *executionContext) _InitiateConnectorPayload(ctx context.Context, sel ast.SelectionSet, obj *types.InitiateConnectorPayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, initiateConnectorPayloadImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("InitiateConnectorPayload") - case "redirectUrl": - out.Values[i] = ec._InitiateConnectorPayload_redirectUrl(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - var inviteUserPayloadImplementors = []string{"InviteUserPayload"} func (ec *executionContext) _InviteUserPayload(ctx context.Context, sel ast.SelectionSet, obj *types.InviteUserPayload) graphql.Marshaler { diff --git a/pkg/server/api/console/v1/types/types.go b/pkg/server/api/console/v1/types/types.go index de209363f..6540d6556 100644 --- a/pkg/server/api/console/v1/types/types.go +++ b/pkg/server/api/console/v1/types/types.go @@ -433,16 +433,6 @@ type ImportMesurePayload struct { MesureEdges []*MesureEdge `json:"mesureEdges"` } -type InitiateConnectorInput struct { - OrganizationID gid.GID `json:"organizationId"` - ConnectorID string `json:"connectorId"` - ContinueURL string `json:"continueUrl"` -} - -type InitiateConnectorPayload struct { - RedirectURL string `json:"redirectUrl"` -} - type InviteUserInput struct { OrganizationID gid.GID `json:"organizationId"` Email string `json:"email"`