This release adds support for genqlient subscriptions; see the documentation for more, and thanks to @matthieu4294967296moineau for the original implementation and @HaraldNordgren for additional testing and improvements.
Note that genqlient now requires Go 1.22.5 or higher, and is tested through Go 1.23.3.
Breaking changes:
- genqlient now forbids
omitempty: false
(including implicit behaviour) when using pointer on non-null input field. - The error text for HTTP errors has changed slightly. If you were parsing it, switch to
As
-ing tographql.HTTPError
.
New features:
- genqlient now supports subscriptions; the websocket protocol is by default
graphql-transport-ws
but can be set to another value.
See the documentation for more details on how to use subscriptions. - genqlient now supports double-star globs for schema and query files; see
genqlient.yaml
docs for more. - genqlient now generates slices containing all enum values for each enum type.
- genqlient now returns
Is
/As
-able errors when the HTTP request returns a non-200 status.
Bug fixes:
- omitempty validation:
- allow
omitempty
on non-nullable input field, if the field has a default - allow
omitempty: false
on an input field, even when it is non-nullable
- allow
- don't do
omitempty
andpointer
input types validation whenuse_struct_reference
is used, as the generated type is often not compatible with validation logic. - the
allow_broken_features
option, which no longer did anything, has been removed