Install (introspection/types.go)

dagger · dagql/introspection/types.go · go · Apache-2.0
database, tag:knn-classified

Installs GraphQL introspection schema into a Dagger server.

// Source: https://github.com/dagger/dagger | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package introspection

import (
	"context"
	"fmt"
	"sort"
	"strings"

	"github.com/vektah/gqlparser/v2/ast"

	"github.com/dagger/dagger/dagql"
	"github.com/dagger/dagger/dagql/call"
)

func Install[T dagql.Typed](srv *dagql.Server) {
	dagql.Fields[T]{
		dagql.Func("__schema", func(ctx context.Context, self T, args struct{}) (*Schema, error) {
			currentSrv := dagql.CurrentDagqlServer(ctx)
			if currentSrv == nil {
				return nil, fmt.Errorf("missing current dagql server")
			}
			return WrapSchema(currentSrv.Schema()), nil
		}).WithInput(dagql.PerCallInput),

		// custom dagger field
		dagq

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key