diff --git a/CHANGELOG.md b/CHANGELOG.md index 631e8b4a8..447b2cefc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,41 @@ +## [0.6.0] - July 19 2018 + +### Breaking change + +- The library now requires your app to be wrapped with the `GraphqlProvider` widget @HofmannZ +- The global `client` variable is no longer available. Instead use the `GraphqlConsumer` widget + +#### Fixes / Enhancements + +- Added the `GraphqlProvider` widget. The client is now stored in an `InheritedWidget`, and can be accessed anywhere within the app. + +```dart +Client client = GraphqlProvider.of(context).value; +``` + +- Added the `GraphqlConsumer` widget. For ease of use we added a widget that uses the same builder structure as the `Query` and `Mutation` widgets. + +> Under the hood it access the client from the `BuildContext`. + +- Added the option to optionally provide the `apiToken` to the `Client` constructor. It is still possible to set the `apiToken` with setter method. + +```dart + return new GraphqlConsumer( + builder: (Client client) { + // do something with the client + + return new Container(); + }, + ); +``` + +#### Docs + +- Added documentation for the new `GraphqlProvider` +- Added documentation for the new `GraphqlConsumer` +- Changed the setup instructions to include the new widgets +- Changed the example to include the new widgets + ## [0.5.4] - July 17 2018 ### Breaking change diff --git a/README.md b/README.md index 47444ff5e..aab4f280d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ First depend on the library by adding this to your packages `pubspec.yaml`: ```yaml dependencies: - graphql_flutter: ^0.5.4 + graphql_flutter: ^0.6.0 ``` Now inside your Dart code you can import it. diff --git a/pubspec.yaml b/pubspec.yaml index 38d41cf5d..b00171d8d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: graphql_flutter description: A GraphQL client for Flutter. -version: 0.5.4 +version: 0.6.0 authors: - Eus Dima - Zino Hofmann