dagger/dsl/module

Types

pub type Opts {
  Opts(
    include: option.Option(List(String)),
    include_dependencies: option.Option(Bool),
  )
}

Constructors

Values

pub fn check(
  parent: types.Module,
  name name: String,
) -> types.Check

Return the check defined by the module with the given name. Must match to exactly one check.

pub fn checks(
  parent: types.Module,
  with with_fn: fn(Opts) -> Opts,
) -> types.CheckGroup

Return all checks defined by the module

pub fn dependencies(
  parent: types.Module,
  select select: fn(types.Module) -> List(types.Field),
  client client: types.Client,
  then handler: fn(Result(List(types.Module), types.QueryError)) -> a,
) -> a

The dependencies of the module.

pub fn description(
  parent: types.Module,
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

The doc string of the module, if any

pub fn enums(
  parent: types.Module,
  select select: fn(types.TypeDef) -> List(types.Field),
  client client: types.Client,
  then handler: fn(Result(List(types.TypeDef), types.QueryError)) -> a,
) -> a

Enumerations served by this module.

pub fn generated_context_directory(
  parent: types.Module,
) -> types.Directory

The generated files and directories made on top of the module source’s context directory.

pub fn generator(
  parent: types.Module,
  name name: String,
) -> types.Generator

Return the generator defined by the module with the given name. Must match to exactly one generator.

pub fn generators(
  parent: types.Module,
  with with_fn: fn(Opts) -> Opts,
) -> types.GeneratorGroup

Return all generators defined by the module

pub fn id(parent: types.Module) -> types.Module

A unique identifier for this Module.

pub fn include(opts: Opts, val: List(String)) -> Opts
pub fn include_dependencies(opts: Opts, val: Bool) -> Opts
pub fn interfaces(
  parent: types.Module,
  select select: fn(types.TypeDef) -> List(types.Field),
  client client: types.Client,
  then handler: fn(Result(List(types.TypeDef), types.QueryError)) -> a,
) -> a

Interfaces served by this module.

pub fn introspection_schema_j_s_o_n(
  parent: types.Module,
) -> types.File

The introspection schema JSON file for this module. This file represents the schema visible to the module’s source code, including all core types and those from the dependencies. Note: this is in the context of a module, so some core types may be hidden.

pub fn module(id id: types.Module) -> types.Module
pub fn name(
  parent: types.Module,
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

The name of the module

pub fn none(opts: Opts) -> Opts
pub fn objects(
  parent: types.Module,
  select select: fn(types.TypeDef) -> List(types.Field),
  client client: types.Client,
  then handler: fn(Result(List(types.TypeDef), types.QueryError)) -> a,
) -> a

Objects served by this module.

pub fn runtime(parent: types.Module) -> types.Container

The container that runs the module’s entrypoint. It will fail to execute if the module doesn’t compile.

pub fn sdk(parent: types.Module) -> types.SDKConfig

The SDK config used by this module.

pub fn serve(
  parent: types.Module,
  with with_fn: fn(Opts) -> Opts,
  client client: types.Client,
  then handler: fn(Result(Nil, types.QueryError)) -> a,
) -> a

Serve a module’s API in the current session. Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.

pub fn source(parent: types.Module) -> types.ModuleSource

The source for the module.

pub fn sync(parent: types.Module) -> types.Module

Forces evaluation of the module, including any loading into the engine and associated validation.

pub fn user_defaults(parent: types.Module) -> types.EnvFile

User-defined default values, loaded from local .env files.

pub fn with_description(
  parent: types.Module,
  description description: String,
) -> types.Module

Retrieves the module with the given description

pub fn with_enum(
  parent: types.Module,
  enum enum: types.TypeDef,
) -> types.Module

This module plus the given Enum type and associated values

pub fn with_interface(
  parent: types.Module,
  iface iface: types.TypeDef,
) -> types.Module

This module plus the given Interface type and associated functions

pub fn with_object(
  parent: types.Module,
  object object: types.TypeDef,
) -> types.Module

This module plus the given Object type and associated functions.

Search Document