MCPcopy Create free account
hub / github.com/encoder-run/operator / _SearchResult_score

Method _SearchResult_score

pkg/graph/generated.go:4559–4588  ·  view source on GitHub ↗
(ctx context.Context, field graphql.CollectedField, obj *model.SearchResult)

Source from the content-addressed store, hash-verified

4557}
4558
4559func (ec *executionContext) _SearchResult_score(ctx context.Context, field graphql.CollectedField, obj *model.SearchResult) (ret graphql.Marshaler) {
4560 fc, err := ec.fieldContext_SearchResult_score(ctx, field)
4561 if err != nil {
4562 return graphql.Null
4563 }
4564 ctx = graphql.WithFieldContext(ctx, fc)
4565 defer func() {
4566 if r := recover(); r != nil {
4567 ec.Error(ctx, ec.Recover(ctx, r))
4568 ret = graphql.Null
4569 }
4570 }()
4571 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
4572 ctx = rctx // use context from middleware stack in children
4573 return obj.Score, nil
4574 })
4575 if err != nil {
4576 ec.Error(ctx, err)
4577 return graphql.Null
4578 }
4579 if resTmp == nil {
4580 if !graphql.HasFieldError(ctx, fc) {
4581 ec.Errorf(ctx, "must not be null")
4582 }
4583 return graphql.Null
4584 }
4585 res := resTmp.(float64)
4586 fc.Result = res
4587 return ec.marshalNFloat2float64(ctx, field.Selections, res)
4588}
4589
4590func (ec *executionContext) fieldContext_SearchResult_score(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
4591 fc = &graphql.FieldContext{

Callers 1

_SearchResultMethod · 0.95

Calls 2

marshalNFloat2float64Method · 0.95

Tested by

no test coverage detected