Add notes about new API breaking changes

This commit is contained in:
Magnus Hallin 2016-12-28 19:15:54 +01:00
parent 853c92a0b7
commit 8f3e60a71c

View file

@ -41,6 +41,31 @@ using the macros and not deriving `GraphQLType` directly.
MyContext ...)` you will need to add `impl Context for MyContext
{}`. Simple as that.
* `Registry` and all meta type structs now takes one lifetime
parameter, which affects `GraphQLType`'s `meta` method. This only
affects people who implement the trait manually.
**How to fix:** Change the type signature of `meta()` to read `fn
meta<'r>(registry: &mut Registry<'r>) -> MetaType<'r>`.
* The type builder methods on `Registry` no longer return functions
taking types or fields. Due to how the borrow checker works with
expressions, you will have to split up the instantiation into two
statements. This only affects people who implement the `GraphQLType`
trait manually.
**How to fix:** Change the contents of your `meta()` methods to
something like this:
```rust
fn meta<'r>(registry: &mut Registry<r>) -> MetaType<'r> {
let fields = &[ /* your fields ... */ ];
registry.build_object_type::<Self>(fields).into_meta()
}
```
### Added
@ -128,6 +153,12 @@ using the macros and not deriving `GraphQLType` directly.
```
### Improvements
* Parser and query execution has now reduced the allocation overhead
by reusing as much as possible from the query source and meta type
information.
## [0.5.3] 2016-12-05
### Added