Skip to content

Node.js SDK: Nested queries - #3996

Merged
slumbering merged 3 commits into
dagger:mainfrom
slumbering:sdk-nodejs-hidden-id
Dec 1, 2022
Merged

slumbering merged 3 commits into
dagger:mainfrom
slumbering:sdk-nodejs-hidden-id

Conversation

@slumbering

@slumbering slumbering commented Nov 27, 2022 •

Copy link
Copy Markdown
Contributor

Give the ability to pass the client as an argument without the needs of using its id.

Before

const cacheVolumeId = await client.cacheVolume("cache_key").id()

const image = await client 
        .container()
        .from("alpine")
        .withMountedCache("/root/.cache", cacheVolumeId)
        .withExec(["echo", "foo bar"])
        .stdout()

After

const image = await client 
        .container()
        .withMountedCache("/root/.cache", client.cacheVolume("cache_key"))
        .withExec(["echo", "foo bar"])
        .stdout()

Tasks list:

  • Pass a method as an arg that return an id()
  • Update docs and example to reflect api change
  • Update Codegen (cc @dolanor)

Signed-off-by: jffarge [email protected]

@slumbering slumbering self-assigned this Nov 27, 2022
@slumbering slumbering added this to the Node.js 0.2.0 milestone Nov 27, 2022
@slumbering slumbering changed the title Node.js SDK: Nested queries [WIP]: Node.js SDK: Nested queries Nov 27, 2022
@slumbering
slumbering marked this pull request as draft November 27, 2022 20:43
@slumbering slumbering changed the title [WIP]: Node.js SDK: Nested queries Node.js SDK: Nested queries Nov 27, 2022
@gerhard gerhard removed this from the Node.js 0.2.0 milestone Nov 29, 2022
@slumbering
slumbering requested a review from dolanor November 29, 2022 15:38
@slumbering
slumbering marked this pull request as ready for review November 30, 2022 15:35
@slumbering
slumbering requested review from TomChv and gerhard November 30, 2022 15:48

@TomChv TomChv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! 🚀

💡 All my nit comments are not blocking the merge. We shall take care of this in a follow-up.

Comment thread sdk/nodejs/api/utils.ts Resolved
Comment thread sdk/nodejs/api/utils.ts Resolved
Comment thread sdk/nodejs/api/utils.ts Resolved
Comment thread sdk/nodejs/api/utils.ts Resolved
Comment thread sdk/nodejs/api/utils.ts Resolved
Comment thread sdk/nodejs/api/utils.ts Resolved
Comment thread sdk/nodejs/api/utils.ts Resolved
jffarge and others added 2 commits December 1, 2022 10:19
without the need to use the .id()
Clean up tests
use custom scalar id and custom scalar as input as we use an union type, we're not breaking compatibility.

Signed-off-by: jffarge <[email protected]>
Co-authored-by: Tanguy ⧓ Herrmann <[email protected]>
@slumbering
slumbering force-pushed the sdk-nodejs-hidden-id branch from 75e25b2 to f8e329c Compare December 1, 2022 09:19
Signed-off-by: jffarge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/breaking Breaking Change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants