Dagger
Search

codegen

This module is an experiment in testing the viability of simplifying codegen implementations in Dagger SDKs using a module.

This is done by centralizing the GraphQL introspection, and pre-processing the data needed for templates as much as possible.

This lowers the barrier of entry for new SDKs, but also makes it a lot easier to maintain existing SDKs and keep them consistent with each other.

Installation

dagger install github.com/helderco/daggerverse/codegen@v0.1.3

Entrypoint

Return Type
Codegen
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
func (m *myModule) example() *Codegen  {
	return dag.
			Codegen()
}
@function
def example() -> dag.Codegen:
	return (
		dag.codegen()
	)
@func()
example(): Codegen {
	return dag
		.codegen()
}

Types

Codegen 🔗

Functions for API introspection to facilitate codegen

introspectionQuery() 🔗

Get the GraphQL query used to get type information

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspection-query
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Codegen().
			IntrospectionQuery(ctx)
}
@function
async def example() -> str:
	return await (
		dag.codegen()
		.introspection_query()
	)
@func()
async example(): Promise<string> {
	return dag
		.codegen()
		.introspectionQuery()
}

introspect() 🔗

Introspect the API to get the schema

The schema information is used to generate the client code.

Return Type
Schema !
Arguments
NameTypeDefault ValueDescription
fromJsonFile -A file with the result of the introspection query, in JSON format In runtime modules, the codegen function receives the contents of this file, which already filters out the runtime module itself from the results.
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect
func (m *myModule) example() *CodegenSchema  {
	return dag.
			Codegen().
			Introspect()
}
@function
def example() -> dag.CodegenSchema:
	return (
		dag.codegen()
		.introspect()
	)
@func()
example(): CodegenSchema {
	return dag
		.codegen()
		.introspect()
}

experimental() 🔗

Experimental alternative to the introspection query, using the TypeDef API

TypeDefs require more requests than the introspection query, and some types haven’t been implemented yet, but they may provide more context like the module name that implements an object type, for example.

Return Type
Experimental !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 experimental
func (m *myModule) example() *CodegenExperimental  {
	return dag.
			Codegen().
			Experimental()
}
@function
def example() -> dag.CodegenExperimental:
	return (
		dag.codegen()
		.experimental()
	)
@func()
example(): CodegenExperimental {
	return dag
		.codegen()
		.experimental()
}

Schema 🔗

Result of the introspection

types() 🔗

A list of all types supported by this server

Probably better to use the functions that return a list of specific types instead, to render them as groups for the client (tip: use following order: Scalars, Enums, Inputs and Objects).

Return Type
[Type ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 types
func (m *myModule) example() []*CodegenType  {
	return dag.
			Codegen().
			Introspect().
			Types()
}
@function
def example() -> List[dag.CodegenType]:
	return (
		dag.codegen()
		.introspect()
		.types()
	)
@func()
example(): CodegenType[] {
	return dag
		.codegen()
		.introspect()
		.types()
}

asJson() 🔗

Result of the introspection, in JSON format

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 as-json
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Codegen().
			Introspect().
			AsJson(ctx)
}
@function
async def example() -> str:
	return await (
		dag.codegen()
		.introspect()
		.as_json()
	)
@func()
async example(): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.asJson()
}

rootType() 🔗

Returns the root object type (Client)

In the API, this corresponds to the “Query” object type.

Return Type
Type !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 root-type
func (m *myModule) example() *CodegenType  {
	return dag.
			Codegen().
			Introspect().
			RootType()
}
@function
def example() -> dag.CodegenType:
	return (
		dag.codegen()
		.introspect()
		.root_type()
	)
@func()
example(): CodegenType {
	return dag
		.codegen()
		.introspect()
		.rootType()
}

getType() 🔗

Get a type by name

Return Type
Type !
Arguments
NameTypeDefault ValueDescription
nameString !-The name of the type
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string
func (m *myModule) example(name string) *CodegenType  {
	return dag.
			Codegen().
			Introspect().
			GetType(name)
}
@function
def example(name: str) -> dag.CodegenType:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
	)
@func()
example(name: string): CodegenType {
	return dag
		.codegen()
		.introspect()
		.getType(name)
}

scalars() 🔗

Get a list of all scalar types

Return Type
[Type ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 scalars
func (m *myModule) example() []*CodegenType  {
	return dag.
			Codegen().
			Introspect().
			Scalars()
}
@function
def example() -> List[dag.CodegenType]:
	return (
		dag.codegen()
		.introspect()
		.scalars()
	)
@func()
example(): CodegenType[] {
	return dag
		.codegen()
		.introspect()
		.scalars()
}

enums() 🔗

Get a list of all enum types

Return Type
[Type ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 enums
func (m *myModule) example() []*CodegenType  {
	return dag.
			Codegen().
			Introspect().
			Enums()
}
@function
def example() -> List[dag.CodegenType]:
	return (
		dag.codegen()
		.introspect()
		.enums()
	)
@func()
example(): CodegenType[] {
	return dag
		.codegen()
		.introspect()
		.enums()
}

inputs() 🔗

Get a list of all input object types

Return Type
[Type ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 inputs
func (m *myModule) example() []*CodegenType  {
	return dag.
			Codegen().
			Introspect().
			Inputs()
}
@function
def example() -> List[dag.CodegenType]:
	return (
		dag.codegen()
		.introspect()
		.inputs()
	)
@func()
example(): CodegenType[] {
	return dag
		.codegen()
		.introspect()
		.inputs()
}

objects() 🔗

Get a list of all object types

Return Type
[Type ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 objects
func (m *myModule) example() []*CodegenType  {
	return dag.
			Codegen().
			Introspect().
			Objects()
}
@function
def example() -> List[dag.CodegenType]:
	return (
		dag.codegen()
		.introspect()
		.objects()
	)
@func()
example(): CodegenType[] {
	return dag
		.codegen()
		.introspect()
		.objects()
}

Experimental 🔗

Experimental alternative to the introspection query, using the TypeDef API

objectNames() 🔗

Get the names of all object types in the API

Allows querying the API directly while filtering out the current module. It does take more requests, compared to the introspection query which takes a single request, or the introspection file which takes no requests. However when this module is consumed, there’s an exec to /runtime on every function call.

Return Type
[String ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 experimental \
 object-names
func (m *myModule) example(ctx context.Context) []string  {
	return dag.
			Codegen().
			Experimental().
			ObjectNames(ctx)
}
@function
async def example() -> List[str]:
	return await (
		dag.codegen()
		.experimental()
		.object_names()
	)
@func()
async example(): Promise<string[]> {
	return dag
		.codegen()
		.experimental()
		.objectNames()
}

inputNames() 🔗

Get the names of all input object types in the API

Only object types have an associated module name because input types (and others) are only used in the core API. Modules don’t expose either custom scalars, enums, or interfaces, for example.

Return Type
[String ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 experimental \
 input-names
func (m *myModule) example(ctx context.Context) []string  {
	return dag.
			Codegen().
			Experimental().
			InputNames(ctx)
}
@function
async def example() -> List[str]:
	return await (
		dag.codegen()
		.experimental()
		.input_names()
	)
@func()
async example(): Promise<string[]> {
	return dag
		.codegen()
		.experimental()
		.inputNames()
}

Type 🔗

A type in the API

kind() 🔗

The kind of type, e.g., object, input object, scalar, or enum.

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 kind
func (m *myModule) example(ctx context.Context, name string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			Kind(ctx)
}
@function
async def example(name: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.kind()
	)
@func()
async example(name: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.kind()
}

name() 🔗

The name of the type

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 name
func (m *myModule) example(ctx context.Context, name string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			Name(ctx)
}
@function
async def example(name: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.name()
	)
@func()
async example(name: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.name()
}

description() 🔗

The description of the type

Return Type
String 
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 description
func (m *myModule) example(ctx context.Context, name string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			Description(ctx)
}
@function
async def example(name: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.description()
	)
@func()
async example(name: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.description()
}

fields() 🔗

An object type’s fields

Return Type
[Field ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 fields
func (m *myModule) example(name string) []*CodegenField  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			Fields()
}
@function
def example(name: str) -> List[dag.CodegenField]:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.fields()
	)
@func()
example(name: string): CodegenField[] {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.fields()
}

inputFields() 🔗

An input object type’s fields

Return Type
[InputValue ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 input-fields
func (m *myModule) example(name string) []*CodegenInputValue  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			InputFields()
}
@function
def example(name: str) -> List[dag.CodegenInputValue]:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.input_fields()
	)
@func()
example(name: string): CodegenInputValue[] {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.inputFields()
}

enumValues() 🔗

An enum type’s values

Return Type
[EnumValue ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 enum-values
func (m *myModule) example(name string) []*CodegenEnumValue  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			EnumValues()
}
@function
def example(name: str) -> List[dag.CodegenEnumValue]:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.enum_values()
	)
@func()
example(name: string): CodegenEnumValue[] {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.enumValues()
}

isScalar() 🔗

Is the type a scalar?

Return Type
Boolean !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 is-scalar
func (m *myModule) example(ctx context.Context, name string) bool  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			IsScalar(ctx)
}
@function
async def example(name: str) -> bool:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.is_scalar()
	)
@func()
async example(name: string): Promise<boolean> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.isScalar()
}

isEnum() 🔗

Is the type an enum?

Return Type
Boolean !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 is-enum
func (m *myModule) example(ctx context.Context, name string) bool  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			IsEnum(ctx)
}
@function
async def example(name: str) -> bool:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.is_enum()
	)
@func()
async example(name: string): Promise<boolean> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.isEnum()
}

isObject() 🔗

Is the type an object?

Return Type
Boolean !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 is-object
func (m *myModule) example(ctx context.Context, name string) bool  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			IsObject(ctx)
}
@function
async def example(name: str) -> bool:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.is_object()
	)
@func()
async example(name: string): Promise<boolean> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.isObject()
}

isInputObject() 🔗

Is the type an input object?

Return Type
Boolean !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 is-input-object
func (m *myModule) example(ctx context.Context, name string) bool  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			IsInputObject(ctx)
}
@function
async def example(name: str) -> bool:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.is_input_object()
	)
@func()
async example(name: string): Promise<boolean> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.isInputObject()
}

isRoot() 🔗

Return Type
Boolean !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 is-root
func (m *myModule) example(ctx context.Context, name string) bool  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			IsRoot(ctx)
}
@function
async def example(name: str) -> bool:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.is_root()
	)
@func()
async example(name: string): Promise<boolean> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.isRoot()
}

getField() 🔗

Get an object type’s field by name

Return Type
Field !
Arguments
NameTypeDefault ValueDescription
nameString !-The name of the field
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string
func (m *myModule) example(name string, name1 string) *CodegenField  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1)
}
@function
def example(name: str, name1: str) -> dag.CodegenField:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
	)
@func()
example(name: string, name1: string): CodegenField {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
}

leafs() 🔗

Get an object type’s fields that return a leaf type

Return Type
[Field ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 leafs
func (m *myModule) example(name string) []*CodegenField  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			Leafs()
}
@function
def example(name: str) -> List[dag.CodegenField]:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.leafs()
	)
@func()
example(name: string): CodegenField[] {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.leafs()
}

Field 🔗

An object type's field

name() 🔗

The name of the field

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 name
func (m *myModule) example(ctx context.Context, name string, name1 string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			Name(ctx)
}
@function
async def example(name: str, name1: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.name()
	)
@func()
async example(name: string, name1: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.name()
}

description() 🔗

The description of the field

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 description
func (m *myModule) example(ctx context.Context, name string, name1 string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			Description(ctx)
}
@function
async def example(name: str, name1: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.description()
	)
@func()
async example(name: string, name1: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.description()
}

type() 🔗

The return type of the field

Return Type
TypeRef !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 type
func (m *myModule) example(name string, name1 string) *CodegenTypeRef  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			Type()
}
@function
def example(name: str, name1: str) -> dag.CodegenTypeRef:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.type()
	)
@func()
example(name: string, name1: string): CodegenTypeRef {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.type()
}

args() 🔗

The field’s arguments

Return Type
[InputValue ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 args
func (m *myModule) example(name string, name1 string) []*CodegenInputValue  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			Args()
}
@function
def example(name: str, name1: str) -> List[dag.CodegenInputValue]:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.args()
	)
@func()
example(name: string, name1: string): CodegenInputValue[] {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.args()
}

isDeprecated() 🔗

Is the field deprecated?

Return Type
Boolean !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 is-deprecated
func (m *myModule) example(ctx context.Context, name string, name1 string) bool  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			IsDeprecated(ctx)
}
@function
async def example(name: str, name1: str) -> bool:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.is_deprecated()
	)
@func()
async example(name: string, name1: string): Promise<boolean> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.isDeprecated()
}

deprecationReason() 🔗

The reason for deprecation, if exists

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 deprecation-reason
func (m *myModule) example(ctx context.Context, name string, name1 string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			DeprecationReason(ctx)
}
@function
async def example(name: str, name1: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.deprecation_reason()
	)
@func()
async example(name: string, name1: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.deprecationReason()
}

nameWords() 🔗

The name of the field, split into words

Common initialisms are preserved, e.g., “ID” becomes “ID” and “URL” becomes “URL”. This is useful so SDKs don’t have to split the name themselves, before applying the language’s naming conventions, which can be a source of inconsistency.

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 name-words
func (m *myModule) example(ctx context.Context, name string, name1 string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			NameWords(ctx)
}
@function
async def example(name: str, name1: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.name_words()
	)
@func()
async example(name: string, name1: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.nameWords()
}

hasOptionalArgs() 🔗

Does the field have optional arguments?

Return Type
Boolean !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 has-optional-args
func (m *myModule) example(ctx context.Context, name string, name1 string) bool  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			HasOptionalArgs(ctx)
}
@function
async def example(name: str, name1: str) -> bool:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.has_optional_args()
	)
@func()
async example(name: string, name1: string): Promise<boolean> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.hasOptionalArgs()
}

requiredArgs() 🔗

The field’s required arguments

Return Type
[InputValue ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 required-args
func (m *myModule) example(name string, name1 string) []*CodegenInputValue  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			RequiredArgs()
}
@function
def example(name: str, name1: str) -> List[dag.CodegenInputValue]:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.required_args()
	)
@func()
example(name: string, name1: string): CodegenInputValue[] {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.requiredArgs()
}

optionalArgs() 🔗

The field’s optional arguments

Return Type
[InputValue ! ] !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 optional-args
func (m *myModule) example(name string, name1 string) []*CodegenInputValue  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			OptionalArgs()
}
@function
def example(name: str, name1: str) -> List[dag.CodegenInputValue]:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.optional_args()
	)
@func()
example(name: string, name1: string): CodegenInputValue[] {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.optionalArgs()
}

getArg() 🔗

Get a field argument by name

Return Type
InputValue !
Arguments
NameTypeDefault ValueDescription
nameString !-The name of the argument
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 get-arg --name string
func (m *myModule) example(name string, name1 string, name2 string) *CodegenInputValue  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			GetArg(name2)
}
@function
def example(name: str, name1: str, name2: str) -> dag.CodegenInputValue:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.get_arg(name2)
	)
@func()
example(name: string, name1: string, name2: string): CodegenInputValue {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.getArg(name2)
}

InputValue 🔗

An argument or input object type's field

name() 🔗

The name of the input

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 get-arg --name string \
 name
func (m *myModule) example(ctx context.Context, name string, name1 string, name2 string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			GetArg(name2).
			Name(ctx)
}
@function
async def example(name: str, name1: str, name2: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.get_arg(name2)
		.name()
	)
@func()
async example(name: string, name1: string, name2: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.getArg(name2)
		.name()
}

description() 🔗

The description of the input

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 get-arg --name string \
 description
func (m *myModule) example(ctx context.Context, name string, name1 string, name2 string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			GetArg(name2).
			Description(ctx)
}
@function
async def example(name: str, name1: str, name2: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.get_arg(name2)
		.description()
	)
@func()
async example(name: string, name1: string, name2: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.getArg(name2)
		.description()
}

defaultValue() 🔗

The default value of the input

Return Type
String 
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 get-arg --name string \
 default-value
func (m *myModule) example(ctx context.Context, name string, name1 string, name2 string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			GetArg(name2).
			DefaultValue(ctx)
}
@function
async def example(name: str, name1: str, name2: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.get_arg(name2)
		.default_value()
	)
@func()
async example(name: string, name1: string, name2: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.getArg(name2)
		.defaultValue()
}

type() 🔗

The type information of the input

Return Type
TypeRef !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 get-arg --name string \
 type
func (m *myModule) example(name string, name1 string, name2 string) *CodegenTypeRef  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			GetArg(name2).
			Type()
}
@function
def example(name: str, name1: str, name2: str) -> dag.CodegenTypeRef:
	return (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.get_arg(name2)
		.type()
	)
@func()
example(name: string, name1: string, name2: string): CodegenTypeRef {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.getArg(name2)
		.type()
}

nameWords() 🔗

The name of the input, split into words

Common initialisms are preserved, e.g., “ID” becomes “ID” and “URL” becomes “URL”. This is useful so SDKs don’t have to split the name themselves, before applying the language’s naming conventions, which can be a source of inconsistency.

Return Type
String !
Example
dagger -m github.com/helderco/daggerverse/codegen@6c84301ee3c563b36c605abd0cfe84be283ab9f2 call \
 introspect \
 get-type --name string \
 get-field --name string \
 get-arg --name string \
 name-words
func (m *myModule) example(ctx context.Context, name string, name1 string, name2 string) string  {
	return dag.
			Codegen().
			Introspect().
			GetType(name).
			GetField(name1).
			GetArg(name2).
			NameWords(ctx)
}
@function
async def example(name: str, name1: str, name2: str) -> str:
	return await (
		dag.codegen()
		.introspect()
		.get_type(name)
		.get_field(name1)
		.get_arg(name2)
		.name_words()
	)
@func()
async example(name: string, name1: string, name2: string): Promise<string> {
	return dag
		.codegen()
		.introspect()
		.getType(name)
		.getField(name1)
		.getArg(name2)
		.nameWords()
}

EnumValue 🔗

An enum type's value

name() 🔗

The name of the enum value

Return Type
String !
Example
Function CodegenEnumValue.name is not accessible from the codegen module
Function CodegenEnumValue.name is not accessible from the codegen module
Function CodegenEnumValue.name is not accessible from the codegen module
Function CodegenEnumValue.name is not accessible from the codegen module

description() 🔗

The description of the enum value

Return Type
String !
Example
Function CodegenEnumValue.description is not accessible from the codegen module
Function CodegenEnumValue.description is not accessible from the codegen module
Function CodegenEnumValue.description is not accessible from the codegen module
Function CodegenEnumValue.description is not accessible from the codegen module

isDeprecated() 🔗

Is the enum value deprecated?

Return Type
Boolean !
Example
Function CodegenEnumValue.isDeprecated is not accessible from the codegen module
Function CodegenEnumValue.isDeprecated is not accessible from the codegen module
Function CodegenEnumValue.isDeprecated is not accessible from the codegen module
Function CodegenEnumValue.isDeprecated is not accessible from the codegen module

deprecationReason() 🔗

The reason for deprecation, if exists

Return Type
String !
Example
Function CodegenEnumValue.deprecationReason is not accessible from the codegen module
Function CodegenEnumValue.deprecationReason is not accessible from the codegen module
Function CodegenEnumValue.deprecationReason is not accessible from the codegen module
Function CodegenEnumValue.deprecationReason is not accessible from the codegen module

TypeRef 🔗

Type information Can be the return type of a field, the type of a field argument, or the underlying type in a list or non-null type.

kind() 🔗

The kind of type, e.g., object, scalar, etc.

Return Type
String !
Example
Function CodegenTypeRef.kind is not accessible from the codegen module
Function CodegenTypeRef.kind is not accessible from the codegen module
Function CodegenTypeRef.kind is not accessible from the codegen module
Function CodegenTypeRef.kind is not accessible from the codegen module

name() 🔗

The name of a named type.

Return Type
String !
Example
Function CodegenTypeRef.name is not accessible from the codegen module
Function CodegenTypeRef.name is not accessible from the codegen module
Function CodegenTypeRef.name is not accessible from the codegen module
Function CodegenTypeRef.name is not accessible from the codegen module

ofType() 🔗

The sub-type of a list or non-null type.

Return Type
TypeRef !
Example
Function CodegenTypeRef.ofType is not accessible from the codegen module
Function CodegenTypeRef.ofType is not accessible from the codegen module
Function CodegenTypeRef.ofType is not accessible from the codegen module
Function CodegenTypeRef.ofType is not accessible from the codegen module

isOptional() 🔗

Is this type optional?

Return Type
Boolean !
Example
Function CodegenTypeRef.isOptional is not accessible from the codegen module
Function CodegenTypeRef.isOptional is not accessible from the codegen module
Function CodegenTypeRef.isOptional is not accessible from the codegen module
Function CodegenTypeRef.isOptional is not accessible from the codegen module

isLeaf() 🔗

Is it a leaf?

Leaf types as essentially scalar or enum types. They are the last step in a pipeline, so must execute the request and return the result.

Return Type
Boolean !
Example
Function CodegenTypeRef.isLeaf is not accessible from the codegen module
Function CodegenTypeRef.isLeaf is not accessible from the codegen module
Function CodegenTypeRef.isLeaf is not accessible from the codegen module
Function CodegenTypeRef.isLeaf is not accessible from the codegen module

isObject() 🔗

Is it an object type?

Return Type
Boolean !
Example
Function CodegenTypeRef.isObject is not accessible from the codegen module
Function CodegenTypeRef.isObject is not accessible from the codegen module
Function CodegenTypeRef.isObject is not accessible from the codegen module
Function CodegenTypeRef.isObject is not accessible from the codegen module

isList() 🔗

Is it a list?

Return Type
Boolean !
Example
Function CodegenTypeRef.isList is not accessible from the codegen module
Function CodegenTypeRef.isList is not accessible from the codegen module
Function CodegenTypeRef.isList is not accessible from the codegen module
Function CodegenTypeRef.isList is not accessible from the codegen module