MCPcopy Index your code
hub / github.com/dagger/dagger / GraphqlSchema

Method GraphqlSchema

toolchains/engine-dev/main.go:333–351  ·  view source on GitHub ↗

Introspect the engine API schema, and return it as a graphql schema

(
	ctx context.Context,
	// +optional
	version string,
)

Source from the content-addressed store, hash-verified

331
332// Introspect the engine API schema, and return it as a graphql schema
333func (dev *EngineDev) GraphqlSchema(
334 ctx context.Context,
335 // +optional
336 version string,
337) (*dagger.File, error) {
338 playground, err := dev.Playground(ctx, nil, false, false, false, "")
339 if err != nil {
340 return nil, err
341 }
342 schemaPath := "schema.graphqls"
343 schema := playground.
344 WithFile("/usr/local/bin/introspect", dev.IntrospectionTool()).
345 WithExec(
346 []string{"introspect", "--version=" + version, "schema"},
347 dagger.ContainerWithExecOpts{RedirectStdout: schemaPath},
348 ).
349 File(schemaPath)
350 return schema, nil
351}
352
353// Build the `introspect` tool which introspects the engine API
354func (dev *EngineDev) IntrospectionTool() *dagger.File {

Callers 1

invokeFunction · 0.45

Calls 5

PlaygroundMethod · 0.95
IntrospectionToolMethod · 0.95
FileMethod · 0.65
WithExecMethod · 0.45
WithFileMethod · 0.45

Tested by

no test coverage detected