#Dang rejects ModuleSourceID in loadModul...
1 messages · Page 1 of 1 (latest)
🧵
If it's a legit issue @untold nymph I don't mind trying my hand at a fix...
Just not yet 100% sure that I'm not missing something obvious
I'm cooking something up, no worries
Ah so legit then!
it's because in every other scenario we'd normally want an object to be passed in for a function that takes an ID, but loadFooFromID are the obvious exception
so now I'm trying out support for union types, so all those args can accept objects or IDs
so far so good...
dang> Dagger.loadFileFromID("")
=> gql:Value:File.loadFileFromID
dang> Dagger.loadFileFromID("").id
..
evaluation error: executing GraphQL query for File.loadFileFromID.id: input: query:
query Query {loadFileFromID(id:""){id}}
error: parse selections: parse field "loadFileFromID": init arg "id" value as dagql.ID[*github.com/dagger/dagger/core.File] (FileID!) using dagql.ID[*github.co
dang> Dagger.loadFileFromID(file("hey", "sup")).id
......
=> ChV4eGgzOjUwODdjZTJiMWM5ODkwM2ESeQoVeHhoMzo1MDg3Y2UyYjFjOTg5MDNhEmASCAoERmlsZRgBGgRmaWxlIg0KBG5hbWUSBToDaGV5IhEKCGNvbnRlbnRzEgU6A3N1cEoVeHhoMzo1MDg3Y2UyYjFj
dang> Dagger.loadFileFromID(file("hey", "sup")).contents
........
=> sup
dang> let x = Dagger.loadFileFromID(file("hey", "sup")).id
....
=> ChV4eGgzOjUwODdjZTJiMWM5ODkwM2ESeQoVeHhoMzo1MDg3Y2UyYjFjOTg5MDNhEmASCAoERmlsZRgBGgRmaWxlIg0KBG5hbWUSBToDaGV5IhEKCGNvbnRlbnRzEgU6A3N1cEoVeHhoMzo1MDg3Y2UyYjFj
dang> let x = Dagger.loadFileFromID(x).id
=> ChV4eGgzOjUwODdjZTJiMWM5ODkwM2ESeQoVeHhoMzo1MDg3Y2UyYjFjOTg5MDNhEmASCAoERmlsZRgBGgRmaWxlIg0KBG5hbWUSBToDaGV5IhEKCGNvbnRlbnRzEgU6A3N1cEoVeHhoMzo1MDg3Y2UyYjFj
dang> :type Dagger.loadFileFromID
Expression: Dagger.loadFileFromID
Type: (id: (File | FileID)!): File!
fixed on main, just needs a dependency bump in dagger: https://github.com/vito/dang/pull/48
@autumn crag is this something we should get in for next release?
Oh man I would love it - if not rushing it too much
kk, will toss up a pr
Would make it much easier to develop go-sdk and other "SDK as modules", which in turn unblocks removing dagger module subcommands from workspace branch