MCPcopy Create free account
hub / github.com/dagger/dagger / FuncWithDynamicInputs

Function FuncWithDynamicInputs

dagql/objects.go:750–758  ·  view source on GitHub ↗

FuncWithDynamicInputs is like Func but lets a resolver customize request/cache behavior for each call (for example argument rewrites, TTL, do-not-cache, or concurrency key).

(
	name string,
	fn FuncHandler[T, A, R],
	cacheFn DynamicInputFunc[T, A],
)

Source from the content-addressed store, hash-verified

748// behavior for each call (for example argument rewrites, TTL, do-not-cache, or
749// concurrency key).
750func FuncWithDynamicInputs[T Typed, A any, R any](
751 name string,
752 fn FuncHandler[T, A, R],
753 cacheFn DynamicInputFunc[T, A],
754) Field[T] {
755 return NodeFuncWithDynamicInputs(name, func(ctx context.Context, self ObjectResult[T], args A) (R, error) {
756 return fn(ctx, self.Self(), args)
757 }, cacheFn)
758}
759
760// NodeFunc is the same as Func, except it passes the ObjectResult instead of the
761// receiver so that you can access its ID.

Callers 2

InstallMethod · 0.92
FuncFunction · 0.85

Calls 2

SelfMethod · 0.80

Tested by

no test coverage detected