( ctx context.Context, parent dagql.ObjectResult[*core.Query], args schemaJSONArgs, )
| 187 | } |
| 188 | |
| 189 | func (s *querySchema) schemaJSONFile( |
| 190 | ctx context.Context, |
| 191 | parent dagql.ObjectResult[*core.Query], |
| 192 | args schemaJSONArgs, |
| 193 | ) (inst dagql.ObjectResult[*core.File], rerr error) { |
| 194 | const schemaJSONFilename = "schema.json" |
| 195 | const perm fs.FileMode = 0644 |
| 196 | |
| 197 | dag, err := core.CurrentDagqlServer(ctx) |
| 198 | if err != nil { |
| 199 | return inst, err |
| 200 | } |
| 201 | |
| 202 | moduleSchemaJSON, err := getSchemaJSON(args.HiddenTypes, dag.View, dag) |
| 203 | if err != nil { |
| 204 | return inst, err |
| 205 | } |
| 206 | |
| 207 | var dirInst dagql.ObjectResult[*core.Directory] |
| 208 | if err := dag.Select(ctx, dag.Root(), &dirInst, dagql.Selector{Field: "directory"}); err != nil { |
| 209 | return inst, err |
| 210 | } |
| 211 | |
| 212 | file := &core.File{ |
| 213 | Platform: parent.Self().Platform(), |
| 214 | File: new(core.LazyAccessor[string, *core.File]), |
| 215 | Snapshot: new(core.LazyAccessor[bkcache.ImmutableRef, *core.File]), |
| 216 | } |
| 217 | |
| 218 | if err := file.WithContents(ctx, dirInst, schemaJSONFilename, moduleSchemaJSON, perm, nil); err != nil { |
| 219 | return inst, err |
| 220 | } |
| 221 | |
| 222 | return dagql.NewObjectResultForCurrentCall(ctx, dag, file) |
| 223 | } |
nothing calls this directly
no test coverage detected