(ctx context.Context, value any)
| 884 | var _ core.ModType = (*CoreModEnum)(nil) |
| 885 | |
| 886 | func (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 | |
| 906 | func (enum *CoreModEnum) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error) { |
| 907 | var input any = value |
nothing calls this directly
no test coverage detected