Skip to main content

Function

API reference

Function represents a resolver provided by a Module.

A function always evaluates against a parent object and is given a set of named arguments.

Implements Node

deprecated
The reason this function is deprecated, if any.
description
A doc string for the function, if any.
id
A unique identifier for this Function.
name
The name of the function.
sourceModuleName
If this function is provided by a module, the name of the module. Unset otherwise.
args
Arguments accepted by the function, if any.
returnType
The type returned by the function.
sourceMap
The location of this function declaration.
withArg
Returns the function with the provided argument
withCachePolicy
Returns the function updated to use the provided cache policy.
withCheck
Returns the function with a flag indicating it's a check.
withDeprecated
Returns the function with the provided deprecation reason.
withDescription
Returns the function with the given doc string.
withGenerator
Returns the function with a flag indicating it's a generator.
withSourceMap
Returns the function with the given source map.
withUp
Returns the function with a flag indicating it returns a service for dagger up.

deprecated: String

The reason this function is deprecated, if any.

description: String!

A doc string for the function, if any.

id: ID!

A unique identifier for this Function.

name: String!

The name of the function.

sourceModuleName: String!

If this function is provided by a module, the name of the module. Unset otherwise.

args: [FunctionArg!]!

Arguments accepted by the function, if any.

returnType: TypeDef!

The type returned by the function.

sourceMap: SourceMap

The location of this function declaration.

withArg(name: String!,typeDef: TypeDef!,description: String = "",defaultValue: JSON,defaultPath: String = "",ignore: [String!] = [],sourceMap: SourceMap,deprecated: String,defaultAddress: String = ""): Function!

Returns the function with the provided argument

name: String!

The name of the argument

typeDef: TypeDef!

The type of the argument

description: String = ""

A doc string for the argument, if any

defaultValue: JSON

A default value to use for this argument if not explicitly set by the caller, if any

defaultPath: String = ""

If the argument is a Directory or File type, default to load path from context directory, relative to root directory.

ignore: [String!] = []

Patterns to ignore when loading the contextual argument value.

sourceMap: SourceMap

The source map for the argument definition.

deprecated: String

If deprecated, the reason or migration path.

defaultAddress: String = ""

withCachePolicy(policy: FunctionCachePolicy!, timeToLive: String): Function!

Returns the function updated to use the provided cache policy.

policy: FunctionCachePolicy!

The cache policy to use.

timeToLive: String

The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".

withCheck: Function!

Returns the function with a flag indicating it's a check.

withDeprecated(reason: String): Function!

Returns the function with the provided deprecation reason.

reason: String

Reason or migration path describing the deprecation.

withDescription(description: String!): Function!

Returns the function with the given doc string.

description: String!

The doc string to set.

withGenerator: Function!

Returns the function with a flag indicating it's a generator.

withSourceMap(sourceMap: SourceMap!): Function!

Returns the function with the given source map.

sourceMap: SourceMap!

The source map for the function definition.

withUp: Function!

Returns the function with a flag indicating it returns a service for dagger up.

References

Returned by

Accepted as an argument by