diff --git a/.all-contributorsrc b/.all-contributorsrc index 023e90941..02c4086e1 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -15,6 +15,7 @@ "avatar_url": "https://avatars2.githubusercontent.com/u/4757453?v=4", "profile": "http://eusdima.com", "contributions": [ + "bug", "code", "doc", "example", @@ -28,10 +29,12 @@ "avatar_url": "https://avatars3.githubusercontent.com/u/17142193?v=4", "profile": "https://github.com/HofmannZ", "contributions": [ + "bug", "code", "doc", "example", "ideas", + "infra", "review" ] }, @@ -56,6 +59,19 @@ "example", "ideas" ] + }, + { + "login": "cal-pratt", + "name": "Cal Pratt", + "avatar_url": "https://avatars1.githubusercontent.com/u/7611406?v=4", + "profile": "http://stackoverflow.com/users/3280538/flkes", + "contributions": [ + "bug", + "code", + "doc", + "example", + "ideas" + ] } ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d4d752b3..631e8b4a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,13 @@ n/a #### Fixes / Enhancements -- Query: changed Timer to Timer.periodic and one minor logic tweak. +- Query: changed `Timer` to `Timer.periodic` @eusdima +- Minor logic tweak @eusdima +- Use absolute paths in the library @HofmannZ #### Docs -n/a +- Fix mutations example bug not updating star bool @cal-pratt ## [0.5.3] - July 13 2018 diff --git a/README.md b/README.md index 262e52004..fe314d171 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![version][version-badge]][package] [![MIT License][license-badge]][license] -[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors) [![PRs Welcome][prs-badge]](http://makeapullrequest.com) [![Watch on GitHub][github-watch-badge]][github-watch] @@ -230,9 +230,8 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds -| [
Eustatiu Dima](http://eusdima.com)
[💻](https://github.com/zino-app/graphql-flutter/commits?author=eusdima "Code") [📖](https://github.com/zino-app/graphql-flutter/commits?author=eusdima "Documentation") [💡](#example-eusdima "Examples") [🤔](#ideas-eusdima "Ideas, Planning, & Feedback") [👀](#review-eusdima "Reviewed Pull Requests") | [
Zino Hofmann](https://github.com/HofmannZ)
[💻](https://github.com/zino-app/graphql-flutter/commits?author=HofmannZ "Code") [📖](https://github.com/zino-app/graphql-flutter/commits?author=HofmannZ "Documentation") [💡](#example-HofmannZ "Examples") [🤔](#ideas-HofmannZ "Ideas, Planning, & Feedback") [👀](#review-HofmannZ "Reviewed Pull Requests") | [
Harkirat Saluja](https://github.com/jinxac)
[📖](https://github.com/zino-app/graphql-flutter/commits?author=jinxac "Documentation") [🤔](#ideas-jinxac "Ideas, Planning, & Feedback") | [
Chris Muthig](https://github.com/camuthig)
[💻](https://github.com/zino-app/graphql-flutter/commits?author=camuthig "Code") [📖](https://github.com/zino-app/graphql-flutter/commits?author=camuthig "Documentation") [💡](#example-camuthig "Examples") [🤔](#ideas-camuthig "Ideas, Planning, & Feedback") | -| :---: | :---: | :---: | :---: | - +| [
Eustatiu Dima](http://eusdima.com)
[🐛](https://github.com/zino-app/graphql-flutter/issues?q=author%3Aeusdima "Bug reports") [💻](https://github.com/zino-app/graphql-flutter/commits?author=eusdima "Code") [📖](https://github.com/zino-app/graphql-flutter/commits?author=eusdima "Documentation") [💡](#example-eusdima "Examples") [🤔](#ideas-eusdima "Ideas, Planning, & Feedback") [👀](#review-eusdima "Reviewed Pull Requests") | [
Zino Hofmann](https://github.com/HofmannZ)
[🐛](https://github.com/zino-app/graphql-flutter/issues?q=author%3AHofmannZ "Bug reports") [💻](https://github.com/zino-app/graphql-flutter/commits?author=HofmannZ "Code") [📖](https://github.com/zino-app/graphql-flutter/commits?author=HofmannZ "Documentation") [💡](#example-HofmannZ "Examples") [🤔](#ideas-HofmannZ "Ideas, Planning, & Feedback") [🚇](#infra-HofmannZ "Infrastructure (Hosting, Build-Tools, etc)") [👀](#review-HofmannZ "Reviewed Pull Requests") | [
Harkirat Saluja](https://github.com/jinxac)
[📖](https://github.com/zino-app/graphql-flutter/commits?author=jinxac "Documentation") [🤔](#ideas-jinxac "Ideas, Planning, & Feedback") | [
Chris Muthig](https://github.com/camuthig)
[💻](https://github.com/zino-app/graphql-flutter/commits?author=camuthig "Code") [📖](https://github.com/zino-app/graphql-flutter/commits?author=camuthig "Documentation") [💡](#example-camuthig "Examples") [🤔](#ideas-camuthig "Ideas, Planning, & Feedback") | [
Cal Pratt](http://stackoverflow.com/users/3280538/flkes)
[🐛](https://github.com/zino-app/graphql-flutter/issues?q=author%3Acal-pratt "Bug reports") [💻](https://github.com/zino-app/graphql-flutter/commits?author=cal-pratt "Code") [📖](https://github.com/zino-app/graphql-flutter/commits?author=cal-pratt "Documentation") [💡](#example-cal-pratt "Examples") [🤔](#ideas-cal-pratt "Ideas, Planning, & Feedback") | +| :---: | :---: | :---: | :---: | :---: | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome! diff --git a/lib/graphql_flutter.dart b/lib/graphql_flutter.dart index 7519186cc..83c53bd1a 100644 --- a/lib/graphql_flutter.dart +++ b/lib/graphql_flutter.dart @@ -1,9 +1,9 @@ library graphql_flutter; -export './src/client.dart'; +export 'package:graphql_flutter/src/client.dart'; -export './src/cache/in_memory.dart'; +export 'package:graphql_flutter/src/cache/in_memory.dart'; -export './src/widgets/query.dart'; -export './src/widgets/mutation.dart'; -export './src/widgets/cache_provider.dart'; +export 'package:graphql_flutter/src/widgets/query.dart'; +export 'package:graphql_flutter/src/widgets/mutation.dart'; +export 'package:graphql_flutter/src/widgets/cache_provider.dart'; diff --git a/lib/src/client.dart b/lib/src/client.dart index 8c2fae310..91b30b74c 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:http/http.dart' as http; -import './cache/in_memory.dart'; +import 'package:graphql_flutter/src/cache/in_memory.dart'; Client client; @@ -74,7 +74,8 @@ class Client { if (jsonResponse['errors'] != null && jsonResponse['errors'].length > 0) { throw new Exception( - 'Error returned by the server in the query' + jsonResponse['errors'].toString(), + 'Error returned by the server in the query' + + jsonResponse['errors'].toString(), ); } diff --git a/lib/src/widgets/cache_provider.dart b/lib/src/widgets/cache_provider.dart index 8dc9fbb4f..a6677cf1a 100644 --- a/lib/src/widgets/cache_provider.dart +++ b/lib/src/widgets/cache_provider.dart @@ -1,9 +1,10 @@ import 'package:flutter/material.dart'; -import '../client.dart'; + +import 'package:graphql_flutter/src/client.dart'; class CacheProvider extends StatefulWidget { const CacheProvider({ - Key key, + final Key key, @required this.child, }) : super(key: key); diff --git a/lib/src/widgets/mutation.dart b/lib/src/widgets/mutation.dart index 8af407947..4cc529ea4 100644 --- a/lib/src/widgets/mutation.dart +++ b/lib/src/widgets/mutation.dart @@ -1,6 +1,6 @@ import 'package:flutter/widgets.dart'; -import '../client.dart'; +import 'package:graphql_flutter/src/client.dart'; typedef void RunMutation(Map variables); @@ -16,7 +16,7 @@ typedef Widget MutationBuilder( class Mutation extends StatefulWidget { Mutation( this.mutation, { - Key key, + final Key key, @required this.builder, this.onCompleted, }) : super(key: key); diff --git a/lib/src/widgets/query.dart b/lib/src/widgets/query.dart index 1132d3c5c..b0db71693 100644 --- a/lib/src/widgets/query.dart +++ b/lib/src/widgets/query.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:flutter/widgets.dart'; -import '../client.dart'; +import 'package:graphql_flutter/src/client.dart'; typedef Widget QueryBuilder({ @required bool loading, @@ -12,7 +12,7 @@ typedef Widget QueryBuilder({ class Query extends StatefulWidget { Query( this.query, { - Key key, + final Key key, this.variables = const {}, @required this.builder, this.pollInterval, @@ -31,9 +31,10 @@ class QueryState extends State { bool loading = true; Map data = {}; String error = ''; + + bool initialFetch = false; Duration pollInterval; Timer pollTimer; - bool initialFetch = false; Map currentVariables = new Map(); @override