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

Method ConvertToSDKInput

core/schema/coremod.go:906–920  ·  view source on GitHub ↗
(ctx context.Context, value dagql.Typed)

Source from the content-addressed store, hash-verified

904}
905
906func (enum *CoreModEnum) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error) {
907 var input any = value
908 if enum, ok := value.(*core.ModuleEnum); ok {
909 input = enum.Name
910 }
911 state, err := enum.coreMod.viewState(ctx)
912 if err != nil {
913 return nil, err
914 }
915 s, ok := state.server.ScalarType(enum.typeDef.Name)
916 if !ok {
917 return nil, fmt.Errorf("CoreModEnum.ConvertToSDKInput: found no enum type")
918 }
919 return s.DecodeInput(input)
920}
921
922func (enum *CoreModEnum) CollectContent(ctx context.Context, value dagql.AnyResult, content *core.CollectedContent) error {
923 if value == nil {

Callers

nothing calls this directly

Calls 3

ScalarTypeMethod · 0.65
DecodeInputMethod · 0.65
viewStateMethod · 0.45

Tested by

no test coverage detected