[WIP] Go SDK: Query Builder#174
Conversation
✅ Deploy Preview for cloak-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
835706b to
fe561a9
Compare
sipsma
left a comment
There was a problem hiding this comment.
Looks good, love the direction this is going. I think it has the potential to mesh really nicely with the builder pattern API proposed here. Just leaving high level comments for since the details seem to be WIP.
I guess this will bring back some of the questions we've managed to ignore for a while around lazy vs. synchronous behavior. For instance, if you have to pass an FSID as an arg somewhere, should calling .ID() result in synchronous evaluation? If not, then how can users force a synchronous evaluation when they want to trigger a side effect?
- This is actually somewhat overlapping with our other discussions about query vs. mutation. Maybe mutations are synchronously evaluated by default and queries are lazy by default? I don't know, that is probably too magical, but might be something there.
- Maybe the simplest solution would be for
.ID()to synchronously evaluate (same behavior as today). And then we can have an advanced method like.LazyRef()that returns ID but without evaluating. Need a better name thanLazyRefbut you get the idea.- This could be implemented by actually having our low-level graphql API support both.
Another thing to think about: there was feedback recently that the need to return Filesystem objects but use FSID as input is kind of weird. It only makes sense if you know the underlying graphql model. I don't personally think it's a huge deal, but I do see how that is surprising to the uninitiated. I wonder if there's any way to hide the difference between "the object" and "the ID of the object" on this sort of query builder layer here.
- Not a blocker at all, just curious if you have any thoughts on it.
| func alpine(packages ...string) *Filesystem { | ||
| fs := core.Image("alpine") | ||
| for _, pkg := range packages { | ||
| fs = fs.Exec("apk", "add", pkg).FS() | ||
| } | ||
| return fs | ||
| } |
Unsure about that. Spent most of the efforts in I was thinking of this:
|
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
fe561a9 to
187773f
Compare
|
Moved to dagger/dagger#3125 |
No description provided.