Repository navigation
July 19 2018
Breaking change
- The library now requires your app to be wrapped with the
GraphqlProviderwidget. @HofmannZ - The global
clientvariable is no longer available. Instead use theGraphqlConsumerwidget. @HofmannZ
Fixes / Enhancements
- Added the
GraphqlProviderwidget. The client is now stored in anInheritedWidget, and can be accessed anywhere within the app. @HofmannZ
Client client = GraphqlProvider.of(context).value;- Added the
GraphqlConsumerwidget. For ease of use we added a widget that uses the same builder structure as theQueryandMutationwidgets. @HofmannZ
Under the hood it access the client from the
BuildContext.
- Added the option to optionally provide the
apiTokento theClientconstructor. It is still possible to set theapiTokenwith setter method. @HofmannZ
return new GraphqlConsumer(
builder: (Client client) {
// do something with the client
return new Container();
},
);