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

Method _Course_id

13-GraphQL/graph/generated/generated.go:575–604  ·  view source on GitHub ↗
(ctx context.Context, field graphql.CollectedField, obj *model.Course)

Source from the content-addressed store, hash-verified

573}
574
575func (ec *executionContext) _Course_id(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) {
576 fc, err := ec.fieldContext_Course_id(ctx, field)
577 if err != nil {
578 return graphql.Null
579 }
580 ctx = graphql.WithFieldContext(ctx, fc)
581 defer func() {
582 if r := recover(); r != nil {
583 ec.Error(ctx, ec.Recover(ctx, r))
584 ret = graphql.Null
585 }
586 }()
587 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
588 ctx = rctx // use context from middleware stack in children
589 return obj.ID, nil
590 })
591 if err != nil {
592 ec.Error(ctx, err)
593 return graphql.Null
594 }
595 if resTmp == nil {
596 if !graphql.HasFieldError(ctx, fc) {
597 ec.Errorf(ctx, "must not be null")
598 }
599 return graphql.Null
600 }
601 res := resTmp.(string)
602 fc.Result = res
603 return ec.marshalNID2string(ctx, field.Selections, res)
604}
605
606func (ec *executionContext) fieldContext_Course_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
607 fc = &graphql.FieldContext{

Callers 1

_CourseMethod · 0.95

Calls 2

marshalNID2stringMethod · 0.95

Tested by

no test coverage detected