Skip to content

CLI: allow querying multiple fields in the same object #6949

Closed

Description

@shykes

Problem

GraphQL supports querying multiple fields from the same object, which is very useful especially for data querying. But the CLI doesn't support this. This drastically limits use cases for dagger call. Basically it makes it impossible to use a Dagger Module as a practical data interface, usable from the CLI.

For an example, see https://daggerverse.dev/mod/github.com/dagger/dagger/linters/markdown

Querying multiple fields can also be applied for easy parallelism: advanced complex like multi-arch builds, could be made much more approachable. Hard to know for sure, until we allow experimentation.

Solution

Add support for querying multiple fields from the CLI.

I propose using , as a separator (bikeshedding welcome). For example:

dagger call -m github.com/dagger/dagger/linters/markdown \
 lint --source https://github.com/shykes/daggerverse \
 checks \
 file-name,line-number,rule-description

The output would be:

{"lineNumber":4, "fileName":"dagger/NOTES.md", "ruleDescription":"Files should end with a single newline character"}
{"lineNumber":11, "fileName":"dagger/README.md", "ruleDescription":"Bare URL used"}
{"lineNumber":13, "fileName":"dagger/README.md", "ruleDescription":"Bare URL used"}
{"lineNumber":14, "fileName":"daggy/README.md", "ruleDescription":"Multiple consecutive blank lines"}
{"lineNumber":18, "fileName":"daggy/README.md", "ruleDescription":"Multiple consecutive blank lines"}
{"lineNumber":22, "fileName":"daggy/README.md", "ruleDescription":"Multiple consecutive blank lines"}
{"lineNumber":26, "fileName":"daggy/README.md", "ruleDescription":"Multiple consecutive blank lines"}

Design considerations

If we implement #6515, this may not be needed.

Activity

  1. helderco commented on Mar 26, 2024

    @helderco
    Contributor
  2. helderco commented on Mar 26, 2024

    @helderco
    Contributor

    I think separating with a comma is ok. It's what we use with lists in the CLI usually. It's techically possible to separate with spaces but that's confusing for humans. Comma makes more sense than something else like : since it more clearly expresses an enumeration of the same kind of thing.

  3. added
    area/cli
    on Apr 12, 2024
  4. removed
    area/cli
    on May 31, 2024
  5. added
    area/cli
    on Aug 1, 2024
  6. locked and limited conversation to collaborators on Mar 24, 2026
  7. converted this issue into a discussion #12406 on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/cli

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions