Skip to content

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

Open
thokra-nav wants to merge 1 commit into
mainfrom
default_ptr
Open

refactor(graphql): use pointers for optional genqlient fields#761
thokra-nav wants to merge 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.

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)
@github-actions

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.44.4 - 2026-07-27

Full Changelog: v5.44.3...v5.44.4

⚙️ Miscellaneous Changes

  • (graphql) Use pointers for optional genqlient fields (026c5dc)

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.

1 participant