Skip to main content

Dagger NodeJS SDK

api/client.gen.Function_

Function represents a resolver provided by a Module.

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

Hierarchy

  • BaseClient

    Function_

Constructors

constructor

new Function_(parent?, _id?, _description?, _name?): Function_

Constructor is used for internal usage only, do not create object from it.

Parameters

NameType
parent?Object
parent.ctxContext
parent.queryTree?QueryTree[]
_id?FunctionID
_description?string
_name?string

Returns

Function_

Overrides

BaseClient.constructor

Properties

_description

Private Optional Readonly _description: string = undefined


_id

Private Optional Readonly _id: FunctionID = undefined


_name

Private Optional Readonly _name: string = undefined

Methods

args

args(): Promise<FunctionArg[]>

Arguments accepted by the function, if any.

Returns

Promise<FunctionArg[]>


description

description(): Promise<string>

A doc string for the function, if any.

Returns

Promise<string>


id

id(): Promise<FunctionID>

A unique identifier for this Function.

Returns

Promise<FunctionID>


name

name(): Promise<string>

The name of the function.

Returns

Promise<string>


returnType

returnType(): TypeDef

The type returned by the function.

Returns

TypeDef


with

with(arg): Function_

Call the provided function with current Function.

This is useful for reusability and readability by not breaking the calling chain.

Parameters

NameType
arg(param: Function_) => Function_

Returns

Function_


withArg

withArg(name, typeDef, opts?): Function_

Returns the function with the provided argument

Parameters

NameTypeDescription
namestringThe name of the argument
typeDefTypeDefThe type of the argument
opts?FunctionWithArgOpts-

Returns

Function_


withDescription

withDescription(description): Function_

Returns the function with the given doc string.

Parameters

NameTypeDescription
descriptionstringThe doc string to set.

Returns

Function_