message: ci: fix automated releases

diff:
version: 2.1
aliases:
- - &docker_environment
- - image: cirrusci/flutter:latest
+ - &flutter_environment
+ - image: cirrusci/flutter:beta
+ - &node_environment
+ - image: circleci/node:10
- &restore_cache
keys:
# when lock file changes, use increasingly general patterns to restore cache
- pub-packages-v1-{{ checksum "packages/graphql/pubspec.lock" }}-{{ checksum "packages/graphql_flutter/pubspec.lock" }}
- pub-packages-v1-{{ checksum "packages/graphql/pubspec.lock" }}
- pub-packages-v1-
+ - &install_yaml_processor
+ name: Install yq yaml processor
+ command: |
+ sudo apt update && \
+ sudo apt install -y wget
+
+ wget https://github.com/mikefarah/yq/releases/download/2.3.0/yq_linux_amd64 -O ~/yq
+ sudo chmod +x ~/yq
+
+ sudo apt remove -y wget
+ - &graphql_from_path
+ name: Switch to graphql from path
+ command: |
+ cd packages/graphql_flutter
+
+ ~/yq w pubspec.yaml dependencies.graphql.path "../graphql" > patched_pubspec.yaml
+ rm pubspec.yaml
+ mv patched_pubspec.yaml pubspec.yaml
+ - &setup_github_bot
+ name: Setup Github bot
+ command: |
+ git config credential.helper 'cache --timeout=120'
+ git config user.email "github-bot@zinoapp.com"
+ git config user.name "Zino App (Github bot)"
+ - &setup_pub_credentials
+ name: Setup pub credentials
+ command: |
+ [[ ! -d ~/.pub-cache ]] && mkdir -p ~/.pub-cache
+
+ cat \<<EOF > ~/.pub-cache/credentials.json
+ {
+ "accessToken": ${PUB_ACCESS_TOKEN},
+ "refreshToken": ${PUB_REFRESH_TOKEN},
+ "tokenEndpoint": "https://accounts.google.com/o/oauth2/token",
+ "scopes": ["https://www.googleapis.com/auth/userinfo.email", "openid"],
+ "expiration": ${PUB_EXPIRATION},
+ }
+ EOF
jobs:
dependencies:
- docker: *docker_environment
+ docker: *flutter_environment
steps:
- checkout
- restore_cache: *restore_cache
+ - run: *install_yaml_processor
+ - run: *graphql_from_path
- run:
name: Install dependencies (graphql)
command: |
@@ -29,10 +71,12 @@ jobs:
paths:
- ~/.pub-cache
lint:
- docker: *docker_environment
+ docker: *flutter_environment
steps:
- checkout
- restore_cache: *restore_cache
+ - run: *install_yaml_processor
+ - run: *graphql_from_path
- run:
name: Code linting (graphql)
command: |
@@ -44,15 +88,19 @@ jobs:
cd packages/graphql_flutter
dartfmt **/*.dart -n --set-exit-if-changed
coverage:
- docker: *docker_environment
+ docker: *flutter_environment
steps:
- checkout
- restore_cache: *restore_cache
+ - run: *install_yaml_processor
+ - run: *graphql_from_path
- run:
name: Code coverage (graphql)
command: |
cd packages/graphql
- flutter test --coverage
+ pub global activate coverage
+ pub get
+ pub run test_coverage
- run:
name: Code coverage (graphql_flutter)
command: |
@@ -63,70 +111,63 @@ jobs:
command: |
bash <(curl -s https://codecov.io/bash)
release:
- docker:
- - image: circleci/node:10
+ docker: *node_environment
steps:
- checkout
- run:
name: Generate release tags
command: npx semantic-release@beta
- publish:
- docker: *docker_environment
+ sync_with_beta:
+ docker: *node_environment
steps:
- checkout
- - restore_cache: *restore_cache
- - run:
- name: Install yq yaml tool
- command: |
- sudo add-apt-repository ppa:rmescandon/yq && \
- sudo apt update && \
- sudo apt install yq -y
+ - run: *setup_github_bot
- run:
- name: Add git credentials
+ name: Sync master into beta
command: |
- git config credential.helper 'cache --timeout=120'
- git config user.email "github-bot@zino-app.com"
- git config user.name "Zino App (Github bot)"
- - run:
- name: Add pub credentials
- command: |
- [[ ! -d ~/.pub-cache ]] && mkdir -p ~/.pub-cache
-
- cat \<<EOF > ~/.pub-cache/credentials.json
- {
- "accessToken": ${PUB_ACCESS_TOKEN},
- "refreshToken": ${PUB_REFRESH_TOKEN},
- "tokenEndpoint": "https://accounts.google.com/o/oauth2/token",
- "scopes": ["https://www.googleapis.com/auth/userinfo.email", "openid"],
- "expiration": ${PUB_EXPIRATION},
- }
- EOF
+ git checkout master
+ git pull
+ git checkout beta
+ git merge master --no-commit
+ git commit --allow-empty -m "ci(Semantic release): Sync master into beta [skip ci]"
+ # Push quietly to prevent showing the token in log
+ git push -q https://${GH_TOKEN}@github.com/zino-app/graphql-flutter.git beta
+ publish:
+ docker: *flutter_environment
+ steps:
+ - checkout
+ - restore_cache: *restore_cache
+ - run: *install_yaml_processor
+ - run: *setup_github_bot
+ - run: *setup_pub_credentials
- run:
name: Patch pubspec with version (graphql)
command: |
cd packages/graphql
- cat \<<EOF > patch.yaml
- version: ${CIRCLE_TAG}
- EOF
-
- yq m pubspec.yaml patch.yaml
+ # patch version
+ ~/yq w pubspec.yaml version $CIRCLE_TAG > patched_pubspec.yaml
+ rm pubspec.yaml
+ mv patched_pubspec.yaml pubspec.yaml
- run:
name: Patch pubspec with version (graphql_flutter)
command: |
cd packages/graphql_flutter
- cat \<<EOF > patch.yaml
- version: ${CIRCLE_TAG}
- dependencies:
- graphql: ^${CIRCLE_TAG}
- EOF
+ # patch version
+ ~/yq w pubspec.yaml version $CIRCLE_TAG > patched_pubspec.yaml
+ rm pubspec.yaml
+ mv patched_pubspec.yaml pubspec.yaml
- yq m pubspec.yaml patch.yaml
+ # patch graphql dependency version
+ ~/yq w pubspec.yaml dependencies.graphql ^$CIRCLE_TAG > patched_pubspec.yaml
+ rm pubspec.yaml
+ mv patched_pubspec.yaml pubspec.yaml
- run:
name: Bump version numbers
command: |
- git commit --allow-empty -m "build: Bump version numbers (via CircleCI) [skip ci]"
+ git add packages/graphql/pubspec.yaml packages/graphql_flutter/pubspec.yaml
+ git commit --allow-empty -m "build(Pub): Bump version numbers [skip ci]"
# Push quietly to prevent showing the token in log
git push -q https://${GH_TOKEN}@github.com/zino-app/graphql-flutter.git
- run:
@@ -168,6 +209,13 @@ workflows:
only:
- master
- beta
+ - sync_with_beta:
+ requires:
+ - release
+ filters:
+ branches:
+ only:
+ - master
- publish:
requires:
- dependencies

diff:
.packages
.pub/
-pubspec.lock
build/
ios/.generated/
@@ -18,7 +17,6 @@ ios/Flutter/Generated.xcconfig
ios/Runner/GeneratedPluginRegistrant.*
.flutter-plugins
-
# Coverage
coverage.json
coverage/*

diff:
+test/.test_coverage.dart
\ No newline at end of file

diff:
+# Generated by pub
+# See https://www.dartlang.org/tools/pub/glossary#lockfile
+packages:
+ analyzer:
+ dependency: transitive
+ description:
+ name: analyzer
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.36.2"
+ args:
+ dependency: transitive
+ description:
+ name: args
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.5.1"
+ async:
+ dependency: transitive
+ description:
+ name: async
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.2.0"
+ boolean_selector:
+ dependency: transitive
+ description:
+ name: boolean_selector
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.4"
+ charcode:
+ dependency: transitive
+ description:
+ name: charcode
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.2"
+ collection:
+ dependency: transitive
+ description:
+ name: collection
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.14.11"
+ convert:
+ dependency: transitive
+ description:
+ name: convert
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.1"
+ coverage:
+ dependency: transitive
+ description:
+ name: coverage
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.12.4"
+ crypto:
+ dependency: transitive
+ description:
+ name: crypto
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.6"
+ csslib:
+ dependency: transitive
+ description:
+ name: csslib
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.16.0"
+ front_end:
+ dependency: transitive
+ description:
+ name: front_end
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.1.17"
+ glob:
+ dependency: transitive
+ description:
+ name: glob
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.7"
+ graphql_parser:
+ dependency: "direct main"
+ description:
+ name: graphql_parser
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.3"
+ html:
+ dependency: transitive
+ description:
+ name: html
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.14.0+2"
+ http:
+ dependency: "direct main"
+ description:
+ name: http
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.12.0+2"
+ http_multi_server:
+ dependency: transitive
+ description:
+ name: http_multi_server
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.6"
+ http_parser:
+ dependency: "direct main"
+ description:
+ name: http_parser
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "3.1.3"
+ io:
+ dependency: transitive
+ description:
+ name: io
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.3.3"
+ js:
+ dependency: transitive
+ description:
+ name: js
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.1+1"
+ json_annotation:
+ dependency: transitive
+ description:
+ name: json_annotation
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.2.0"
+ json_rpc_2:
+ dependency: transitive
+ description:
+ name: json_rpc_2
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0"
+ kernel:
+ dependency: transitive
+ description:
+ name: kernel
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.3.17"
+ lcov:
+ dependency: transitive
+ description:
+ name: lcov
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "4.5.0"
+ logging:
+ dependency: transitive
+ description:
+ name: logging
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.11.3+2"
+ matcher:
+ dependency: transitive
+ description:
+ name: matcher
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.12.5"
+ meta:
+ dependency: "direct main"
+ description:
+ name: meta
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.7"
+ mime:
+ dependency: "direct main"
+ description:
+ name: mime
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.9.6+2"
+ mockito:
+ dependency: "direct dev"
+ description:
+ name: mockito
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "4.0.0"
+ multi_server_socket:
+ dependency: transitive
+ description:
+ name: multi_server_socket
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.2"
+ node_preamble:
+ dependency: transitive
+ description:
+ name: node_preamble
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.4.4"
+ package_config:
+ dependency: transitive
+ description:
+ name: package_config
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.5"
+ package_resolver:
+ dependency: transitive
+ description:
+ name: package_resolver
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.10"
+ path:
+ dependency: "direct main"
+ description:
+ name: path
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.6.2"
+ pedantic:
+ dependency: transitive
+ description:
+ name: pedantic
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.5.0"
+ perfectionist:
+ dependency: "direct dev"
+ description:
+ name: perfectionist
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.0"
+ pool:
+ dependency: transitive
+ description:
+ name: pool
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.4.0"
+ pub_semver:
+ dependency: transitive
+ description:
+ name: pub_semver
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.4.2"
+ rxdart:
+ dependency: "direct main"
+ description:
+ name: rxdart
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.21.0"
+ shelf:
+ dependency: transitive
+ description:
+ name: shelf
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.7.5"
+ shelf_packages_handler:
+ dependency: transitive
+ description:
+ name: shelf_packages_handler
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.4"
+ shelf_static:
+ dependency: transitive
+ description:
+ name: shelf_static
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.8"
+ shelf_web_socket:
+ dependency: transitive
+ description:
+ name: shelf_web_socket
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.3"
+ source_map_stack_trace:
+ dependency: transitive
+ description:
+ name: source_map_stack_trace
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.5"
+ source_maps:
+ dependency: transitive
+ description:
+ name: source_maps
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.10.8"
+ source_span:
+ dependency: transitive
+ description:
+ name: source_span
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.5.5"
+ stack_trace:
+ dependency: transitive
+ description:
+ name: stack_trace
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.9.3"
+ stream_channel:
+ dependency: transitive
+ description:
+ name: stream_channel
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.0"
+ string_scanner:
+ dependency: transitive
+ description:
+ name: string_scanner
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.4"
+ term_glyph:
+ dependency: transitive
+ description:
+ name: term_glyph
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ test:
+ dependency: "direct dev"
+ description:
+ name: test
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.6.2"
+ test_api:
+ dependency: transitive
+ description:
+ name: test_api
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.5"
+ test_core:
+ dependency: transitive
+ description:
+ name: test_core
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.4"
+ test_coverage:
+ dependency: "direct dev"
+ description:
+ name: test_coverage
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.3"
+ typed_data:
+ dependency: transitive
+ description:
+ name: typed_data
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.6"
+ uuid:
+ dependency: "direct main"
+ description:
+ name: uuid
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.1"
+ vm_service_client:
+ dependency: transitive
+ description:
+ name: vm_service_client
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.6+1"
+ watcher:
+ dependency: transitive
+ description:
+ name: watcher
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.9.7+10"
+ web_socket_channel:
+ dependency: transitive
+ description:
+ name: web_socket_channel
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.12"
+ yaml:
+ dependency: transitive
+ description:
+ name: yaml
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.15"
+sdks:
+ dart: ">=2.2.0 <3.0.0"

diff:
name: graphql
-description: A stand-alone GraphQL client for Dart, bringing all the features from a modern GraphQL client to one easy to use package.
+description: A stand-alone GraphQL client for Dart, bringing all the features from
+ a modern GraphQL client to one easy to use package.
version: 1.0.1-beta
authors:
- Eus Dima <eus@zinoapp.com>
@@ -7,7 +8,6 @@ authors:
- Michael Joseph Rosenthal <rosenthalm93@gmail.com>
- TruongSinh Tran-Nguyen <i@truongsinh.pro>
homepage: https://github.com/zino-app/graphql-flutter/tree/master/packages/graphql
-
dependencies:
meta: ^1.1.6
http: ^0.12.0+2
@@ -17,11 +17,10 @@ dependencies:
uuid: ^2.0.1
graphql_parser: ^1.1.3
rxdart: ^0.21.0
-
dev_dependencies:
perfectionist: ^2.0.0
mockito: ^4.0.0
test: ^1.5.3
-
+ test_coverage: ^0.2.0
environment:
- sdk: ">=2.1.0 <3.0.0"
+ sdk: '>=2.2.0 <3.0.0'

diff:
+# Generated by pub
+# See https://www.dartlang.org/tools/pub/glossary#lockfile
+packages:
+ analyzer:
+ dependency: transitive
+ description:
+ name: analyzer
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.36.2"
+ args:
+ dependency: transitive
+ description:
+ name: args
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.5.1"
+ async:
+ dependency: transitive
+ description:
+ name: async
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0"
+ boolean_selector:
+ dependency: transitive
+ description:
+ name: boolean_selector
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.4"
+ charcode:
+ dependency: transitive
+ description:
+ name: charcode
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.2"
+ collection:
+ dependency: transitive
+ description:
+ name: collection
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.14.11"
+ convert:
+ dependency: transitive
+ description:
+ name: convert
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.1"
+ crypto:
+ dependency: transitive
+ description:
+ name: crypto
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.6"
+ csslib:
+ dependency: transitive
+ description:
+ name: csslib
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.16.0"
+ flutter:
+ dependency: "direct main"
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ flutter_test:
+ dependency: "direct dev"
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ front_end:
+ dependency: transitive
+ description:
+ name: front_end
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.1.17"
+ glob:
+ dependency: transitive
+ description:
+ name: glob
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.7"
+ graphql:
+ dependency: "direct main"
+ description:
+ name: graphql
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.1-beta"
+ graphql_parser:
+ dependency: transitive
+ description:
+ name: graphql_parser
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.3"
+ html:
+ dependency: transitive
+ description:
+ name: html
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.14.0+2"
+ http:
+ dependency: transitive
+ description:
+ name: http
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.12.0+2"
+ http_multi_server:
+ dependency: transitive
+ description:
+ name: http_multi_server
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.6"
+ http_parser:
+ dependency: transitive
+ description:
+ name: http_parser
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "3.1.3"
+ io:
+ dependency: transitive
+ description:
+ name: io
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.3.3"
+ js:
+ dependency: transitive
+ description:
+ name: js
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.1+1"
+ json_rpc_2:
+ dependency: transitive
+ description:
+ name: json_rpc_2
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0"
+ kernel:
+ dependency: transitive
+ description:
+ name: kernel
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.3.17"
+ matcher:
+ dependency: transitive
+ description:
+ name: matcher
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.12.5"
+ meta:
+ dependency: "direct main"
+ description:
+ name: meta
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.6"
+ mime:
+ dependency: transitive
+ description:
+ name: mime
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.9.6+2"
+ mockito:
+ dependency: "direct dev"
+ description:
+ name: mockito
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "4.0.0"
+ multi_server_socket:
+ dependency: transitive
+ description:
+ name: multi_server_socket
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.2"
+ node_preamble:
+ dependency: transitive
+ description:
+ name: node_preamble
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.4.4"
+ package_config:
+ dependency: transitive
+ description:
+ name: package_config
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.5"
+ package_resolver:
+ dependency: transitive
+ description:
+ name: package_resolver
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.10"
+ path:
+ dependency: "direct main"
+ description:
+ name: path
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.6.2"
+ path_provider:
+ dependency: "direct main"
+ description:
+ name: path_provider
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.5.0+1"
+ pedantic:
+ dependency: transitive
+ description:
+ name: pedantic
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.5.0"
+ perfectionist:
+ dependency: "direct dev"
+ description:
+ name: perfectionist
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.0"
+ pool:
+ dependency: transitive
+ description:
+ name: pool
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.4.0"
+ pub_semver:
+ dependency: transitive
+ description:
+ name: pub_semver
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.4.2"
+ quiver:
+ dependency: transitive
+ description:
+ name: quiver
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.2"
+ rxdart:
+ dependency: "direct main"
+ description:
+ name: rxdart
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.21.0"
+ shelf:
+ dependency: transitive
+ description:
+ name: shelf
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.7.5"
+ shelf_packages_handler:
+ dependency: transitive
+ description:
+ name: shelf_packages_handler
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.4"
+ shelf_static:
+ dependency: transitive
+ description:
+ name: shelf_static
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.8"
+ shelf_web_socket:
+ dependency: transitive
+ description:
+ name: shelf_web_socket
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.3"
+ sky_engine:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.99"
+ source_map_stack_trace:
+ dependency: transitive
+ description:
+ name: source_map_stack_trace
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.5"
+ source_maps:
+ dependency: transitive
+ description:
+ name: source_maps
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.10.8"
+ source_span:
+ dependency: transitive
+ description:
+ name: source_span
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.5.5"
+ stack_trace:
+ dependency: transitive
+ description:
+ name: stack_trace
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.9.3"
+ stream_channel:
+ dependency: transitive
+ description:
+ name: stream_channel
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.0"
+ string_scanner:
+ dependency: transitive
+ description:
+ name: string_scanner
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.4"
+ term_glyph:
+ dependency: transitive
+ description:
+ name: term_glyph
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ test:
+ dependency: "direct dev"
+ description:
+ name: test
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.6.1"
+ test_api:
+ dependency: transitive
+ description:
+ name: test_api
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.4"
+ test_core:
+ dependency: transitive
+ description:
+ name: test_core
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.3"
+ typed_data:
+ dependency: transitive
+ description:
+ name: typed_data
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.6"
+ uuid:
+ dependency: transitive
+ description:
+ name: uuid
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.1"
+ vector_math:
+ dependency: transitive
+ description:
+ name: vector_math
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.8"
+ vm_service_client:
+ dependency: transitive
+ description:
+ name: vm_service_client
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.2.6+1"
+ watcher:
+ dependency: transitive
+ description:
+ name: watcher
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.9.7+10"
+ web_socket_channel:
+ dependency: transitive
+ description:
+ name: web_socket_channel
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.12"
+ yaml:
+ dependency: transitive
+ description:
+ name: yaml
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.15"
+sdks:
+ dart: ">=2.2.0 <3.0.0"
+ flutter: ">=0.1.4 <2.0.0"

diff:
name: graphql_flutter
-description: A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
+description: A GraphQL client for Flutter, bringing all the features from a modern
+ GraphQL client to one easy to use package.
version: 1.0.1-beta
authors:
- Eus Dima <eus@zinoapp.com>
- Zino Hofmann <zino@zinoapp.com>
- Michael Joseph Rosenthal <rosenthalm93@gmail.com>
-
homepage: https://github.com/zino-app/graphql-flutter/tree/master/packages/graphql_flutter
-
dependencies:
graphql: ^1.0.1-beta
flutter:
@@ -16,13 +15,11 @@ dependencies:
path: ^1.6.2
path_provider: ^0.5.0+1
rxdart: ^0.21.0
-
dev_dependencies:
perfectionist: ^2.0.0
mockito: ^4.0.0
flutter_test:
sdk: flutter
test: ^1.5.3
-
environment:
- sdk: ">=2.1.0 <3.0.0"
+ sdk: '>=2.2.0 <3.0.0'

original_message: ci: fix automated releases


message: ci: disable flutter tests, since they are missing

change_type: MODIFY

diff:
@@ -101,11 +101,11 @@ jobs:
pub global activate coverage
pub get
pub run test_coverage
- - run:
- name: Code coverage (graphql_flutter)
- command: |
- cd packages/graphql_flutter
- flutter test --coverage
+ # - run:
+ # name: Code coverage (graphql_flutter)
+ # command: |
+ # cd packages/graphql_flutter
+ # flutter test --coverage
- run:
name: Upload coverage
command: |

license: MIT License

repo: zino-hofmann/graphql-flutter


message: fix: derive the branch from version tag

diff:
@@ -60,7 +60,7 @@ jobs:
name: Install dependencies (graphql)
command: |
cd packages/graphql
- flutter packages get
+ pub get
- run:
name: Install dependencies (graphql_flutter)
command: |
@@ -146,7 +146,7 @@ jobs:
cd packages/graphql
# patch version
- ~/yq w pubspec.yaml version $CIRCLE_TAG > patched_pubspec.yaml
+ ~/yq w pubspec.yaml version ${CIRCLE_TAG%"@beta"} > patched_pubspec.yaml
rm pubspec.yaml
mv patched_pubspec.yaml pubspec.yaml
- run:
@@ -155,21 +155,25 @@ jobs:
cd packages/graphql_flutter
# patch version
- ~/yq w pubspec.yaml version $CIRCLE_TAG > patched_pubspec.yaml
+ ~/yq w pubspec.yaml version ${CIRCLE_TAG%"@beta"} > patched_pubspec.yaml
rm pubspec.yaml
mv patched_pubspec.yaml pubspec.yaml
# patch graphql dependency version
- ~/yq w pubspec.yaml dependencies.graphql ^$CIRCLE_TAG > patched_pubspec.yaml
+ ~/yq w pubspec.yaml dependencies.graphql ^${CIRCLE_TAG%"@beta"} > patched_pubspec.yaml
rm pubspec.yaml
mv patched_pubspec.yaml pubspec.yaml
- run:
name: Bump version numbers
command: |
+ if [[ $CIRCLE_TAG =~ ^.*@beta.*$ ]]; then BRANCH=beta; else BRANCH=master; fi
+ git checkout $BRANCH
+
git add packages/graphql/pubspec.yaml packages/graphql_flutter/pubspec.yaml
git commit --allow-empty -m "build(Pub): Bump version numbers [skip ci]"
+
# Push quietly to prevent showing the token in log
- git push -q https://${GH_TOKEN}@github.com/zino-app/graphql-flutter.git
+ git push -q https://${GH_TOKEN}@github.com/zino-app/graphql-flutter.git $BRANCH
- run:
name: Pub deployment (graphql)
command: |

original_message: fix: derive the branch from version tag


message: fix: strip `v` from version tag

diff:
@@ -145,8 +145,11 @@ jobs:
command: |
cd packages/graphql
+ VERSION=${CIRCLE_TAG%"@beta"}
+ VERSION=${CIRCLE_TAG#"v"}
+
# patch version
- ~/yq w pubspec.yaml version ${CIRCLE_TAG%"@beta"} > patched_pubspec.yaml
+ ~/yq w pubspec.yaml version $VERSION > patched_pubspec.yaml
rm pubspec.yaml
mv patched_pubspec.yaml pubspec.yaml
- run:
@@ -154,13 +157,16 @@ jobs:
command: |
cd packages/graphql_flutter
+ VERSION=${CIRCLE_TAG%"@beta"}
+ VERSION=${CIRCLE_TAG#"v"}
+
# patch version
- ~/yq w pubspec.yaml version ${CIRCLE_TAG%"@beta"} > patched_pubspec.yaml
+ ~/yq w pubspec.yaml version $VERSION > patched_pubspec.yaml
rm pubspec.yaml
mv patched_pubspec.yaml pubspec.yaml
# patch graphql dependency version
- ~/yq w pubspec.yaml dependencies.graphql ^${CIRCLE_TAG%"@beta"} > patched_pubspec.yaml
+ ~/yq w pubspec.yaml dependencies.graphql ^$VERSION > patched_pubspec.yaml
rm pubspec.yaml
mv patched_pubspec.yaml pubspec.yaml
- run:

original_message: fix: strip `v` from version tag


message: fix(hotfix): remove the `v` from versions

diff:
name: graphql
description: A stand-alone GraphQL client for Dart, bringing all the features from
a modern GraphQL client to one easy to use package.
-version: v1.0.1-beta.2
+version: 1.0.1-beta.2
authors:
- Eus Dima <eus@zinoapp.com>
- Zino Hofmann <zino@zinoapp.com>

diff:
name: graphql_flutter
description: A GraphQL client for Flutter, bringing all the features from a modern
GraphQL client to one easy to use package.
-version: v1.0.1-beta.2
+version: 1.0.1-beta.2
authors:
- Eus Dima <eus@zinoapp.com>
- Zino Hofmann <zino@zinoapp.com>
- Michael Joseph Rosenthal <rosenthalm93@gmail.com>
homepage: https://github.com/zino-app/graphql-flutter/tree/master/packages/graphql_flutter
dependencies:
- graphql: ^v1.0.1-beta.2
+ graphql: ^1.0.1-beta.2
flutter:
sdk: flutter
meta: ^1.1.6


message: chore: include a licence in the root of the project

change_type: ADD

new_path: LICENSE

diff:
+MIT License
+
+Copyright (c) 2018-present, Zino App B.V.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file


message: fix(hotfix): fix version concatination

diff:
@@ -146,7 +146,7 @@ jobs:
cd packages/graphql
VERSION=${CIRCLE_TAG%"@beta"}
- VERSION=${CIRCLE_TAG#"v"}
+ VERSION=${VERSION#"v"}
# patch version
~/yq w pubspec.yaml version $VERSION > patched_pubspec.yaml
@@ -158,7 +158,7 @@ jobs:
cd packages/graphql_flutter
VERSION=${CIRCLE_TAG%"@beta"}
- VERSION=${CIRCLE_TAG#"v"}
+ VERSION=${VERSION#"v"}
# patch version
~/yq w pubspec.yaml version $VERSION > patched_pubspec.yaml

diff:
name: graphql
description: A stand-alone GraphQL client for Dart, bringing all the features from
a modern GraphQL client to one easy to use package.
-version: 1.0.1-beta.3@beta
+version: 1.0.1-beta.3
authors:
- Eus Dima <eus@zinoapp.com>
- Zino Hofmann <zino@zinoapp.com>

diff:
name: graphql_flutter
description: A GraphQL client for Flutter, bringing all the features from a modern
GraphQL client to one easy to use package.
-version: 1.0.1-beta.3@beta
+version: 1.0.1-beta.3
authors:
- Eus Dima <eus@zinoapp.com>
- Zino Hofmann <zino@zinoapp.com>
- Michael Joseph Rosenthal <rosenthalm93@gmail.com>
homepage: https://github.com/zino-app/graphql-flutter/tree/master/packages/graphql_flutter
dependencies:
- graphql: ^1.0.1-beta.3@beta
+ graphql: ^1.0.1-beta.3
flutter:
sdk: flutter
meta: ^1.1.6

original_message: fix(hotfix): fix version concatination


message: ci: ignore lint and coverage steps fortags

diff:
@@ -202,13 +202,13 @@ workflows:
- dependencies
filters:
tags:
- only: /^.*$/
+ ignore: /^.*$/
- coverage:
requires:
- dependencies
filters:
tags:
- only: /^.*$/
+ ignore: /^.*$/
- release:
requires:
- dependencies
@@ -229,8 +229,6 @@ workflows:
- publish:
requires:
- dependencies
- - lint
- - coverage
filters:
tags:
only: /^.*$/


message: fix(hotfix): wrong json format

diff:
@@ -45,7 +45,7 @@ aliases:
"refreshToken": ${PUB_REFRESH_TOKEN},
"tokenEndpoint": "https://accounts.google.com/o/oauth2/token",
"scopes": ["https://www.googleapis.com/auth/userinfo.email", "openid"],
- "expiration": ${PUB_EXPIRATION},
+ "expiration": ${PUB_EXPIRATION}
}
EOF
jobs:

original_message: fix(hotfix): wrong json format


message: fix(hotfix): change to the correct directory

diff:
@@ -188,7 +188,7 @@ jobs:
- run:
name: Pub deployment (graphql_flutter)
command: |
- cd packages/graphql
+ cd packages/graphql_flutter
pub publish -f
workflows:
default:


message: fix: pubspec

diff:
@@ -9,8 +9,7 @@ authors:
- Michael Joseph Rosenthal <rosenthalm93@gmail.com>
homepage: https://github.com/zino-app/graphql-flutter/tree/master/packages/graphql_flutter
dependencies:
- graphql:
- path: ../graphql #^1.0.1-beta.7
+ graphql: ^1.0.1-beta.7
flutter:
sdk: flutter
meta: ^1.1.6

original_message: fix: pubspec


message: docs: add changelog and refrence the gh releases

diff:
+See [GitHub Releases](https://github.com/zino-app/graphql-flutter/releases).
+
### [1.0.1-beta] - April 27 2019
We now have a (beta) stand-alone client!
For those who want to try it out, checkout the [`graphql/client.dart` 1.0.1-beta](https://pub.dartlang.org/packages/graphql/versions/1.0.1-beta).
-
### [1.0.0+4] - April 23 2019
Fix dart 2.3 compilation issue @mateusfsilva
@@ -13,10 +14,8 @@ Fix dart 2.3 compilation issue @mateusfsilva
_Actually_ Fixes for some minor linting issues, as well as a stack overflow edgecase with complex cache structures
-
#### [1.0.0+2] - April 22 2019
-
## [1.0.0+1] - April 21 2019
Most changes here are from @micimize in #199
@@ -43,11 +42,11 @@ Most changes here are from @micimize in #199
- Added `optimistic` attribute `QueryResult` itself for lifecycle management.
#### Docs
-* `LazyCacheMap` usage and reasoning
-* Optimism section. differences between `result.optimistic` and `LazyCacheMap.isOptimistic`
-* `update`, `onCompleted` usage/existence
-* `refetch` usage/existence
+- `LazyCacheMap` usage and reasoning
+- Optimism section. differences between `result.optimistic` and `LazyCacheMap.isOptimistic`
+- `update`, `onCompleted` usage/existence
+- `refetch` usage/existence
## [1.0.0-beta.1+1] - February 16 2019


message: chore: add missing pubspec files

diff:
@@ -49,7 +49,7 @@ packages:
path: ".."
relative: true
source: path
- version: "1.0.1-beta.4"
+ version: "1.0.1-beta.8"
graphql_parser:
dependency: transitive
description:

diff:
@@ -7,7 +7,7 @@ packages:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
- version: "0.36.2"
+ version: "0.36.3"
args:
dependency: transitive
description:
@@ -77,7 +77,7 @@ packages:
name: front_end
url: "https://pub.dartlang.org"
source: hosted
- version: "0.1.17"
+ version: "0.1.18"
glob:
dependency: transitive
description:
@@ -140,7 +140,7 @@ packages:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
- version: "2.2.0"
+ version: "2.4.0"
json_rpc_2:
dependency: transitive
description:
@@ -154,7 +154,7 @@ packages:
name: kernel
url: "https://pub.dartlang.org"
source: hosted
- version: "0.3.17"
+ version: "0.3.18"
lcov:
dependency: transitive
description:
@@ -238,7 +238,7 @@ packages:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
- version: "1.5.0"
+ version: "1.7.0"
perfectionist:
dependency: "direct dev"
description:
@@ -350,7 +350,7 @@ packages:
name: test
url: "https://pub.dartlang.org"
source: hosted
- version: "1.6.2"
+ version: "1.6.3"
test_api:
dependency: transitive
description:
@@ -364,7 +364,7 @@ packages:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
- version: "0.2.4"
+ version: "0.2.5"
test_coverage:
dependency: "direct dev"
description:
@@ -392,7 +392,7 @@ packages:
name: vm_service_client
url: "https://pub.dartlang.org"
source: hosted
- version: "0.2.6+1"
+ version: "0.2.6+2"
watcher:
dependency: transitive
description:

diff:
@@ -7,7 +7,7 @@ packages:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
- version: "0.36.2"
+ version: "0.36.3"
args:
dependency: transitive
description:
@@ -80,7 +80,7 @@ packages:
name: front_end
url: "https://pub.dartlang.org"
source: hosted
- version: "0.1.17"
+ version: "0.1.18"
glob:
dependency: transitive
description:
@@ -91,10 +91,10 @@ packages:
graphql:
dependency: "direct main"
description:
- path: "../graphql"
- relative: true
- source: path
- version: "1.0.1-beta.7"
+ name: graphql
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.1-beta.8"
graphql_parser:
dependency: transitive
description:
@@ -157,7 +157,7 @@ packages:
name: kernel
url: "https://pub.dartlang.org"
source: hosted
- version: "0.3.17"
+ version: "0.3.18"
matcher:
dependency: transitive
description:
@@ -400,7 +400,7 @@ packages:
name: vm_service_client
url: "https://pub.dartlang.org"
source: hosted
- version: "0.2.6+1"
+ version: "0.2.6+2"
watcher:
dependency: transitive
description:

original_message: chore: add missing pubspec files


message: chore: add missing generated files

diff:
+package io.flutter.plugins;
+
+import io.flutter.plugin.common.PluginRegistry;
+
+/**
+ * Generated file. Do not edit.
+ */
+public final class GeneratedPluginRegistrant {
+ public static void registerWith(PluginRegistry registry) {
+ if (alreadyRegisteredWith(registry)) {
+ return;
+ }
+ }
+
+ private static boolean alreadyRegisteredWith(PluginRegistry registry) {
+ final String key = GeneratedPluginRegistrant.class.getCanonicalName();
+ if (registry.hasPlugin(key)) {
+ return true;
+ }
+ registry.registrarFor(key);
+ return false;
+ }
+}

diff:
+//
+// Generated file. Do not edit.
+//
+
+#ifndef GeneratedPluginRegistrant_h
+#define GeneratedPluginRegistrant_h
+
+#import <Flutter/Flutter.h>
+
+@interface GeneratedPluginRegistrant : NSObject
++ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
+@end
+
+#endif /* GeneratedPluginRegistrant_h */

diff:
+//
+// Generated file. Do not edit.
+//
+
+#import "GeneratedPluginRegistrant.h"
+
+@implementation GeneratedPluginRegistrant
+
++ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
+}
+
+@end

original_message: chore: add missing generated files


message: ci: upgrade yaml tool

diff:
@@ -16,7 +16,7 @@ aliases:
sudo apt update && \
sudo apt install -y wget
- wget https://github.com/mikefarah/yq/releases/download/2.3.0/yq_linux_amd64 -O ~/yq
+ wget https://github.com/mikefarah/yq/releases/download/2.4.0/yq_linux_amd64 -O ~/yq
sudo chmod +x ~/yq
sudo apt remove -y wget

original_message: ci: upgrade yaml tool


message: ci: also commit the updated `pubspec.lock`

diff:
@@ -176,6 +176,7 @@ jobs:
git checkout $BRANCH
git add packages/graphql/pubspec.yaml packages/graphql_flutter/pubspec.yaml
+ git add packages/graphql/pubspec.lock packages/graphql_flutter/pubspec.lock
git commit --allow-empty -m "build(Pub): Bump version numbers [skip ci]"
# Push quietly to prevent showing the token in log


message: fix: wait for all subscription to cancel

diff:
@@ -221,7 +221,7 @@ class ObservableQuery {
}
for (StreamSubscription<QueryResult> subscription in _onDataSubscriptions) {
- subscription.cancel();
+ await subscription.cancel();
}
stopPolling();


message: docs: update readme files

diff:
[![MIT License][license-badge]][license-link]
[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg)](#contributors)
[![PRs Welcome][prs-badge]](http://makeapullrequest.com)
+[![Discord](https://img.shields.io/discord/559455668810153989.svg)](https://discord.gg/tXTtBfC)
+[![Watch on GitHub](https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=flat&logo=github&label=Watchers)](https://github.com/zino-app/graphql-flutter)
+[![Star on GitHub](https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=flat&logo=github&label=Stars)](https://github.com/zino-app/graphql-flutter)
-[![Watch on GitHub](https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Watchers)](https://github.com/zino-app/graphql-flutter)
-[![Star on GitHub](https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Stars)](https://github.com/zino-app/graphql-flutter)
-[![Discord](https://img.shields.io/discord/559455668810153989.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/tXTtBfC)
-
-## GraphQL Flutter
-
-[![Build Status][build-status-badge]][build-status-link]
-[![Coverage][coverage-badge]][coverage-link]
+# GraphQL Flutter
## About this project
@@ -21,6 +17,9 @@ The project took inspiration from the [Apollo GraphQL client](https://github.com
## Packages
+[![Coverage][coverage-badge]][coverage-link]
+[![Build Status][build-status-badge]][build-status-link]
+
This is a Monorepo which contains the following packages:
| Package | Pub |
@@ -66,13 +65,13 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!
-[build-status-badge]: https://circleci.com/gh/zino-app/graphql-flutter/tree/beta.svg?style=svg
-[build-status-link]: https://circleci.com/gh/zino-app/graphql-flutter/tree/beta
-[coverage-badge]: https://codecov.io/gh/zino-app/graphql-flutter/branch/beta/graph/badge.svg
+[build-status-badge]: https://img.shields.io/circleci/build/github/zino-app/graphql-flutter.svg
+[build-status-link]: https://circleci.com/gh/zino-app/graphql-flutter
+[coverage-badge]: https://img.shields.io/codecov/c/github/zino-app/graphql-flutter.svg
[coverage-link]: https://codecov.io/gh/zino-app/graphql-flutter
[version-badge]: https://img.shields.io/pub/v/graphql_flutter.svg
[package-link]: https://pub.dartlang.org/packages/graphql_flutter
-[package-link-client]: https://pub.dartlang.org/packages/graphql/versions/1.0.1-beta.7
+[package-link-client]: https://pub.dartlang.org/packages/graphql
[license-badge]: https://img.shields.io/github/license/zino-app/graphql-flutter.svg
[license-link]: https://github.com/zino-app/graphql-flutter/blob/master/LICENSE
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg

diff:
# GraphQL Client
-[![Build Status][build-status-badge]][build-status-link]
-[![Coverage][coverage-badge]][coverage-link]
-[![version][version-badge]][package-link]
[![MIT License][license-badge]][license-link]
-[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg)][contributors-link]
+[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg)](#contributors)
[![PRs Welcome][prs-badge]](http://makeapullrequest.com)
+[![Discord](https://img.shields.io/discord/559455668810153989.svg)](https://discord.gg/tXTtBfC)
+[![Watch on GitHub](https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=flat&logo=github&label=Watchers)](https://github.com/zino-app/graphql-flutter)
+[![Star on GitHub](https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=flat&logo=github&label=Stars)](https://github.com/zino-app/graphql-flutter)
-[![Watch on GitHub](https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Watchers)](https://github.com/felangel/bloc)
-[![Star on GitHub](https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Stars)](https://github.com/felangel/bloc)
-[![Discord](https://img.shields.io/discord/559455668810153989.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/tXTtBfC)
+[![Coverage][coverage-badge]][coverage-link]
+[![Build Status][build-status-badge]][build-status-link]
+[![version][version-badge]][package-link]
## Installation
@@ -56,7 +56,6 @@ final GraphQLClient _client = GraphQLClient(
Once you have initialized a client, you can run queries and mutations.
-
### Query
Creating a query is as simple as creating a multiline string:
@@ -166,12 +165,12 @@ if (isStarrred) {
...
```
-[build-status-badge]: https://api.cirrus-ci.com/github/truongsinh/graphql-flutter.svg
-[build-status-link]: https://cirrus-ci.com/github/truongsinh/dart-uuid/master
-[coverage-badge]: https://codecov.io/gh/truongsinh/graphql-flutter/branch/master/graph/badge.svg
-[coverage-link]: https://codecov.io/gh/truongsinh/graphql-flutter
+[build-status-badge]: https://img.shields.io/circleci/build/github/zino-app/graphql-flutter.svg
+[build-status-link]: https://circleci.com/gh/zino-app/graphql-flutter
+[coverage-badge]: https://img.shields.io/codecov/c/github/zino-app/graphql-flutter.svg
+[coverage-link]: https://codecov.io/gh/zino-app/graphql-flutter
[version-badge]: https://img.shields.io/pub/v/graphql.svg
-[package-link]: https://pub.dartlang.org/packages/graphql/versions/1.0.1-beta.4
+[package-link]: https://pub.dartlang.org/packages/graphql
[license-badge]: https://img.shields.io/github/license/zino-app/graphql-flutter.svg
[license-link]: https://github.com/zino-app/graphql-flutter/blob/master/LICENSE
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg

original_message: docs: update readme files


message:
update README in the main repo and in each package:
build status and code coverage
"all contributors". Btw,

diff:
@@ -166,10 +166,10 @@ if (isStarrred) {
...
```
-[build-status-badge]: https://api.cirrus-ci.com/github/truongsinh/graphql-flutter.svg
-[build-status-link]: https://cirrus-ci.com/github/truongsinh/dart-uuid/master
-[coverage-badge]: https://codecov.io/gh/truongsinh/graphql-flutter/branch/master/graph/badge.svg
-[coverage-link]: https://codecov.io/gh/truongsinh/graphql-flutter
+[build-status-badge]: https://circleci.com/gh/zino-app/graphql-flutter/tree/master.svg?style=svg
+[build-status-link]: https://circleci.com/gh/zino-app/graphql-flutter/
+[coverage-badge]: https://codecov.io/gh/zino-app/graphql-flutter/branch/master/graph/badge.svg
+[coverage-link]: https://codecov.io/gh/zino-app/graphql-flutter
[version-badge]: https://img.shields.io/pub/v/graphql.svg
[package-link]: https://pub.dartlang.org/packages/graphql/versions/1.0.1-beta.4
[license-badge]: https://img.shields.io/github/license/zino-app/graphql-flutter.svg

original_message:
update README in the main repo and in each package:
- build status and code coverage
- "all contributors". Btw, https://allcontributors.org/docs/en/bot/overview


message: first widget test for `graphql_flutter` package

diff:
@@ -101,15 +101,16 @@ jobs:
pub global activate coverage
pub get
pub run test_coverage
- # - run:
- # name: Code coverage (graphql_flutter)
- # command: |
- # cd packages/graphql_flutter
- # flutter test --coverage
+ - run:
+ name: Code coverage (graphql_flutter)
+ command: |
+ cd packages/graphql_flutter
+ flutter test --coverage
- run:
name: Upload coverage
command: |
- bash <(curl -s https://codecov.io/bash)
+ bash <(curl -s https://codecov.io/bash) -F graphql_flutter
+ bash <(curl -s https://codecov.io/bash) -F graphql_client
release:
docker: *node_environment
steps:

diff:
+flags:
+ graphql_flutter:
+ paths:
+ - packages/graphql_flutter/
+ graphql_client:
+ paths:
+ - packages/graphql/

diff:
@@ -17,7 +17,7 @@ class GraphQLConsumer extends StatelessWidget {
@override
Widget build(BuildContext context) {
/// Gets the client from the closest wrapping [GraphQLProvider].
- final GraphQLClient client = GraphQLProvider.of(context).value;
+ final GraphQLClient client = GraphQLProvider.of(context)?.value;
assert(client != null);
return builder(client);

diff:
@@ -16,7 +16,7 @@ class GraphQLProvider extends StatefulWidget {
final _InheritedGraphQLProvider inheritedGraphqlProvider =
_InheritedGraphQLProvider.of(context);
- return inheritedGraphqlProvider.client;
+ return inheritedGraphqlProvider?.client;
}
@override

diff:
+import 'package:flutter_test/flutter_test.dart';
+
+import 'package:graphql_flutter/src/widgets/graphql_consumer.dart'
+ show GraphQLConsumer;
+
+void main() {
+ group('GraphQLConsumer', () {
+ testWidgets('raises assertion error because of lack of GraphQLProvider',
+ (WidgetTester tester) async {
+ await tester.pumpWidget(const GraphQLConsumer(builder: null));
+ expect(tester.takeException(), isAssertionError);
+ });
+ });
+}


message: ignore and remove `pubspec.lock`

old_path: .gitignore

new_path: .gitignore

diff:
@@ -16,6 +16,7 @@ ios/.generated/
ios/Flutter/Generated.xcconfig
ios/Runner/GeneratedPluginRegistrant.*
.flutter-plugins
+pubspec.lock
# Coverage
coverage.json

change_type: DELETE

diff:
-# Generated by pub
-# See https://www.dartlang.org/tools/pub/glossary#lockfile
-packages:
- analyzer:
- dependency: transitive
- description:
- name: analyzer
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.36.3"
- args:
- dependency: transitive
- description:
- name: args
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.5.1"
- async:
- dependency: transitive
- description:
- name: async
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.2.0"
- boolean_selector:
- dependency: transitive
- description:
- name: boolean_selector
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.4"
- charcode:
- dependency: transitive
- description:
- name: charcode
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.2"
- collection:
- dependency: transitive
- description:
- name: collection
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.14.11"
- convert:
- dependency: transitive
- description:
- name: convert
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.1.1"
- coverage:
- dependency: transitive
- description:
- name: coverage
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.12.4"
- crypto:
- dependency: transitive
- description:
- name: crypto
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.6"
- csslib:
- dependency: transitive
- description:
- name: csslib
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.16.0"
- front_end:
- dependency: transitive
- description:
- name: front_end
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.1.18"
- glob:
- dependency: transitive
- description:
- name: glob
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.7"
- graphql_parser:
- dependency: "direct main"
- description:
- name: graphql_parser
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.3"
- html:
- dependency: transitive
- description:
- name: html
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.14.0+2"
- http:
- dependency: "direct main"
- description:
- name: http
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.12.0+2"
- http_multi_server:
- dependency: transitive
- description:
- name: http_multi_server
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.6"
- http_parser:
- dependency: "direct main"
- description:
- name: http_parser
- url: "https://pub.dartlang.org"
- source: hosted
- version: "3.1.3"
- io:
- dependency: transitive
- description:
- name: io
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.3.3"
- js:
- dependency: transitive
- description:
- name: js
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.6.1+1"
- json_annotation:
- dependency: transitive
- description:
- name: json_annotation
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.4.0"
- json_rpc_2:
- dependency: transitive
- description:
- name: json_rpc_2
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.1.0"
- kernel:
- dependency: transitive
- description:
- name: kernel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.3.18"
- lcov:
- dependency: transitive
- description:
- name: lcov
- url: "https://pub.dartlang.org"
- source: hosted
- version: "4.5.0"
- logging:
- dependency: transitive
- description:
- name: logging
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.11.3+2"
- matcher:
- dependency: transitive
- description:
- name: matcher
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.12.5"
- meta:
- dependency: "direct main"
- description:
- name: meta
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.7"
- mime:
- dependency: "direct main"
- description:
- name: mime
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.9.6+2"
- mockito:
- dependency: "direct dev"
- description:
- name: mockito
- url: "https://pub.dartlang.org"
- source: hosted
- version: "4.0.0"
- multi_server_socket:
- dependency: transitive
- description:
- name: multi_server_socket
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.2"
- node_preamble:
- dependency: transitive
- description:
- name: node_preamble
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.4.4"
- package_config:
- dependency: transitive
- description:
- name: package_config
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.5"
- package_resolver:
- dependency: transitive
- description:
- name: package_resolver
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.10"
- path:
- dependency: "direct main"
- description:
- name: path
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.6.2"
- pedantic:
- dependency: "direct dev"
- description:
- name: pedantic
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.7.0"
- pool:
- dependency: transitive
- description:
- name: pool
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.4.0"
- pub_semver:
- dependency: transitive
- description:
- name: pub_semver
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.4.2"
- rxdart:
- dependency: "direct main"
- description:
- name: rxdart
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.22.0"
- shelf:
- dependency: transitive
- description:
- name: shelf
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.7.5"
- shelf_packages_handler:
- dependency: transitive
- description:
- name: shelf_packages_handler
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.4"
- shelf_static:
- dependency: transitive
- description:
- name: shelf_static
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.8"
- shelf_web_socket:
- dependency: transitive
- description:
- name: shelf_web_socket
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.3"
- source_map_stack_trace:
- dependency: transitive
- description:
- name: source_map_stack_trace
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.5"
- source_maps:
- dependency: transitive
- description:
- name: source_maps
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.10.8"
- source_span:
- dependency: transitive
- description:
- name: source_span
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.5.5"
- stack_trace:
- dependency: transitive
- description:
- name: stack_trace
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.9.3"
- stream_channel:
- dependency: transitive
- description:
- name: stream_channel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.0"
- string_scanner:
- dependency: transitive
- description:
- name: string_scanner
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.4"
- term_glyph:
- dependency: transitive
- description:
- name: term_glyph
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.0"
- test:
- dependency: "direct dev"
- description:
- name: test
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.6.3"
- test_api:
- dependency: transitive
- description:
- name: test_api
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.5"
- test_core:
- dependency: transitive
- description:
- name: test_core
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.5"
- test_coverage:
- dependency: "direct dev"
- description:
- name: test_coverage
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.3"
- typed_data:
- dependency: transitive
- description:
- name: typed_data
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.6"
- uuid:
- dependency: "direct main"
- description:
- name: uuid
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.1"
- vm_service_client:
- dependency: transitive
- description:
- name: vm_service_client
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.6+2"
- watcher:
- dependency: transitive
- description:
- name: watcher
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.9.7+10"
- web_socket_channel:
- dependency: transitive
- description:
- name: web_socket_channel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.12"
- yaml:
- dependency: transitive
- description:
- name: yaml
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.1.15"
-sdks:
- dart: ">=2.2.0 <3.0.0"

diff:
-# Generated by pub
-# See https://www.dartlang.org/tools/pub/glossary#lockfile
-packages:
- analyzer:
- dependency: transitive
- description:
- name: analyzer
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.36.3"
- args:
- dependency: transitive
- description:
- name: args
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.5.1"
- async:
- dependency: transitive
- description:
- name: async
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.1.0"
- boolean_selector:
- dependency: transitive
- description:
- name: boolean_selector
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.4"
- charcode:
- dependency: transitive
- description:
- name: charcode
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.2"
- collection:
- dependency: transitive
- description:
- name: collection
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.14.11"
- convert:
- dependency: transitive
- description:
- name: convert
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.1.1"
- crypto:
- dependency: transitive
- description:
- name: crypto
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.6"
- csslib:
- dependency: transitive
- description:
- name: csslib
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.16.0"
- flutter:
- dependency: "direct main"
- description: flutter
- source: sdk
- version: "0.0.0"
- flutter_test:
- dependency: "direct dev"
- description: flutter
- source: sdk
- version: "0.0.0"
- front_end:
- dependency: transitive
- description:
- name: front_end
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.1.18"
- glob:
- dependency: transitive
- description:
- name: glob
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.7"
- graphql:
- dependency: "direct main"
- description:
- path: "../graphql"
- relative: true
- source: path
- version: "1.1.0"
- graphql_parser:
- dependency: transitive
- description:
- name: graphql_parser
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.3"
- html:
- dependency: transitive
- description:
- name: html
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.14.0+2"
- http:
- dependency: transitive
- description:
- name: http
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.12.0+2"
- http_multi_server:
- dependency: transitive
- description:
- name: http_multi_server
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.6"
- http_parser:
- dependency: transitive
- description:
- name: http_parser
- url: "https://pub.dartlang.org"
- source: hosted
- version: "3.1.3"
- io:
- dependency: transitive
- description:
- name: io
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.3.3"
- js:
- dependency: transitive
- description:
- name: js
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.6.1+1"
- json_rpc_2:
- dependency: transitive
- description:
- name: json_rpc_2
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.1.0"
- kernel:
- dependency: transitive
- description:
- name: kernel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.3.18"
- matcher:
- dependency: transitive
- description:
- name: matcher
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.12.5"
- meta:
- dependency: "direct main"
- description:
- name: meta
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.6"
- mime:
- dependency: transitive
- description:
- name: mime
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.9.6+2"
- mockito:
- dependency: "direct dev"
- description:
- name: mockito
- url: "https://pub.dartlang.org"
- source: hosted
- version: "4.0.0"
- multi_server_socket:
- dependency: transitive
- description:
- name: multi_server_socket
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.2"
- node_preamble:
- dependency: transitive
- description:
- name: node_preamble
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.4.4"
- package_config:
- dependency: transitive
- description:
- name: package_config
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.5"
- package_resolver:
- dependency: transitive
- description:
- name: package_resolver
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.10"
- path:
- dependency: "direct main"
- description:
- name: path
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.6.2"
- path_provider:
- dependency: "direct main"
- description:
- name: path_provider
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.0"
- pedantic:
- dependency: "direct dev"
- description:
- name: pedantic
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.5.0"
- pool:
- dependency: transitive
- description:
- name: pool
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.4.0"
- pub_semver:
- dependency: transitive
- description:
- name: pub_semver
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.4.2"
- quiver:
- dependency: transitive
- description:
- name: quiver
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.2"
- rxdart:
- dependency: "direct main"
- description:
- name: rxdart
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.22.0"
- shelf:
- dependency: transitive
- description:
- name: shelf
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.7.5"
- shelf_packages_handler:
- dependency: transitive
- description:
- name: shelf_packages_handler
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.4"
- shelf_static:
- dependency: transitive
- description:
- name: shelf_static
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.8"
- shelf_web_socket:
- dependency: transitive
- description:
- name: shelf_web_socket
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.3"
- sky_engine:
- dependency: transitive
- description: flutter
- source: sdk
- version: "0.0.99"
- source_map_stack_trace:
- dependency: transitive
- description:
- name: source_map_stack_trace
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.5"
- source_maps:
- dependency: transitive
- description:
- name: source_maps
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.10.8"
- source_span:
- dependency: transitive
- description:
- name: source_span
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.5.5"
- stack_trace:
- dependency: transitive
- description:
- name: stack_trace
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.9.3"
- stream_channel:
- dependency: transitive
- description:
- name: stream_channel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.0"
- string_scanner:
- dependency: transitive
- description:
- name: string_scanner
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.4"
- term_glyph:
- dependency: transitive
- description:
- name: term_glyph
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.0"
- test:
- dependency: "direct dev"
- description:
- name: test
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.6.1"
- test_api:
- dependency: transitive
- description:
- name: test_api
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.4"
- test_core:
- dependency: transitive
- description:
- name: test_core
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.3"
- typed_data:
- dependency: transitive
- description:
- name: typed_data
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.6"
- uuid:
- dependency: transitive
- description:
- name: uuid
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.1"
- vector_math:
- dependency: transitive
- description:
- name: vector_math
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.8"
- vm_service_client:
- dependency: transitive
- description:
- name: vm_service_client
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.6+2"
- watcher:
- dependency: transitive
- description:
- name: watcher
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.9.7+10"
- web_socket_channel:
- dependency: transitive
- description:
- name: web_socket_channel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.12"
- yaml:
- dependency: transitive
- description:
- name: yaml
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.1.15"
-sdks:
- dart: ">=2.2.0 <3.0.0"
- flutter: ">=0.1.4 <2.0.0"

original_message: ignore and remove `pubspec.lock`


message: `toJson()` should always return a `<String, dynamic>`, not something else, especially not `String`

diff:
@@ -33,7 +33,7 @@ class MessageTypes {
}
abstract class JsonSerializable {
- dynamic toJson();
+ Map<String, dynamic> toJson();
@override
String toString() => toJson().toString();
@@ -55,7 +55,7 @@ class InitOperation extends GraphQLSocketMessage {
final dynamic payload;
@override
- dynamic toJson() {
+ Map<String, dynamic> toJson() {
final Map<String, dynamic> jsonMap = <String, dynamic>{};
jsonMap['type'] = type;
@@ -74,7 +74,7 @@ class LegacyInitOperation extends InitOperation {
LegacyInitOperation(dynamic payload) : super(payload);
@override
- dynamic toJson() {
+ Map<String, dynamic> toJson() {
final Map<String, dynamic> jsonMap = <String, dynamic>{};
jsonMap['type'] = type;
@@ -82,7 +82,7 @@ class LegacyInitOperation extends InitOperation {
jsonMap['payload'] = json.encode(payload);
}
- return json.encode(jsonMap);
+ return jsonMap;
}
}
@@ -95,7 +95,7 @@ class SubscriptionRequest extends JsonSerializable {
final Operation operation;
@override
- dynamic toJson() => <String, dynamic>{
+ Map<String, dynamic> toJson() => <String, dynamic>{
'operationName': operation.operationName,
'query': operation.document,
'variables': operation.variables,
@@ -114,7 +114,7 @@ class StartOperation extends GraphQLSocketMessage {
final SubscriptionRequest payload;
@override
- dynamic toJson() => <String, dynamic>{
+ Map<String, dynamic> toJson() => <String, dynamic>{
'type': type,
'id': id,
'payload': payload,
@@ -129,7 +129,7 @@ class StopOperation extends GraphQLSocketMessage {
final String id;
@override
- dynamic toJson() => <String, dynamic>{
+ Map<String, dynamic> toJson() => <String, dynamic>{
'type': type,
'id': id,
};
@@ -141,7 +141,7 @@ class ConnectionAck extends GraphQLSocketMessage {
ConnectionAck() : super(MessageTypes.GQL_CONNECTION_ACK);
@override
- dynamic toJson() => <String, dynamic>{
+ Map<String, dynamic> toJson() => <String, dynamic>{
'type': type,
};
}
@@ -154,7 +154,7 @@ class ConnectionError extends GraphQLSocketMessage {
final dynamic payload;
@override
- dynamic toJson() => <String, dynamic>{
+ Map<String, dynamic> toJson() => <String, dynamic>{
'type': type,
'payload': payload,
};
@@ -165,7 +165,7 @@ class ConnectionKeepAlive extends GraphQLSocketMessage {
ConnectionKeepAlive() : super(MessageTypes.GQL_CONNECTION_KEEP_ALIVE);
@override
- dynamic toJson() => <String, dynamic>{
+ Map<String, dynamic> toJson() => <String, dynamic>{
'type': type,
};
}
@@ -182,7 +182,7 @@ class SubscriptionData extends GraphQLSocketMessage {
final dynamic errors;
@override
- dynamic toJson() => <String, dynamic>{
+ Map<String, dynamic> toJson() => <String, dynamic>{
'type': type,
'data': data,
'errors': errors,
@@ -198,7 +198,7 @@ class SubscriptionError extends GraphQLSocketMessage {
final dynamic payload;
@override
- dynamic toJson() => <String, dynamic>{
+ Map<String, dynamic> toJson() => <String, dynamic>{
'type': type,
'id': id,
'payload': payload,
@@ -213,7 +213,7 @@ class SubscriptionComplete extends GraphQLSocketMessage {
final String id;
@override
- dynamic toJson() => <String, dynamic>{
+ Map<String, dynamic> toJson() => <String, dynamic>{
'type': type,
'id': id,
};
@@ -228,7 +228,7 @@ class UnknownData extends GraphQLSocketMessage {
final dynamic payload;
@override
- dynamic toJson() => <String, dynamic>{
+ Map<String, dynamic> toJson() => <String, dynamic>{
'type': type,
'payload': payload,
};

diff:
+import 'package:test/test.dart';
+import 'package:graphql/src/websocket/messages.dart'
+ show
+ // ignore: deprecated_member_use_from_same_package
+ LegacyInitOperation,
+ InitOperation;
+
+void main() {
+ group('LegacyInitOperation', () {
+ test('null payload', () {
+ // ignore: deprecated_member_use_from_same_package
+ final operation = LegacyInitOperation(null);
+ expect(operation.toJson(), {'type': 'connection_init'});
+ });
+ test('simple payload', () {
+ // ignore: deprecated_member_use_from_same_package
+ final operation = LegacyInitOperation(42);
+ expect(operation.toJson(), {'type': 'connection_init', 'payload': '42'});
+ });
+ test('complex payload', () {
+ // ignore: deprecated_member_use_from_same_package
+ final operation = LegacyInitOperation({
+ 'value': 42,
+ 'nested': {
+ 'number': [3, 7],
+ 'string': ['foo', 'bar']
+ }
+ });
+ expect(operation.toJson(), {
+ 'type': 'connection_init',
+ 'payload':
+ '{"value":42,"nested":{"number":[3,7],"string":["foo","bar"]}}'
+ });
+ });
+ });
+ group('InitOperation', () {
+ test('null payload', () {
+ // ignore: deprecated_member_use_from_same_package
+ final operation = InitOperation(null);
+ expect(operation.toJson(), {'type': 'connection_init'});
+ });
+ test('simple payload', () {
+ // ignore: deprecated_member_use_from_same_package
+ final operation = InitOperation(42);
+ expect(operation.toJson(), {'type': 'connection_init', 'payload': 42});
+ });
+ test('complex payload', () {
+ // ignore: deprecated_member_use_from_same_package
+ final operation = InitOperation({
+ 'value': 42,
+ 'nested': {
+ 'number': [3, 7],
+ 'string': ['foo', 'bar']
+ }
+ });
+ expect(operation.toJson(), {
+ 'type': 'connection_init',
+ 'payload': {
+ 'value': 42,
+ 'nested': {
+ 'number': [3, 7],
+ 'string': ['foo', 'bar']
+ }
+ }
+ });
+ });
+ });
+}


message:
fix(client): do not mutate input data
the original intention is to increase test coverage on `dart:io` related,
relating to the effort to make this package compatible to web/browser
While doing this, I happen to discover a bug that we are currently mutating input data

diff:
-import 'dart:io';
+import 'dart:io' show stdout, stderr, exit;
import 'package:args/args.dart';
import 'package:graphql/client.dart';

diff:
import 'dart:async';
import 'dart:collection';
import 'dart:convert';
-import 'dart:io';
+import 'dart:io' show Directory, File, IOSink, FileSystemException;
import 'package:meta/meta.dart';
// TODO need to think about this

diff:
@@ -36,14 +36,14 @@ Map<String, dynamic> _recursivelyAddAll(
Map<String, dynamic> target,
Map<String, dynamic> source,
) {
- target = unwrapMap(target);
+ target = Map.from(unwrapMap(target));
source = unwrapMap(source);
source.forEach((String key, dynamic value) {
if (target.containsKey(key) &&
target[key] is Map &&
value != null &&
value is Map<String, dynamic>) {
- _recursivelyAddAll(
+ target[key] = _recursivelyAddAll(
target[key] as Map<String, dynamic>,
value,
);

diff:
@@ -57,6 +57,61 @@ void main() {
"browser": Skip("Browser does not support dart:io (see #295)")
});
+ test('.write avoids overriding a superset with a subset of a field (#155)',
+ () async {
+ final InMemoryCache cache = InMemoryCache(
+ storageProvider: () => customStorageDirectory,
+ );
+ cache.write(aKey, aData);
+
+ final Map<String, Object> anotherAData = <String, Object>{
+ 'a': <String, Object>{
+ 'key': 'val',
+ },
+ };
+ cache.write(aKey, anotherAData);
+
+ await cache.save();
+ cache.reset();
+ await cache.restore();
+ expect(
+ cache.read(aKey),
+ equals(<String, Object>{
+ 'a': {'__typename': 'A', 'key': 'val'}
+ }),
+ );
+ }, onPlatform: {
+ "browser": Skip("Browser does not support dart:io (see #295)")
+ });
+
+ test('.write does not mutate input', () async {
+ final InMemoryCache cache = InMemoryCache(
+ storageProvider: () => customStorageDirectory,
+ );
+ cache.write(aKey, aData);
+ final Map<String, Object> anotherAData = <String, Object>{
+ 'a': <String, Object>{
+ 'key': 'val',
+ },
+ };
+ cache.write(aKey, anotherAData);
+
+ expect(
+ aData,
+ equals(<String, Object>{
+ 'a': {'__typename': 'A'}
+ }),
+ );
+ expect(
+ anotherAData,
+ equals(<String, Object>{
+ 'a': {'key': 'val'}
+ }),
+ );
+ }, onPlatform: {
+ "browser": Skip("Browser does not support dart:io (see #295)")
+ });
+
test('saving concurrently wont error', () async {
final InMemoryCache cache = InMemoryCache(
storageProvider: () => customStorageDirectory,

original_message:
fix(client): do not mutate input data

the original intention is to increase test coverage on `dart:io` related,
relating to the effort to make this package compatible to web/browser #295.
While doing this, I happen to discover a bug that we are currently mutating input data


message: ci: save cache based on `.yaml` instead of `.lock`

diff:
@@ -7,8 +7,8 @@ aliases:
- &restore_cache
keys:
# when lock file changes, use increasingly general patterns to restore cache
- - pub-packages-v1-{{ checksum "packages/graphql/pubspec.lock" }}-{{ checksum "packages/graphql_flutter/pubspec.lock" }}
- - pub-packages-v1-{{ checksum "packages/graphql/pubspec.lock" }}
+ - pub-packages-v1-{{ checksum "packages/graphql/pubspec.yaml" }}-{{ checksum "packages/graphql_flutter/pubspec.yaml" }}
+ - pub-packages-v1-{{ checksum "packages/graphql/pubspec.yaml" }}
- pub-packages-v1-
- &install_yaml_processor
name: Install yq yaml processor
@@ -67,7 +67,7 @@ jobs:
cd packages/graphql_flutter
flutter packages get
- save_cache:
- key: pub-packages-v1-{{ checksum "packages/graphql/pubspec.lock" }}-{{ checksum "packages/graphql_flutter/pubspec.lock" }}
+ key: pub-packages-v1-{{ checksum "packages/graphql/pubspec.yaml" }}-{{ checksum "packages/graphql_flutter/pubspec.yaml" }}
paths:
- ~/.pub-cache
lint:
@@ -179,7 +179,6 @@ jobs:
git checkout $BRANCH
git add packages/graphql/pubspec.yaml packages/graphql_flutter/pubspec.yaml
- git add packages/graphql/pubspec.lock packages/graphql_flutter/pubspec.lock
git commit --allow-empty -m "build(Pub): Bump version numbers [skip ci]"
# Push quietly to prevent showing the token in log


message: docs: streamline the badges

diff:
[![MIT License][license-badge]][license-link]
[![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg?style=flat-square)](#contributors)
-[![PRs Welcome][prs-badge]](http://makeapullrequest.com)
+[![PRs Welcome][prs-badge]][prs-link]
-[![Watch on GitHub](https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Watchers)](https://github.com/zino-app/graphql-flutter)
-[![Star on GitHub](https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Stars)](https://github.com/zino-app/graphql-flutter)
-[![Discord](https://img.shields.io/discord/559455668810153989.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/tXTtBfC)
+[![Star on GitHub][github-star-badge]][github-star-link]
+[![Watch on GitHub][github-watch-badge]][github-watch-link]
+[![Discord][discord-badge]][discord-link]
-## GraphQL Flutter
-
-[![Build Status][build-status-badge]][build-status-link]
-[![Coverage][coverage-badge]][coverage-link]
+# GraphQL Flutter
## About this project
@@ -21,6 +18,9 @@ The project took inspiration from the [Apollo GraphQL client](https://github.com
## Packages
+[![Build Status][build-status-badge]][build-status-link]
+[![Coverage][coverage-badge]][coverage-link]
+
This is a Monorepo which contains the following packages:
| Package | Pub |
@@ -63,18 +63,20 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!
-[build-status-badge]: https://circleci.com/gh/zino-app/graphql-flutter/tree/master.svg?style=svg
-[build-status-link]: https://circleci.com/gh/zino-app/graphql-flutter/tree/master
-[coverage-badge]: https://codecov.io/gh/zino-app/graphql-flutter/branch/master/graph/badge.svg
+[build-status-badge]: https://img.shields.io/circleci/build/github/zino-app/graphql-flutter.svg?style=flat-square
+[build-status-link]: https://circleci.com/gh/zino-app/graphql-flutter
+[coverage-badge]: https://img.shields.io/codecov/c/github/zino-app/graphql-flutter.svg?style=flat-square
[coverage-link]: https://codecov.io/gh/zino-app/graphql-flutter
-[version-badge]: https://img.shields.io/pub/v/graphql_flutter.svg
+[version-badge]: https://img.shields.io/pub/v/graphql_flutter.svg?style=flat-square
[package-link]: https://pub.dartlang.org/packages/graphql_flutter
-[package-link-client]: https://pub.dartlang.org/packages/graphql/versions/1.0.1
-[license-badge]: https://img.shields.io/github/license/zino-app/graphql-flutter.svg
+[package-link-client]: https://pub.dartlang.org/packages/graphql
+[license-badge]: https://img.shields.io/github/license/zino-app/graphql-flutter.svg?style=flat-square
[license-link]: https://github.com/zino-app/graphql-flutter/blob/master/LICENSE
-[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
-[prs]: http://makeapullrequest.com
-[github-watch-badge]: https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=social
-[github-watch]: https://github.com/zino-app/graphql-flutter/watchers
-[github-star-badge]: https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=social
-[github-star]: https://github.com/zino-app/graphql-flutter/stargazers
+[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
+[prs-link]: http://makeapullrequest.com
+[github-watch-badge]: https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=flat-square&logo=github&logoColor=ffffff
+[github-watch-link]: https://github.com/zino-app/graphql-flutter/watchers
+[github-star-badge]: https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=flat-square&logo=github&logoColor=ffffff
+[github-star-link]: https://github.com/zino-app/graphql-flutter/stargazers
+[discord-badge]: https://img.shields.io/discord/559455668810153989.svg?style=flat-square&logo=discord&logoColor=ffffff
+[discord-link]: https://discord.gg/tXTtBfC

diff:
-# GraphQL Client
+[![MIT License][license-badge]][license-link]
+[![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg?style=flat-square)](#contributors)
+[![PRs Welcome][prs-badge]][prs-link]
+
+[![Star on GitHub][github-star-badge]][github-star-link]
+[![Watch on GitHub][github-watch-badge]][github-watch-link]
+[![Discord][discord-badge]][discord-link]
[![Build Status][build-status-badge]][build-status-link]
[![Coverage][coverage-badge]][coverage-link]
[![version][version-badge]][package-link]
-[![MIT License][license-badge]][license-link]
-[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg)][contributors-link]
-[![PRs Welcome][prs-badge]](http://makeapullrequest.com)
-[![Watch on GitHub](https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Watchers)](https://github.com/felangel/bloc)
-[![Star on GitHub](https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=flat&logo=github&colorB=deeppink&label=Stars)](https://github.com/felangel/bloc)
-[![Discord](https://img.shields.io/discord/559455668810153989.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/tXTtBfC)
+# GraphQL Client
## Installation
@@ -56,7 +57,6 @@ final GraphQLClient _client = GraphQLClient(
Once you have initialized a client, you can run queries and mutations.
-
### Query
Creating a query is as simple as creating a multiline string:
@@ -166,18 +166,19 @@ if (isStarrred) {
...
```
-[build-status-badge]: https://circleci.com/gh/zino-app/graphql-flutter/tree/master.svg?style=svg
-[build-status-link]: https://circleci.com/gh/zino-app/graphql-flutter/
-[coverage-badge]: https://codecov.io/gh/zino-app/graphql-flutter/branch/master/graph/badge.svg
+[build-status-badge]: https://img.shields.io/circleci/build/github/zino-app/graphql-flutter.svg?style=flat-square
+[build-status-link]: https://circleci.com/gh/zino-app/graphql-flutter
+[coverage-badge]: https://img.shields.io/codecov/c/github/zino-app/graphql-flutter.svg?style=flat-square
[coverage-link]: https://codecov.io/gh/zino-app/graphql-flutter
-[version-badge]: https://img.shields.io/pub/v/graphql.svg
-[package-link]: https://pub.dartlang.org/packages/graphql/versions/1.0.1-beta.4
-[license-badge]: https://img.shields.io/github/license/zino-app/graphql-flutter.svg
+[version-badge]: https://img.shields.io/pub/v/graphql_flutter.svg?style=flat-square
+[package-link]: https://pub.dartlang.org/packages/graphql/versions
+[license-badge]: https://img.shields.io/github/license/zino-app/graphql-flutter.svg?style=flat-square
[license-link]: https://github.com/zino-app/graphql-flutter/blob/master/LICENSE
-[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
-[prs]: http://makeapullrequest.com
-[github-watch-badge]: https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=social
-[github-watch]: https://github.com/zino-app/graphql-flutter/watchers
-[github-star-badge]: https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=social
-[github-star]: https://github.com/zino-app/graphql-flutter/stargazers
-[contributors-link]: https://github.com/zino-app/graphql-flutter#contributors
+[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
+[prs-link]: http://makeapullrequest.com
+[github-watch-badge]: https://img.shields.io/github/watchers/zino-app/graphql-flutter.svg?style=flat-square&logo=github&logoColor=ffffff
+[github-watch-link]: https://github.com/zino-app/graphql-flutter/watchers
+[github-star-badge]: https://img.shields.io/github/stars/zino-app/graphql-flutter.svg?style=flat-square&logo=github&logoColor=ffffff
+[github-star-link]: https://github.com/zino-app/graphql-flutter/stargazers
+[discord-badge]: https://img.shields.io/discord/559455668810153989.svg?style=flat-square&logo=discord&logoColor=ffffff
+[discord-link]: https://discord.gg/tXTtBfC

original_message: docs: streamline the badges


message:
feat(client): support GraphQL upload files on browser
To support GraphQL upload files, we are now accepting `MultipartFile` only.
`io.File` is still being supported with deprecation warning.
In near future, we will remove support.
To ease the transition, `package:graphql/utility.dart` `multipartFileFrom`
is provided, whose input must be either `io.File` or `html.File`.

diff:
@@ -25,7 +25,7 @@ GraphQLClient client() {
getToken: () async => 'Bearer $YOUR_PERSONAL_ACCESS_TOKEN',
);
- final Link _link = _authLink.concat(_httpLink as Link);
+ final Link _link = _authLink.concat(_httpLink);
return GraphQLClient(
cache: InMemoryCache(storageProvider: null),

diff:
import 'dart:collection' show SplayTreeMap;
import 'dart:convert' show json;
-import 'dart:io' show File;
+import 'package:http/http.dart';
import 'package:meta/meta.dart';
import 'package:graphql/src/utilities/get_from_ast.dart' show getOperationName;
+import 'package:graphql/src/link/http//link_http_helper_deprecated_stub.dart'
+ if (dart.library.io) 'package:graphql/src/link/http/link_http_helper_deprecated_io.dart';
class RawOperationData {
RawOperationData({
@@ -47,7 +49,13 @@ class RawOperationData {
/// SplayTreeMap is always sorted
final String encodedVariables =
json.encode(variables, toEncodable: (dynamic object) {
- if (object is File) {
+ if (object is MultipartFile) {
+ return object.filename;
+ }
+ // @deprecated, backward compatible only
+ // in case the body is io.File
+ // in future release, io.File will no longer be supported
+ if (isIoFile(object)) {
return object.path;
}
return object;

diff:
import 'dart:async';
import 'dart:convert';
-import 'dart:io';
import 'dart:typed_data';
import 'package:meta/meta.dart';
import 'package:http/http.dart';
import 'package:http_parser/http_parser.dart';
-import 'package:path/path.dart';
-import 'package:mime/mime.dart';
import 'package:graphql/src/utilities/helpers.dart' show notNull;
import 'package:graphql/src/link/link.dart';
@@ -15,6 +12,8 @@ import 'package:graphql/src/link/operation.dart';
import 'package:graphql/src/link/fetch_result.dart';
import 'package:graphql/src/link/http/fallback_http_config.dart';
import 'package:graphql/src/link/http/http_config.dart';
+import './link_http_helper_deprecated_stub.dart'
+ if (dart.library.io) './link_http_helper_deprecated_io.dart';
class HttpLink extends Link {
HttpLink({
@@ -110,16 +109,16 @@ class HttpLink extends Link {
);
}
-Map<String, File> _getFileMap(
+Future<Map<String, MultipartFile>> _getFileMap(
dynamic body, {
- Map<String, File> currentMap,
+ Map<String, MultipartFile> currentMap,
List<String> currentPath = const <String>[],
-}) {
- currentMap ??= <String, File>{};
+}) async {
+ currentMap ??= <String, MultipartFile>{};
if (body is Map<String, dynamic>) {
final Iterable<MapEntry<String, dynamic>> entries = body.entries;
for (MapEntry<String, dynamic> element in entries) {
- currentMap.addAll(_getFileMap(
+ currentMap.addAll(await _getFileMap(
element.value,
currentMap: currentMap,
currentPath: List<String>.from(currentPath)..add(element.key),
@@ -129,7 +128,7 @@ Map<String, File> _getFileMap(
}
if (body is List<dynamic>) {
for (int i = 0; i < body.length; i++) {
- currentMap.addAll(_getFileMap(
+ currentMap.addAll(await _getFileMap(
body[i],
currentMap: currentMap,
currentPath: List<String>.from(currentPath)..add(i.toString()),
@@ -137,9 +136,18 @@ Map<String, File> _getFileMap(
}
return currentMap;
}
- if (body is File) {
- return currentMap..addAll(<String, File>{currentPath.join('.'): body});
+ if (body is MultipartFile) {
+ return currentMap
+ ..addAll(<String, MultipartFile>{currentPath.join('.'): body});
}
+
+ // @deprecated, backward compatible only
+ // in case the body is io.File
+ // in future release, io.File will no longer be supported
+ if (isIoFile(body)) {
+ return deprecatedHelper(body, currentMap, currentPath);
+ }
+
// else should only be either String, num, null; NOTHING else
return currentMap;
}
@@ -149,7 +157,7 @@ Future<BaseRequest> _prepareRequest(
Map<String, dynamic> body,
Map<String, String> httpHeaders,
) async {
- final Map<String, File> fileMap = _getFileMap(body);
+ final Map<String, MultipartFile> fileMap = await _getFileMap(body);
if (fileMap.isEmpty) {
final Request r = Request('post', Uri.parse(url));
r.headers.addAll(httpHeaders);
@@ -160,7 +168,13 @@ Future<BaseRequest> _prepareRequest(
final MultipartRequest r = MultipartRequest('post', Uri.parse(url));
r.headers.addAll(httpHeaders);
r.fields['operations'] = json.encode(body, toEncodable: (dynamic object) {
- if (object is File) {
+ if (object is MultipartFile) {
+ return null;
+ }
+ // @deprecated, backward compatible only
+ // in case the body is io.File
+ // in future release, io.File will no longer be supported
+ if (isIoFile(body)) {
return null;
}
return object.toJson();
@@ -169,23 +183,22 @@ Future<BaseRequest> _prepareRequest(
final Map<String, List<String>> fileMapping = <String, List<String>>{};
final List<MultipartFile> fileList = <MultipartFile>[];
- final List<MapEntry<String, File>> fileMapEntries =
+ final List<MapEntry<String, MultipartFile>> fileMapEntries =
fileMap.entries.toList(growable: false);
for (int i = 0; i < fileMapEntries.length; i++) {
- final MapEntry<String, File> entry = fileMapEntries[i];
+ final MapEntry<String, MultipartFile> entry = fileMapEntries[i];
final String indexString = i.toString();
fileMapping.addAll(<String, List<String>>{
indexString: <String>[entry.key],
});
- final File f = entry.value;
- final String fileName = basename(f.path);
+ final MultipartFile f = entry.value;
fileList.add(MultipartFile(
indexString,
- f.openRead(),
- await f.length(),
- contentType: MediaType.parse(lookupMimeType(fileName)),
- filename: fileName,
+ f.finalize(),
+ f.length,
+ contentType: f.contentType,
+ filename: f.filename,
));
}

diff:
+import 'dart:io' as io;
+
+import 'package:http/http.dart';
+import 'package:graphql/src/utilities/file_io.dart' show multipartFileFrom;
+
+// @deprecated, backward compatible only
+// in case the body is io.File
+// in future release, io.File will no longer be supported
+Future<Map<String, MultipartFile>> deprecatedHelper(
+ body, currentMap, currentPath) async {
+ if (body is io.File) {
+ return currentMap
+ ..addAll(<String, MultipartFile>{
+ currentPath.join('.'): await multipartFileFrom(body)
+ });
+ }
+ return null;
+}
+
+bool isIoFile(object) => object is io.File;

diff:
+import 'package:http/http.dart';
+
+// @deprecated, backward compatible only
+// in case the body is io.File
+// in future release, io.File will no longer be supported
+// but this stub is noop
+Future<Map<String, MultipartFile>> deprecatedHelper(body, currentMap, currentPath) async => null;
+
+// @deprecated, backward compatible only
+// in case the body is io.File
+// in future release, io.File will no longer be supported
+// but this stub always returns false
+bool isIoFile(object) => false;

diff:
+import 'dart:async';
+import 'package:http/http.dart';
+
+import './file_stub.dart' as impl
+ if (dart.library.html) './file_html.dart'
+ if (dart.library.io) './file_io.dart';
+
+/// Input's type must be either `io.File` or `html.File`
+FutureOr<MultipartFile> multipartFileFrom(/*io.File or html.File*/ f) => impl.multipartFileFrom(f);

diff:
+import 'dart:async';
+import 'dart:html' as html;
+import 'package:http/http.dart';
+import 'package:http_parser/http_parser.dart';
+
+Stream<List<int>> _readFile(html.File file) {
+ final reader = html.FileReader();
+ final streamController = StreamController<List<int>>();
+
+ reader.onLoad.listen((_) {
+ // streamController.add(reader.result);
+ streamController.close();
+ });
+
+ reader.onError.listen((error) => streamController.addError(error));
+
+ reader.readAsArrayBuffer(file);
+
+ return streamController.stream;
+ }
+
+MultipartFile multipartFileFrom(html.File f) => MultipartFile(
+ '',
+ _readFile(f),
+ f.size,
+ contentType: MediaType.parse(f.type),
+ filename: f.name,
+ );

diff:
+import 'dart:async';
+import 'dart:io' as io;
+import 'package:http/http.dart';
+import 'package:http_parser/http_parser.dart';
+import 'package:mime/mime.dart';
+import 'package:path/path.dart';
+
+Future<MultipartFile> multipartFileFrom(io.File f) async => MultipartFile(
+ '',
+ f.openRead(),
+ await f.length(),
+ contentType: MediaType.parse(lookupMimeType(f.path)),
+ filename: basename(f.path),
+ );

diff:
+import 'dart:async';
+
+import 'package:http/http.dart';
+
+FutureOr<MultipartFile> multipartFileFrom(/*io.File or html.File*/ f) => throw UnsupportedError('io or html');

diff:
+library graphql;
+
+export 'package:graphql/src/utilities/file.dart' show multipartFileFrom;

diff:
@@ -48,7 +48,7 @@ void main() {
getToken: () async => 'Bearer my-special-bearer-token',
);
- link = authLink.concat(httpLink as Link);
+ link = authLink.concat(httpLink);
graphQLClientClient = GraphQLClient(
cache: getTestCache(),

diff:
@@ -50,7 +50,7 @@ void main() {
getToken: () async => 'Bearer my-special-bearer-token',
);
- link = authLink.concat(httpLink as Link);
+ link = authLink.concat(httpLink);
graphQLClientClient = GraphQLClient(
cache: getTestCache(),

diff:
-// This
-import 'dart:mirrors';
+import 'dart:async';
import 'dart:convert';
-import 'dart:io' show File, Directory;
import 'package:meta/meta.dart';
-import 'package:path/path.dart' show dirname, join;
import 'package:http/http.dart' as http;
import 'package:graphql/client.dart';
NormalizedInMemoryCache getTestCache() => NormalizedInMemoryCache(
dataIdFromObject: typenameDataIdFromObject,
- storageProvider: () => Directory.systemTemp.createTempSync('file_test_'),
+ storageProvider: () => null,
);
http.StreamedResponse simpleResponse({@required String body, int status}) {
@@ -23,18 +20,3 @@ http.StreamedResponse simpleResponse({@required String body, int status}) {
return r;
}
-
-class _TestUtils {
- static String _path;
-
- static String get path {
- if (_path == null) {
- final String basePath =
- dirname((reflectClass(_TestUtils).owner as LibraryMirror).uri.path);
- _path = basePath.endsWith('test') ? basePath : join(basePath, 'test');
- }
- return _path;
- }
-}
-
-File tempFile(String fileName) => File(join(_TestUtils.path, fileName));

diff:
-import 'dart:io' show File, Directory;
-import 'dart:typed_data' show Uint8List;
-
+import 'package:http_parser/http_parser.dart';
import 'package:test/test.dart';
import 'package:mockito/mockito.dart';
import 'package:http/http.dart' as http;
@@ -13,7 +11,7 @@ class MockHttpClient extends Mock implements http.Client {}
NormalizedInMemoryCache getTestCache() => NormalizedInMemoryCache(
dataIdFromObject: typenameDataIdFromObject,
- storageProvider: () => Directory.systemTemp.createTempSync('file_test_'),
+ storageProvider: () => null,
);
void main() {
@@ -45,7 +43,7 @@ void main() {
getToken: () async => 'Bearer my-special-bearer-token',
);
- link = authLink.concat(httpLink as Link);
+ link = authLink.concat(httpLink);
graphQLClientClient = GraphQLClient(
cache: getTestCache(),
@@ -54,17 +52,17 @@ void main() {
});
test('upload success', () async {
- Future<void> expectUploadBody(http.ByteStream bodyBytesStream,
- String boundary, List<File> files) async {
+ Future<void> expectUploadBody(
+ http.ByteStream bodyBytesStream, String boundary) async {
final List<Function> expectContinuationList = (() {
int i = 0;
return <Function>[
// ExpectString
- (Uint8List actual, String expected) => expect(
+ (List<int> actual, String expected) => expect(
String.fromCharCodes(actual.sublist(i, i += expected.length)),
expected),
// ExpectBytes
- (Uint8List actual, Uint8List expected) =>
+ (List<int> actual, List<int> expected) =>
expect(actual.sublist(i, i += expected.length), expected),
// Expect final length
(int expectedLength) => expect(i, expectedLength),
@@ -73,7 +71,7 @@ void main() {
final Function expectContinuationString = expectContinuationList[0];
final Function expectContinuationBytes = expectContinuationList[1];
final Function expectContinuationLength = expectContinuationList[2];
- final Uint8List bodyBytes = await bodyBytesStream.toBytes();
+ final bodyBytes = await bodyBytesStream.toBytes();
expectContinuationString(bodyBytes, '--');
expectContinuationString(bodyBytes, boundary);
expectContinuationString(bodyBytes,
@@ -89,12 +87,12 @@ void main() {
expectContinuationString(bodyBytes, boundary);
expectContinuationString(bodyBytes,
'\r\ncontent-type: image/jpeg\r\ncontent-disposition: form-data; name="0"; filename="sample_upload.jpg"\r\n\r\n');
- expectContinuationBytes(bodyBytes, await files[0].readAsBytes());
+ expectContinuationBytes(bodyBytes, [0, 1, 254, 255]);
expectContinuationString(bodyBytes, '\r\n--');
expectContinuationString(bodyBytes, boundary);
expectContinuationString(bodyBytes,
- '\r\ncontent-type: video/quicktime\r\ncontent-disposition: form-data; name="1"; filename="sample_upload.mov"\r\n\r\n');
- expectContinuationBytes(bodyBytes, await files[1].readAsBytes());
+ '\r\ncontent-type: text/plain; charset=utf-8\r\ncontent-disposition: form-data; name="1"; filename="sample_upload.txt"\r\n\r\n');
+ expectContinuationString(bodyBytes, 'just plain text');
expectContinuationString(bodyBytes, '\r\n--');
expectContinuationString(bodyBytes, boundary);
expectContinuationString(bodyBytes, '--\r\n');
@@ -116,9 +114,9 @@ void main() {
},
{
"id": "5Ea18qlMur",
- "filename": "sample_upload.mov",
- "mimetype": "video/quicktime",
- "path": "./uploads/5Ea18qlMur-sample_upload.mov"
+ "filename": "sample_upload.txt",
+ "mimetype": "text/plain",
+ "path": "./uploads/5Ea18qlMur-sample_upload.txt"
}
]
}
@@ -126,15 +124,23 @@ void main() {
''');
});
- final List<File> files = <String>[
- 'sample_upload.jpg',
- 'sample_upload.mov'
- ].map((String fileName) => tempFile(fileName)).toList();
-
final MutationOptions _options = MutationOptions(
document: uploadMutation,
variables: <String, dynamic>{
- 'files': files,
+ 'files': [
+ http.MultipartFile.fromBytes(
+ '',
+ [0, 1, 254, 255],
+ filename: 'sample_upload.jpg',
+ contentType: MediaType('image', 'jpeg'),
+ ),
+ http.MultipartFile.fromString(
+ '',
+ 'just plain text',
+ filename: 'sample_upload.txt',
+ contentType: MediaType('text', 'plain'),
+ ),
+ ],
},
);
final QueryResult r = await graphQLClientClient.mutate(_options);
@@ -153,7 +159,7 @@ void main() {
final List<String> contentTypeStringSplit =
request.headers['content-type'].split('; boundary=');
expect(contentTypeStringSplit[0], 'multipart/form-data');
- await expectUploadBody(bodyBytes, contentTypeStringSplit[1], files);
+ await expectUploadBody(bodyBytes, contentTypeStringSplit[1]);
final List<Map<String, dynamic>> multipleUpload =
(r.data['multipleUpload'] as List<dynamic>)
@@ -168,13 +174,11 @@ void main() {
},
<String, String>{
'id': '5Ea18qlMur',
- 'filename': 'sample_upload.mov',
- 'mimetype': 'video/quicktime',
- 'path': './uploads/5Ea18qlMur-sample_upload.mov'
+ 'filename': 'sample_upload.txt',
+ 'mimetype': 'text/plain',
+ 'path': './uploads/5Ea18qlMur-sample_upload.txt'
},
]);
- }, onPlatform: {
- "browser": Skip("Browser does not support dart:mirrors"),
});
//test('upload fail error response', () {

diff:
@@ -64,7 +64,7 @@ class Bloc {
getToken: () async => 'Bearer $YOUR_PERSONAL_ACCESS_TOKEN',
);
- static final Link _link = _authLink.concat(_httpLink as Link);
+ static final Link _link = _authLink.concat(_httpLink);
static final GraphQLClient _client = GraphQLClient(
cache: NormalizedInMemoryCache(

diff:
@@ -27,7 +27,7 @@ class GraphQLWidgetScreen extends StatelessWidget {
);
// TODO don't think we have to cast here, maybe covariant
- Link link = authLink.concat(httpLink as Link);
+ Link link = authLink.concat(httpLink);
if (ENABLE_WEBSOCKETS) {
final WebSocketLink websocketLink = WebSocketLink(
url: 'ws://localhost:8080/ws/graphql',