(ctx context.Context, env dagql.ObjectResult[*core.Env], _ struct{})
| 281 | } |
| 282 | |
| 283 | func (s environmentSchema) withCurrentModule(ctx context.Context, env dagql.ObjectResult[*core.Env], _ struct{}) (res dagql.ObjectResult[*core.Env], _ error) { |
| 284 | query, err := core.CurrentQuery(ctx) |
| 285 | if err != nil { |
| 286 | return res, fmt.Errorf("failed to get current query: %w", err) |
| 287 | } |
| 288 | mod, err := query.CurrentModule(ctx) |
| 289 | if err != nil { |
| 290 | return res, fmt.Errorf("failed to get current module: %w", err) |
| 291 | } |
| 292 | modID, err := mod.ID() |
| 293 | if err != nil { |
| 294 | return res, fmt.Errorf("get current module ID: %w", err) |
| 295 | } |
| 296 | srv, err := core.CurrentDagqlServer(ctx) |
| 297 | if err != nil { |
| 298 | return res, fmt.Errorf("failed to get current dagql server: %w", err) |
| 299 | } |
| 300 | err = srv.Select(ctx, env, &res, dagql.Selector{ |
| 301 | Field: "withModule", |
| 302 | Args: []dagql.NamedInput{ |
| 303 | { |
| 304 | Name: "module", |
| 305 | Value: dagql.NewID[*core.Module](modID), |
| 306 | }, |
| 307 | }, |
| 308 | }) |
| 309 | if err != nil { |
| 310 | return res, fmt.Errorf("failed to install current module: %w", err) |
| 311 | } |
| 312 | return res, nil |
| 313 | } |
| 314 | |
| 315 | func (s environmentSchema) withStringInput(ctx context.Context, env *core.Env, args struct { |
| 316 | Name string |
nothing calls this directly
no test coverage detected