...

Source file src/edge-infra.dev/pkg/edge/api/graph/resolver/log_classification_queries.resolvers.go

Documentation: edge-infra.dev/pkg/edge/api/graph/resolver

     1  package resolver
     2  
     3  // This file will be automatically regenerated based on the schema, any resolver implementations
     4  // will be copied through when generating and any unknown code will be moved to the end.
     5  // Code generated by github.com/99designs/gqlgen version v0.17.45
     6  
     7  import (
     8  	"context"
     9  	"fmt"
    10  
    11  	"edge-infra.dev/pkg/edge/api/graph/model"
    12  )
    13  
    14  // DeleteLogClassification is the resolver for the deleteLogClassification field.
    15  func (r *mutationResolver) DeleteLogClassification(ctx context.Context, bannerEdgeID string, logClassificationEdgeID string) (bool, error) {
    16  	wasDeleted, err := r.LogClassificationService.DeleteLogClassification(ctx, bannerEdgeID, logClassificationEdgeID)
    17  	if err != nil {
    18  		return false, fmt.Errorf("Error Deleting Log Classification: %s", err.Error())
    19  	}
    20  
    21  	return wasDeleted, nil
    22  }
    23  
    24  // CreateLogClassification is the resolver for the createLogClassification field.
    25  func (r *mutationResolver) CreateLogClassification(ctx context.Context, bannerEdgeID string, createClassificationInput model.CreateClassificationInput) (*model.LogClassification, error) {
    26  	logClassification, err := r.LogClassificationService.CreateLogClassification(ctx, bannerEdgeID, "", createClassificationInput)
    27  	if err != nil {
    28  		return nil, fmt.Errorf("Error Creating Log Classification: %s", err.Error())
    29  	}
    30  
    31  	return logClassification, nil
    32  }
    33  
    34  // UpdateLogClassification is the resolver for the updateLogClassification field.
    35  func (r *mutationResolver) UpdateLogClassification(ctx context.Context, bannerEdgeID string, logClassificationEdgeID string, updateClassificationInput model.UpdateClassificationInput) (*model.LogClassification, error) {
    36  	logClassification, err := r.LogClassificationService.UpdateLogClassification(ctx, bannerEdgeID, logClassificationEdgeID, &updateClassificationInput)
    37  	if err != nil {
    38  		return nil, fmt.Errorf("Error Updating Log Classification: %s", err.Error())
    39  	}
    40  
    41  	return logClassification, nil
    42  }
    43  
    44  // GetLogClassification is the resolver for the getLogClassification field.
    45  func (r *queryResolver) GetLogClassification(ctx context.Context, bannerEdgeID string, logClassificationEdgeID string) (*model.LogClassification, error) {
    46  	logClassification, err := r.LogClassificationService.GetLogClassification(ctx, bannerEdgeID, logClassificationEdgeID)
    47  	if err != nil {
    48  		return nil, fmt.Errorf("Error Getting Log Classification: %s", err.Error())
    49  	}
    50  
    51  	return logClassification, nil
    52  }
    53  
    54  // GetLogClassificationsByBanner is the resolver for the getLogClassificationsByBanner field.
    55  func (r *queryResolver) GetLogClassificationsByBanner(ctx context.Context, bannerEdgeID string) ([]*model.LogClassification, error) {
    56  	logClassifications, err := r.LogClassificationService.GetLogClassificationsByBanner(ctx, bannerEdgeID)
    57  	if err != nil {
    58  		return nil, fmt.Errorf("Error Getting Log Classifications From Banner: %s", err.Error())
    59  	}
    60  
    61  	return logClassifications, nil
    62  }
    63  

View as plain text