Skip to content

Commit 1f44dc6

Browse files
Release v0.5.0 (#208)
It feels like just yesterday, but it's been over four months since our last release! So it's as good a time as any; while there are quite a few changes they're individually mostly small. As usual, this updates the changelog, and I'll tag it with the release once it lands. Test plan: no relevant bug reports lately
1 parent e38a212 commit 1f44dc6

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

docs/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ When releasing a new version:
2222

2323
### Breaking changes:
2424

25+
### New features:
26+
27+
### Bug fixes:
28+
29+
## v0.5.0
30+
31+
Version 0.5.0 adds several new configuration options and convenience features. Note that genqlient now requires Go 1.16 or higher, and is tested through Go 1.18.
32+
33+
### Breaking changes:
34+
2535
- genqlient now requires Go 1.16 or higher.
2636
- The [`graphql.Client`](https://pkg.go.dev/github.com/Khan/genqlient/graphql#Client) interface now accepts two structs for the request and response, to allow future expansion, rather than several individual arguments. Clients implementing the interface themselves will need to change the signature; clients who simply call `graphql.NewClient` are unaffected.
2737

generate/generate.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,10 @@ func (g *generator) preprocessQueryDocument(doc *ast.QueryDocument) {
228228
// considers valid but we don't allow, and returns an error if this operation
229229
// is invalid for genqlient's purposes.
230230
func (g *generator) validateOperation(op *ast.OperationDefinition) error {
231-
opType, err := g.baseTypeForOperation(op.Operation)
232-
switch {
233-
case err != nil:
231+
_, err := g.baseTypeForOperation(op.Operation)
232+
if err != nil {
234233
// (e.g. operation has subscriptions, which we don't support)
235234
return err
236-
case opType == nil:
237-
// gqlparser should err here, but doesn't [1], so we err to prevent
238-
// panics later.
239-
// TODO(benkraft): Remove once gqlparser is fixed.
240-
// [1] https://github.com/vektah/gqlparser/issues/221
241-
return errorf(op.Position, "schema has no %v type", op.Operation)
242235
}
243236

244237
if op.Name == "" {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
testdata/errors/NoMutationType.graphql:1: schema has no mutation type
1+
testdata/errors/NoMutationType.graphql:1: query-spec does not match schema: Schema does not support operation type "mutation"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
testdata/errors/NoQueryType.graphql:1: schema has no query type
1+
testdata/errors/NoQueryType.graphql:1: query-spec does not match schema: Schema does not support operation type "query"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/alexflint/go-arg v1.4.2
99
github.com/bradleyjkemp/cupaloy/v2 v2.6.0
1010
github.com/stretchr/testify v1.7.0
11-
github.com/vektah/gqlparser/v2 v2.4.1
11+
github.com/vektah/gqlparser/v2 v2.4.5
1212
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
1313
golang.org/x/tools v0.1.10
1414
gopkg.in/yaml.v2 v2.4.0

go.sum

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

0 commit comments

Comments
 (0)