Skip to content

Commit

Permalink
Release v0.5.0 (#208)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
benjaminjkraft authored Jun 16, 2022
1 parent e38a212 commit 1f44dc6
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
10 changes: 10 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ When releasing a new version:

### Breaking changes:

### New features:

### Bug fixes:

## v0.5.0

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.

### Breaking changes:

- genqlient now requires Go 1.16 or higher.
- 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.

Expand Down
11 changes: 2 additions & 9 deletions generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,10 @@ func (g *generator) preprocessQueryDocument(doc *ast.QueryDocument) {
// considers valid but we don't allow, and returns an error if this operation
// is invalid for genqlient's purposes.
func (g *generator) validateOperation(op *ast.OperationDefinition) error {
opType, err := g.baseTypeForOperation(op.Operation)
switch {
case err != nil:
_, err := g.baseTypeForOperation(op.Operation)
if err != nil {
// (e.g. operation has subscriptions, which we don't support)
return err
case opType == nil:
// gqlparser should err here, but doesn't [1], so we err to prevent
// panics later.
// TODO(benkraft): Remove once gqlparser is fixed.
// [1] https://github.com/vektah/gqlparser/issues/221
return errorf(op.Position, "schema has no %v type", op.Operation)
}

if op.Name == "" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
testdata/errors/NoMutationType.graphql:1: schema has no mutation type
testdata/errors/NoMutationType.graphql:1: query-spec does not match schema: Schema does not support operation type "mutation"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
testdata/errors/NoQueryType.graphql:1: schema has no query type
testdata/errors/NoQueryType.graphql:1: query-spec does not match schema: Schema does not support operation type "query"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/alexflint/go-arg v1.4.2
github.com/bradleyjkemp/cupaloy/v2 v2.6.0
github.com/stretchr/testify v1.7.0
github.com/vektah/gqlparser/v2 v2.4.1
github.com/vektah/gqlparser/v2 v2.4.5
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
golang.org/x/tools v0.1.10
gopkg.in/yaml.v2 v2.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1f44dc6

Please sign in to comment.