MCPcopy Create free account
hub / github.com/dagger/dagger / ConvertFromSDKResult

Method ConvertFromSDKResult

core/schema/coremod.go:886–904  ·  view source on GitHub ↗
(ctx context.Context, value any)

Source from the content-addressed store, hash-verified

884var _ core.ModType = (*CoreModEnum)(nil)
885
886func (enum *CoreModEnum) ConvertFromSDKResult(ctx context.Context, value any) (dagql.AnyResult, error) {
887 if enum, ok := value.(*core.ModuleEnum); ok {
888 value = enum.Name
889 }
890 state, err := enum.coreMod.viewState(ctx)
891 if err != nil {
892 return nil, err
893 }
894 s, ok := state.server.ScalarType(enum.typeDef.Name)
895 if !ok {
896 return nil, fmt.Errorf("CoreModEnum.ConvertFromSDKResult: found no enum type")
897 }
898
899 input, err := s.DecodeInput(value)
900 if err != nil {
901 return nil, fmt.Errorf("CoreModEnum.ConvertFromSDKResult: failed to decode input: %w", err)
902 }
903 return dagql.NewResultForCurrentCall(ctx, input)
904}
905
906func (enum *CoreModEnum) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error) {
907 var input any = value

Callers

nothing calls this directly

Calls 4

NewResultForCurrentCallFunction · 0.92
ScalarTypeMethod · 0.65
DecodeInputMethod · 0.65
viewStateMethod · 0.45

Tested by

no test coverage detected