Skip to content

fix: add omitempty support for list types with pointer_omitempty#413

Open
gofulljs wants to merge 5 commits intoKhan:mainfrom
gofulljs:fix-pointer-omitempty-for-list-types
Open

fix: add omitempty support for list types with pointer_omitempty#413
gofulljs wants to merge 5 commits intoKhan:mainfrom
gofulljs:fix-pointer-omitempty-for-list-types

Conversation

@gofulljs
Copy link

fixed pointer_omitempty not being applied to list types when use_struct_references is enabled. List fields like [String!] now correctly get the omitempty JSON tag

huo added 2 commits January 29, 2026 10:17
When using use_struct_references: true with optional: pointer_omitempty,
list types like [String!] were not getting the omitempty tag because
the convertType function returned early for slice types, skipping the
pointer_omitempty handling logic.

This fix ensures that list types also respect the pointer_omitempty
configuration when the list itself is nullable.
Copy link
Collaborator

@benjaminjkraft benjaminjkraft left a comment

Choose a reason for hiding this comment

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

seems like a bug to me, thanks for the fix!

@benjaminjkraft
Copy link
Collaborator

I think the test failure is still a flake, but it looks like we don't have a CLA from you, could you fill that out?

@gofulljs
Copy link
Author

gofulljs commented Feb 2, 2026

I’ve signed the CLA, thanks.

gofulljs added 3 commits February 2, 2026 10:03
When using use_struct_references: true with optional: pointer_omitempty,
list types like [String!] were not getting the omitempty tag because
the convertType function returned early for slice types, skipping the
pointer_omitempty handling logic.

This fix ensures that list types also respect the pointer_omitempty
configuration when the list itself is nullable.
…ulljs/genqlient into fix-pointer-omitempty-for-list-types
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