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

Method _Model_id

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

Source from the content-addressed store, hash-verified

1371}
1372
1373func (ec *executionContext) _Model_id(ctx context.Context, field graphql.CollectedField, obj *model.Model) (ret graphql.Marshaler) {
1374 fc, err := ec.fieldContext_Model_id(ctx, field)
1375 if err != nil {
1376 return graphql.Null
1377 }
1378 ctx = graphql.WithFieldContext(ctx, fc)
1379 defer func() {
1380 if r := recover(); r != nil {
1381 ec.Error(ctx, ec.Recover(ctx, r))
1382 ret = graphql.Null
1383 }
1384 }()
1385 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
1386 ctx = rctx // use context from middleware stack in children
1387 return obj.ID, nil
1388 })
1389 if err != nil {
1390 ec.Error(ctx, err)
1391 return graphql.Null
1392 }
1393 if resTmp == nil {
1394 if !graphql.HasFieldError(ctx, fc) {
1395 ec.Errorf(ctx, "must not be null")
1396 }
1397 return graphql.Null
1398 }
1399 res := resTmp.(string)
1400 fc.Result = res
1401 return ec.marshalNID2string(ctx, field.Selections, res)
1402}
1403
1404func (ec *executionContext) fieldContext_Model_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
1405 fc = &graphql.FieldContext{

Callers 1

_ModelMethod · 0.95

Calls 2

fieldContext_Model_idMethod · 0.95
marshalNID2stringMethod · 0.95

Tested by

no test coverage detected