Supposing we have a zenith module:
package main
import "context"
const (
base = "cgr.dev/chainguard/wolfi-base"
defaultVersion = "1.21.3"
)
type Golang struct {
Ctr *Container
Version string
}
func (m *Golang) WithContainer(container *Container) *Golang {
m.Ctr = container
return m
}
func (m *Golang) WithVersion(version string) *Golang {
m.Version = version
return m
}
func (m *Golang) Container(ctx context.Context) (*Container, error) {
version := m.Version
if version == "" {
version = defaultVersion
}
ctr := dag.Container().From(base)
ctr = ctr.WithExec([]string{"apk", "add", "go"})
return ctr, nil
}
How can i structure graphql request?
{
golang {
withContainer(container: ?){
withVersion(version: "1.21.3") {
container {
withExec(args: ["go", "version"]) {
stdout
}
}
}
}
}
}