#This seems like it works in Go, but I'm
1 messages · Page 1 of 1 (latest)
✔ github(
│ │ githubToken: secret(uri: "env://GITHUB_TOKEN"): Secret!
│ │ repo: $ Directory.withDirectory(
│ │ │ directory: GitRef.tree: Directory!
│ │ │ path: "/"
│ │ ): Directory! 0.0s CACHED
│ ): Github! 5.1s
✘ .pullRequest: GithubPullRequest! 1.8s
┃ Error: Cannot convert undefined or null to object
I'm trying to define a fluent API such that you start with github() .. do some base configuration and then say ok now I want to interact with pull rquests so .pullRequest() and now you've got methods on a PR type
an example in Go: https://github.com/sagikazarmark/daggerverse/tree/c1be27189ce47d28f84014b715f78e47db9fbadc/gh
cc: @main terrace have you tried this pattern in TS?
Hmmm docs make me think this should work https://docs.dagger.io/api/custom-types/?sdk=typescript
Does the GitHub class have a container function that was omitted in the snippet? Or should it be github._container?
@languid sand there’s a container function
Ok.. I cleaned this up/simplified and the pattern works so it’s something else blowing up. I was able to return my PullRequest object from a method of Github
ok.. so the issue is this._gh.container() ? ┃ Error: this._gh.container(...).withExec is not a function