#[dagger print] inspecting objects

1 messages · Page 1 of 1 (latest)

timber lark
#

I don't think there is right now. The main limitation is that we're using the query builder from the go sdk and it doesn't support selecting multiple fields on a single return. I guess that's the one disadvantage of using it relative to a raw graphql query builder.

If we added support for that, then you could do this since we could just give OnSelectObjectLeaf the type def for the object, which would let you know what fields exist so you could select them all. Then the response you'd get would be a map[string]any and you could go from there in terms of printing it

bleak cedar
#

You can use the approach in shell. Select the container id and in the response, turn it into dgger.Container and access the fields from there.

abstract depot
#

I found a hack for now: when the result is a string, I check for core.XXX: prefix, and infer the ID type from there

timber lark
#

Oh you only want core types? I thought you wanted any objects

#

Yeah that's easier

abstract depot
#

Well, yeah I do want any objects. But have lowered my bar for a first implementation

#

supporting core types would be a great start

#

Then, more hacks 🙂

#

I'm also fighting a few other battles, see my latest message in #daggernauts about TUI output

bleak cedar
#

You have the typedef in AfterResponse, so it should tell you at least which type it is from the object's name, as a string.