Introspect the engine API schema, and return it as a graphql schema
( ctx context.Context, // +optional version string, )
| 331 | |
| 332 | // Introspect the engine API schema, and return it as a graphql schema |
| 333 | func (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 |
| 354 | func (dev *EngineDev) IntrospectionTool() *dagger.File { |
no test coverage detected