Skip to content

Releases

v0.14.0

Choose a tag to compare

@github-actions github-actions released this 03 Dec 22:24
fcfb4a8

What's Changed

Features

Specification compliance

  • fix: reject input object fields with an invalid name by @seriallink in #209

Bug fixes

  • fix: compute possible types when the schema is built by @seriallink in #180
  • fix: format syntax errors in linear time by @seriallink in #183
  • fix: key normalized plans on directives, variable defaults and strings by @seriallink in #184
  • fix: key normalized plans on the whole document by @seriallink in #185
  • fix: visit and print nested values in linear time by @seriallink in #190
  • fix: stop sending subscription results once the context is done by @seriallink in #191
  • fix: recover panics in ParseLiteral outside field execution by @seriallink in #194
  • fix: resume lexing at the byte after a name that follows a BOM by @seriallink in #187
  • fix: skip fragments on unknown types when planning by @seriallink in #196
  • fix: find a single value given for a list in ArgumentState by @seriallink in #198
  • fix: build enum lookups without a data race by @seriallink in #199
  • fix: report a nil pointer variable as null in ArgumentState by @seriallink in #201
  • fix: leave the schema as it was when AppendType fails by @seriallink in #204
  • fix: surface non-error Subscribe panics on the stream by @Beehtrix in #172
  • fix: give extension hooks Background when Context is unset by @Beehtrix in #174
  • fix: format non-error extension panics without re-panicking by @Beehtrix in #173
  • fix: reject AppendType while another AppendType is in progress by @seriallink in #210

Documentation

  • docs: add resolver ergonomics to the roadmap by @seriallink in #176
  • docs: add the serving over HTTP guide by @seriallink in #168
  • docs: note the root object of rejected mutations in the HTTP guide by @seriallink in #179
  • docs: suggest allowing edits by maintainers on pull requests by @seriallink in #189
  • docs: list union definitions without members in the migration guide by @seriallink in #186
  • docs: mark the fixes since v0.13.0 for v0.14.0 by @seriallink in #192
  • docs: state that API additions make a minor release by @seriallink in #193
  • docs: add package comments by @seriallink in #214
  • docs: add page descriptions and a descriptive site title by @seriallink in #215
  • docs: say that ArgsAs converts no value through its methods by @seriallink in #212

Maintenance

  • test: give TestDo_DeeplyNestedValues a margin under the race detector by @seriallink in #216

New Contributors

Full Changelog: v0.13.0...v0.14.0

v0.13.0

Choose a tag to compare

@github-actions github-actions released this 02 Dec 01:35
32491fd

Metadata on schema elements. Applications can attach values of their own to types, fields, arguments and every other schema element, the equivalent of extensions in graphql-js (#11). Use it instead of encoding data in names or descriptions, which clients read through introspection.

  • Every config has a Metadata field, built with graphql.NewMetadata(map[string]interface{}{...}): objects, interfaces, unions, enums and enum values, input objects and their fields, scalars, fields, arguments, directives and the schema. It is immutable, safe to share across goroutines, and not exposed in introspection.

  • Resolvers reach it in one call: p.Info.ReturnTypeMetadata() (the named return type, through lists and non-null), p.Info.FieldMetadata() and p.Info.FieldDefinition() (#171). graphql.MetadataValue[T] reads a value already converted to T:

    table, ok := graphql.MetadataValue[string](p.Info.ReturnTypeMetadata(), "table")

The name is Metadata because Extensions already means execution hooks here. Nothing changes for schemas without metadata; Schema and ResolveInfo are 8 bytes smaller. See Metadata in the guides.

Guides. The documentation site gained guides for subscriptions, validation, extensions, query plans and caching, and language tools, and a page on why the schema is built in code.

What's Changed

Features

Documentation

Other changes

Full Changelog: v0.12.2...v0.13.0

v0.12.2

Choose a tag to compare

@github-actions github-actions released this 01 Dec 18:01
4ec59e9

What's Changed

Bug fixes

Documentation

New Contributors

Full Changelog: v0.12.1...v0.12.2

v0.12.1

Choose a tag to compare

@github-actions github-actions released this 01 Dec 02:49
cea1918

What's Changed

Bug fixes

  • fix: evaluate @include and @skip for each selection, as collectFields does by @seriallink in #109

Documentation

Full Changelog: v0.12.0...v0.12.1

v0.12.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 01:11
8f229e3

Explicit null arguments. An explicit null can now reach a resolver, and a resolver can tell it apart from an omitted argument (#6):

  • The null literal is accepted, as in the specification, instead of being a syntax error. Unless Coercion is enabled, a resolver receives an explicit null as it receives an omitted value, so Args are unchanged for every query that worked before.
  • ResolveParams.ArgumentState reports whether an argument, or a value inside it such as p.ArgumentState("input", "description"), was omitted, sent as null or set. It works in every mode, even when a DefaultValue fills the argument. Use it to tell "clear this field" from "leave it unchanged".
  • SchemaConfig.Coercion controls ResolveParams.Args:
    • Legacy (default): Args are unchanged.
    • Spec: coerces as the specification and graphql-js do. An explicit null stays in Args as nil, including in an argument with a DefaultValue and inside input objects and lists.
    • Report: keeps the legacy Args and calls OnDifference wherever spec mode would behave differently: null dropped, null defaulted, default applied or null rejected.

Spec mode puts nil in Args for an explicit null, so a single-value type assertion such as p.Args["limit"].(int) panics. If your resolvers rely on that pattern, stay in legacy mode and use ArgumentState where you need it. Otherwise, run report mode first and fix the resolvers it points to before switching to spec. See Null and omitted arguments.

This builds on earlier work in graphql-go/graphql by xxlv (graphql-go/graphql#696), mpenick (graphql-go/graphql#536), evulse (graphql-go/graphql#401) and chirino (graphql-go/graphql#631).

Result.ErrorsJoined combines the errors of a result into one error with errors.Join, and errors.Is and errors.As reach the errors returned by resolvers (#71).

Guides. The documentation site has a migration guide and guides for objects and fields, interfaces and unions, enums, input objects and custom scalars.

What's Changed

Features

Documentation

  • docs: allow new cases in inherited table-driven tests by @seriallink in #90
  • docs: add a documentation site built with Hugo and Hextra by @seriallink in #89
  • docs: add the project logo and a richer home page to the site by @seriallink in #91
  • docs: replace the site footer with a single compact row by @seriallink in #92
  • docs: rewrite the documentation index and add a migration guide by @seriallink in #94
  • docs: add the Schema section and the objects and fields guide by @seriallink in #95
  • docs: add the interfaces and unions guide by @seriallink in #97
  • docs: add the enums guide by @seriallink in #99
  • docs: add the input objects guide by @seriallink in #103
  • docs: add the custom scalars guide by @seriallink in #104

Maintenance

New Contributors

  • @asxxb made their first contribution in #85

Full Changelog: v0.11.0...v0.12.0

v0.11.0

Choose a tag to compare

@github-actions github-actions released this 30 Nov 20:58
ebe9bb8

Serialization modes. A new SchemaConfig.Serialization option controls how values are serialized to the built-in scalars (Int, Float, String, Boolean, ID) and to enums (#7):

  • Lenient (default): unchanged. Values that cannot be serialized still become null or are converted as well as possible, silently: "12.50" for an Int becomes 12, a valid sql.NullInt64 becomes null.
  • Strict: serializes as the GraphQL specification and graphql-js do. Values are unwrapped first (driver.Valuer; for String and ID, encoding.TextMarshaler and fmt.Stringer). A value with a valid serialization returns it, and a value without one becomes a field error, such as Int cannot represent non-integer value: "12.50".
  • Report: returns exactly the lenient result and calls OnInvalidValue wherever strict mode would respond differently, with a Kind: invalid (strict returns a field error) or corrected (strict returns another value, in StrictResult).

Enabling strict mode can change responses that are accepted today: dates become RFC 3339, and values that come out as null or wrong in lenient mode return their value. Run report mode first, review the corrected and invalid events, and only then switch to strict. See the README.

What's Changed

Features

  • feat: report or reject values that cannot be serialized by @seriallink in #83

Bug fixes

Documentation

Maintenance

New Contributors

Full Changelog: v0.10.0...v0.11.0

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 30 Nov 17:15
2cc6faa

Requires Go 1.27 or newer. gql-go raised its minimum Go version from 1.21 to 1.27 (#5). There are no API or behaviour changes: code written for graphql-go v0.8.1 keeps compiling and behaving the same way. With the default GOTOOLCHAIN=auto, the go command downloads Go 1.27 when needed. If you cannot upgrade Go yet, stay on v0.9.x, which builds with Go 1.21 and receives security fixes until Go 1.27 reaches end of support, expected in August 2027.

What's Changed

Documentation

Maintenance

  • ci: retry warming the Go proxy for up to an hour by @seriallink in #47
  • ci: remind to announce minor releases by @seriallink in #50
  • ci: release patches of older lines from release branches by @seriallink in #53
  • chore: raise the minimum Go version to 1.27 by @seriallink in #52
  • ci: scan supported release branches with govulncheck weekly by @seriallink in #55

Full Changelog: v0.9.1...v0.10.0

v0.9.1

Choose a tag to compare

@github-actions github-actions released this 30 Nov 13:06
7d00ce7

Retracted versions. v0.4.18 to v0.8.1 are tags inherited from graphql-go/graphql and declare that module path. They are now retracted: go list -m -versions hides them and go get warns. For those versions, use github.com/graphql-go/graphql.

What's Changed

Bug fixes

  • fix: build examples/httpdynamic on Windows by @seriallink in #4

Documentation

  • docs: add contributor and agent guidelines by @seriallink in #1

Maintenance

  • ci: add quality gates and a release workflow by @seriallink in #2
  • chore: add LF checkouts, CODEOWNERS and a new CONTRIBUTING guide by @seriallink in #3

New Contributors

Full Changelog: v0.9.0...v0.9.1

v0.9.0

Choose a tag to compare

@seriallink seriallink released this 26 Nov 13:26

First release of github.com/gql-go/graphql, the community-maintained continuation of graphql-go/graphql.
It ships everything merged upstream since v0.8.1 (April 2023), which was never released, under the new module path.

Migrating

The API is unchanged. Replace the import prefix:

github.com/graphql-go/graphql  ->  github.com/gql-go/graphql

New

  • Query plans and plan cache (graphql-go/graphql#740, @Nthalk): PlanQuery,
    ExecutePlan and PlanCache precompute the per-operation work (field
    collection, field definition lookup, literal argument coercion, constant
    @include/@skip) so a repeated operation only pays the per-request part.
    PlanCache is a bounded LRU with an optional Normalize mode that lets
    queries differing only in literal values share a plan. Execute keeps its
    behaviour and now runs on top of the plan internally.

Fixes

Performance

Maintenance

Thanks

To @chris-ramon and @sogko for creating and maintaining graphql-go/graphql, and to everyone whose work is in this release.