Repository navigation
fix: use GraphQL cache policy enum values in Dang entrypoints - #142
Closed
mboliveira2003 wants to merge 1 commit into
Closed
mboliveira2003 wants to merge 1 commit into
mboliveira2003 wants to merge 1 commit into
Conversation
Signed-off-by: Margarida Oliveira <[email protected]>
eunomie
pushed a commit
to eunomie/typescript-sdk
that referenced
this pull request
Nov 24, 2026
A generated Dang entrypoint for a function with @func({ cache: "session" }) fails to load: `field "PerSession" not found in Dagger.FunctionCachePolicy`. The Dang renderer emitted the TypeScript client's member names; Dang names enum members by their GraphQL values. Emit PER_SESSION, NEVER and DEFAULT instead. Same change as dagger#142, which was closed unmerged. Signed-off-by: Alex Suraci <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Dagger v1.0.0-beta.28, a generated Dang entrypoint for a method using
@func({ cache: "session" })fails to load withfield "PerSession" not found in Dagger.FunctionCachePolicy. Theneverand TTL branches also emit the legacy member names.Emit the GraphQL enum values
PER_SESSION,NEVER, andDEFAULTin the Dang renderer. The regression test generates entrypoints from the existing introspector fixture with each cache policy and checks the emitted API references.Follow-up to #141.
Validation:
helpers/codegen:go test ./generator/typescript -run '^TestGenerateDangEntrypoint' -count=1passed with Go 1.25.1.verify,catalog/stale, andtypescript-sdk/generate/staletwice on separate beta.28 Cloud connections using the corrected generator.