(dag *dagql.Server)
| 62 | var _ SchemaResolvers = &moduleSourceSchema{} |
| 63 | |
| 64 | func (s *moduleSourceSchema) Install(dag *dagql.Server) { |
| 65 | dagql.Fields[*core.Query]{ |
| 66 | dagql.NodeFunc("moduleSource", s.moduleSource). |
| 67 | WithInput(dagql.PerClientInput). |
| 68 | Doc(`Create a new module source instance from a source ref string`). |
| 69 | Args( |
| 70 | dagql.Arg("refString").Doc(`The string ref representation of the module source`), |
| 71 | dagql.Arg("refPin").Doc(`The pinned version of the module source`), |
| 72 | dagql.Arg("disableFindUp").Doc(`If true, do not attempt to find dagger.json in a parent directory of the provided path. Only relevant for local module sources.`), |
| 73 | dagql.Arg("allowNotExists").Doc(`If true, do not error out if the provided ref string is a local path and does not exist yet. Useful when initializing new modules in directories that don't exist yet.`), |
| 74 | dagql.Arg("requireKind").Doc(`If set, error out if the ref string is not of the provided requireKind.`), |
| 75 | ), |
| 76 | }.Install(dag) |
| 77 | |
| 78 | dagql.Fields[*core.Directory]{ |
| 79 | dagql.NodeFunc("asModule", s.directoryAsModule). |
| 80 | Doc(`Load the directory as a Dagger module source`). |
| 81 | Args( |
| 82 | dagql.Arg("sourceRootPath").Doc( |
| 83 | `An optional subpath of the directory which contains the module's configuration file.`, |
| 84 | `If not set, the module source code is loaded from the root of the directory.`), |
| 85 | ), |
| 86 | dagql.NodeFunc("asModuleSource", s.directoryAsModuleSource). |
| 87 | Doc(`Load the directory as a Dagger module source`). |
| 88 | Args( |
| 89 | dagql.Arg("sourceRootPath").Doc( |
| 90 | `An optional subpath of the directory which contains the module's configuration file.`, |
| 91 | `If not set, the module source code is loaded from the root of the directory.`), |
| 92 | ), |
| 93 | }.Install(dag) |
| 94 | |
| 95 | dagql.Fields[*core.ModuleSource]{ |
| 96 | // sync is used by external dependencies like daggerverse |
| 97 | Syncer[*core.ModuleSource](). |
| 98 | Doc(`Forces evaluation of the module source, including any loading into the engine and associated validation.`), |
| 99 | |
| 100 | dagql.Func("sourceSubpath", s.moduleSourceSubpath). |
| 101 | Doc(`The path to the directory containing the module's source code, relative to the context directory.`), |
| 102 | |
| 103 | dagql.Func("originalSubpath", s.moduleSourceOriginalSubpath). |
| 104 | Doc(`The original subpath used when instantiating this module source, relative to the context directory.`), |
| 105 | |
| 106 | dagql.Func("digest", s.moduleSourceDigest). |
| 107 | Doc(`A content-hash of the module source. Module sources with the same digest will output the same generated context and convert into the same module instance.`), |
| 108 | |
| 109 | // NOTE: if/when this turns public, think about a less confusing and future proof name: `includes`, `includePaths`, `includePatterns` |
| 110 | // which would be relative to the context directory, while the same suggestions with an `original` prefix could mean the `Include` field |
| 111 | // as it was in the dagger.json. |
| 112 | dagql.Func("_rebasedIncludePaths", s.moduleSourceRebasedIncludePaths). |
| 113 | Doc(`List of include paths from dagger.json, relative to the context directory.`), |
| 114 | |
| 115 | dagql.Func("withSourceSubpath", s.moduleSourceWithSourceSubpath). |
| 116 | WithInput(dagql.PerClientInput). |
| 117 | Doc(`Update the module source with a new source subpath.`). |
| 118 | Args( |
| 119 | dagql.Arg("path").Doc(`The path to set as the source subpath. Must be relative to the module source's source root directory.`), |
| 120 | ), |
| 121 |
nothing calls this directly
no test coverage detected