Skip to content

Commit

Permalink
fix: fix target swap conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
micimize authored May 21, 2019
1 parent a8ef157 commit 2d0f7e3
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions packages/graphql/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# 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)
[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg)][contributors-link]
[![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)

[![Coverage][coverage-badge]][coverage-link]
[![Build Status][build-status-badge]][build-status-link]
[![version][version-badge]][package-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/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)

## Installation
## Installation

First, depend on this package:

Expand All @@ -28,7 +28,7 @@ import 'package:graphql/client.dart';

## Usage

To connect to a GraphQL Server, we first need to create a `GraphQLClient`. A `GraphQLClient` requires both a `cache` and a `link` to be initialized.
To connect to a GraphQL Server, we first need to create a `GraphQLClient`. A `GraphQLClient` requires both a `cache` and a `link` to be initialized.

In our example below, we will be using the Github Public API. In our example below, we are going to use `HttpLink` which we will concatinate with `AuthLink` so as to attach our github access token. For the cache, we are going to use `InMemoryCache`.

Expand Down Expand Up @@ -56,6 +56,7 @@ 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:
Expand All @@ -77,9 +78,9 @@ const String readRepositories = r'''
''';
```

Then create a `QueryOptions` object with the query string as the document and pass any variables necessary.
Then create a `QueryOptions` object with the query string as the document and pass any variables necessary.

In our case, we need pass `nRepositories` variable and the document name is `readRepositories`.
In our case, we need pass `nRepositories` variable and the document name is `readRepositories`.

```dart
Expand Down Expand Up @@ -111,7 +112,7 @@ final List<dynamic> repositories =
...
```

### Mutations
### Mutations

Creating a Matation is also similar to creating a query, with a small difference. First, start with a multiline string:

Expand Down Expand Up @@ -165,12 +166,12 @@ if (isStarrred) {
...
```

[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
[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
[version-badge]: https://img.shields.io/pub/v/graphql.svg
[package-link]: https://pub.dartlang.org/packages/graphql
[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
[license-link]: https://github.com/zino-app/graphql-flutter/blob/master/LICENSE
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
Expand Down

0 comments on commit 2d0f7e3

Please # to comment.