0.4.0
Updating to 0.4.0 is going to require a few things:
- Update any references to
github.com/vektah/gqlgen
to point togithub.com/99designs/gqlgen
- Delete any existing generated code to remove broken imports paths
- Run
dep ensure -update github.com/99designs/gqlgen github.com/vektah/gqlparser
- Update your handler from
graph.NewExecutableSchema(&graph.Graph...)
tograph.NewExecutableSchema(graph.Config{Resolvers: &graph.Graph...})
go generate ./...
Removed
- The old (underscore separated) resolver syntax is no longer supported
Changed
- Moved repo from
github.com/vektah/gqlgen
togithub.com/99designs/gqlgen
- Switched the parser over to gqlparser, which brings us up to date with the June 2018 spec. This includes better directive support and a bunch of bug fixes around validation.
- The implicit prelude no longer includes custom types defined by gqlgen. This means if you are using
Map
orTime
you will need to addscalar Map
to your schema. The default implementations are still provided, but the type isn't being included automatically in the schema. - A bunch of internal interfaces have changed slightly. They should all break in fairly obvious ways.
- To support directives NewExecutableSchema now takes a config object.
- Generated models are now more linter friendly, following the same capitalization rules in go lint for common acronyms.
- ResolverMiddleware has been renamed to FieldMiddleware, and now runs on every field.
- Descriptions in introspection now need to use block syntax instead of comments, """this is a field description"""
- Custom unmarshallers need to handle json.Number to prevent loss of precision when using variables
Added
gqlgen init
: You can now create a project skeleton quickly and easilygqlgen
will now generate resolver stubs if you specify the new resolver config key.- Support for field directives in schema: This is the most common use case, more will follow. see #228 for planning for other directive types.
- Support for
@skip
and@include
- Added ability to map to different field names when binding to existing models
Fixed
- Scalars passed into array contexts will now correctly be coerced into arrays
- Variables will now have their types validated properly.
- Large ints in variables were losing precision after 52 bits due to a float bug.