MCPcopy Create free account
hub / github.com/devfullcycle/goexpert / CreateCourse

Method CreateCourse

13-GraphQL/graph/schema.resolvers.go:57–67  ·  view source on GitHub ↗

CreateCourse is the resolver for the createCourse field.

(ctx context.Context, input model.NewCourse)

Source from the content-addressed store, hash-verified

55
56// CreateCourse is the resolver for the createCourse field.
57func (r *mutationResolver) CreateCourse(ctx context.Context, input model.NewCourse) (*model.Course, error) {
58 course, err := r.CourseDB.Create(input.Name, *input.Description, input.CategoryID)
59 if err != nil {
60 return nil, err
61 }
62 return &model.Course{
63 ID: course.ID,
64 Name: course.Name,
65 Description: &course.Description,
66 }, nil
67}
68
69// Categories is the resolver for the categories field.
70func (r *queryResolver) Categories(ctx context.Context) ([]*model.Category, error) {

Callers

nothing calls this directly

Calls 1

CreateMethod · 0.65

Tested by

no test coverage detected