View Source Dagger.Function (dagger v0.8.8)
Function represents a resolver provided by a Module.
A function always evaluates against a parent object and is given a set of named arguments.
Link to this section Summary
Functions
Arguments accepted by this function, if any
Execute this function using dynamic input+output types.
A doc string for the function, if any
The ID of the function
The name of the function
The type returned by this function
Returns the function with the provided argument
Returns the function with the doc string
Link to this section Types
Link to this section Functions
@spec args(t()) :: {:ok, [Dagger.FunctionArg.t()] | nil} | {:error, term()}
Arguments accepted by this function, if any
@spec call( t(), keyword() ) :: {:ok, Dagger.JSON.t()} | {:error, term()}
Execute this function using dynamic input+output types.
Typically, it's preferable to invoke a function using a type safe graphql query rather than using this call field. However, call is useful for some advanced use cases where dynamically loading arbitrary modules and invoking functions in them is required.
optional-arguments
Optional Arguments
input
-
@spec description(t()) :: {:ok, Dagger.String.t() | nil} | {:error, term()}
A doc string for the function, if any
@spec id(t()) :: {:ok, Dagger.FunctionID.t()} | {:error, term()}
The ID of the function
@spec name(t()) :: {:ok, Dagger.String.t()} | {:error, term()}
The name of the function
@spec return_type(t()) :: Dagger.TypeDef.t()
The type returned by this function
@spec with_arg(t(), Dagger.String.t(), Dagger.TypeDef.t(), keyword()) :: t()
Returns the function with the provided argument
required-arguments
Required Arguments
name
- The name of the argumenttype_def
- The type of the argument
optional-arguments
Optional Arguments
description
- A doc string for the argument, if anydefault_value
- A default value to use for this argument if not explicitly set by the caller, if any
@spec with_description(t(), Dagger.String.t()) :: t()
Returns the function with the doc string
required-arguments
Required Arguments
description
-