Skip to content

Commit 5dd9103

Browse files
author
huo
committed
add test
1 parent 60302f3 commit 5dd9103

6 files changed

Lines changed: 170 additions & 0 deletions

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Note that genqlient now requires Go 1.23 or higher, and is tested through Go 1.2
3232

3333
### Bug fixes:
3434

35+
- 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.
3536
- fixed minor typos and grammatical issues across the project
3637

3738
## v0.8.1

generate/generate_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ func TestGenerateWithConfig(t *testing.T) {
245245
"PointersOmitEmpty.graphql",
246246
"Omitempty.graphql",
247247
"ListInput.graphql",
248+
"ListInputOmitempty.graphql",
248249
}, &Config{
249250
Optional: "pointer_omitempty",
250251
Bindings: map[string]*TypeBinding{
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
query ListInputOmitemptyQuery($names: [String!]) {
2+
user(query: {names: $names}) {
3+
id
4+
}
5+
}

generate/testdata/snapshots/TestGenerate-ListInputOmitempty.graphql-ListInputOmitempty.graphql.go

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"operations": [
3+
{
4+
"operationName": "ListInputOmitemptyQuery",
5+
"query": "\nquery ListInputOmitemptyQuery ($names: [String!]) {\n\tuser(query: {names:$names}) {\n\t\tid\n\t}\n}\n",
6+
"sourceLocation": "testdata/queries/ListInputOmitempty.graphql"
7+
}
8+
]
9+
}

generate/testdata/snapshots/TestGenerateWithConfig-OptionalPointerOmitEmpty-ListInputOmitempty.graphql-testdata-queries-generated.go

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)