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

Method _Query_getModel

pkg/graph/generated.go:3008–3037  ·  view source on GitHub ↗
(ctx context.Context, field graphql.CollectedField)

Source from the content-addressed store, hash-verified

3006}
3007
3008func (ec *executionContext) _Query_getModel(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
3009 fc, err := ec.fieldContext_Query_getModel(ctx, field)
3010 if err != nil {
3011 return graphql.Null
3012 }
3013 ctx = graphql.WithFieldContext(ctx, fc)
3014 defer func() {
3015 if r := recover(); r != nil {
3016 ec.Error(ctx, ec.Recover(ctx, r))
3017 ret = graphql.Null
3018 }
3019 }()
3020 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
3021 ctx = rctx // use context from middleware stack in children
3022 return ec.resolvers.Query().GetModel(rctx, fc.Args["id"].(string))
3023 })
3024 if err != nil {
3025 ec.Error(ctx, err)
3026 return graphql.Null
3027 }
3028 if resTmp == nil {
3029 if !graphql.HasFieldError(ctx, fc) {
3030 ec.Errorf(ctx, "must not be null")
3031 }
3032 return graphql.Null
3033 }
3034 res := resTmp.(*model.Model)
3035 fc.Result = res
3036 return ec.marshalNModel2ᚖgithubᚗcomᚋencoderᚑrunᚋoperatorᚋpkgᚋgraphᚋmodelᚐModel(ctx, field.Selections, res)
3037}
3038
3039func (ec *executionContext) fieldContext_Query_getModel(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
3040 fc = &graphql.FieldContext{

Callers 1

_QueryMethod · 0.95

Tested by

no test coverage detected