Omit empty releaseStrategy from UpdateInstanceInput#26
Merged
Conversation
The V2 mutation marks `releaseStrategy` as deprecated and nullable —
callers should be able to skip it once they migrate to the `+dev`
suffix on `version`. In practice they couldn't, because the generated
gen.UpdateInstanceInput emitted `"releaseStrategy": ""` whenever a
caller left the field unset, and Absinthe rejected the empty string
against the ReleaseStrategy enum:
input:3: Argument "input" has invalid value $input.
In field "releaseStrategy": Expected type "ReleaseStrategy", found "".
So every deprecation-following client (the entire CLI surface that
hits `Instances.Update`) was broken until we stopped sending the
field.
Apply `# @genqlient(for: "UpdateInstanceInput.releaseStrategy",
omitempty: true, pointer: true)` to the operation. The generated
struct goes from `ReleaseStrategy ReleaseStrategy `json:"releaseStrategy"`` to
`ReleaseStrategy *ReleaseStrategy `json:"releaseStrategy,omitempty"``
— nil pointer means absent on the wire, matches the deprecated +
nullable schema contract.
Fixes #25.
chrisghill
reviewed
May 15, 2026
chrisghill
approved these changes
May 15, 2026
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.
Summary
mdClient.Instances.Update(ctx, id, instances.UpdateInput{Version: "latest+dev"})fails before reaching the resolver:The V2 schema's
UpdateInstanceInputmarksreleaseStrategyas deprecated and nullable. Clients that followed the migration to the+devsuffix onversionshouldn't have to send the field anymore. In practice they couldn't, because the generatedgen.UpdateInstanceInputemitted"releaseStrategy": ""whenever a caller left it unset, and Absinthe rejects the empty string against theReleaseStrategyenum.So every deprecation-following caller of
Instances.Updatewas broken — everymass instance version <id>@latest+devinvocation, every preview command's per-instance version override, etc.Same shape as #24 (
CopyInstanceInput.Message), different field; the previous fix was a schema removal but this field is still in the schema (just deprecated), so this PR uses a genqlient directive instead.Change
One genqlient directive on the operation:
Regenerated
zz_generated.go. The field's Go shape moves from typed string to*ReleaseStrategywithomitempty— nil pointer ⇒ field absent on the wire, matching the deprecated + nullable schema contract.Public
instances.UpdateInputalready only exposesVersion, so nothing in the wrapper changes — the gen-level mappinggen.UpdateInstanceInput{Version: input.Version}keeps working.Test plan
go build ./...go test ./...— all packages greenFixes #25. Unblocks massdriver-cloud/mass#236 and #238.