Skip to content

refactor(graphql): use pointers for optional genqlient fields - #761

Merged
christeredvartsen merged 1 commit into
mainfrom
default_ptr
Sep 9, 2026
Merged

refactor(graphql): use pointers for optional genqlient fields#761
christeredvartsen merged 1 commit into
mainfrom
default_ptr

Conversation

@thokra-nav

Copy link
Copy Markdown
Contributor

Set optional: pointer in genqlient.yaml so optional GraphQL fields (inputs and outputs) are generated as pointers with omitempty JSON tags instead of plain values. This lets input structs properly distinguish "not provided" from an explicit zero value, and makes response-side optionality explicit instead of silently collapsing to Go zero values. (Might be worth looking at pointer_omitempty when a new version is released of genqlient. Khan/genqlient#413 and Khan/genqlient#406)

E.g. nais config list didn't show used configs given that the default for the filter was inUse: false and not unset/null.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

📝 Changelog preview

Below is a preview of the Changelog that will be added to the next release. Only commit messages that follow the Conventional Commits specification will be included in the Changelog.

v5.46.3 - 2026-09-09

Full Changelog: v5.46.2...v5.46.3

⚙️ Miscellaneous Changes

Set `optional: pointer` in genqlient.yaml so optional
GraphQL fields (inputs and outputs) are generated as pointers with
omitempty JSON tags instead of plain values. This lets input structs
properly distinguish "not provided" from an explicit zero value, and
makes response-side optionality explicit instead of silently
collapsing to Go zero values. (Might be worth looking at
`pointer_omitempty` when a new version is released of genqlient.
Khan/genqlient#413 and
Khan/genqlient#406)
@christeredvartsen
christeredvartsen merged commit 18213ce into main Sep 9, 2026
22 checks passed
@christeredvartsen
christeredvartsen deleted the default_ptr branch September 9, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants