Skip to content

Commit 5db2775

Browse files
committed
Readme fix
1 parent ab18019 commit 5db2775

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

README.md

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,24 @@ Integrates [apollo](http://www.apollostack.com/) in your vue components with dec
77
## Table of contents
88

99
- [Installation](#installation)
10-
- [Usage](#usage)
11-
- [Configuration](#configuration)
12-
- [Usage in components](#usage-in-components)
13-
- [Queries](#queries)
14-
- [Simple query](#simple-query)
15-
- [Query with parameters](#query-with-parameters)
16-
- [Reactive parameters](#reactive-parameters)
17-
- [Advanced options](#advanced-options)
18-
- [Reactive Query Example](#reactive-query-example)
19-
- [Mutations](#mutations)
20-
- [Subscriptions](#subscriptions)
21-
- [Pagination with `fetchMore`](#pagination-with-fetchmore)
10+
- [Configuration](#configuration)
11+
- [Usage in components](#usage-in-components)
12+
- [Queries](#queries)
13+
- [Simple query](#simple-query)
14+
- [Query with parameters](#query-with-parameters)
15+
- [Reactive parameters](#reactive-parameters)
16+
- [Advanced options](#advanced-options)
17+
- [Reactive Query Example](#reactive-query-example)
18+
- [Mutations](#mutations)
19+
- [Subscriptions](#subscriptions)
20+
- [Pagination with `fetchMore`](#pagination-with-fetchmore)
2221

2322
## Installation
2423

2524

2625
npm install --save vue-apollo apollo-client
2726

28-
## Usage
29-
30-
### Configuration
27+
## Configuration
3128

3229
```javascript
3330
import Vue from 'vue';
@@ -50,7 +47,7 @@ Vue.use(VueApollo, {
5047
// Your Vue app is now Apollo-enabled!
5148
```
5249

53-
### Usage in components
50+
## Usage in components
5451

5552
To declare apollo queries in your Vue component, add an `apollo` object :
5653

@@ -64,11 +61,11 @@ new Vue({
6461

6562
You can access the [apollo-client](http://dev.apollodata.com/core/apollo-client-api.html) instance with `this.$apollo.client` in all your vue components.
6663

67-
### Queries
64+
## Queries
6865

6966
In the `apollo` object, add an attribute for each property you want to feed with the result of an Apollo query.
7067

71-
#### Simple query
68+
### Simple query
7269

7370
Use `gql` to write your GraphQL queries:
7471

@@ -144,7 +141,7 @@ You can then use your property as usual in your vue component:
144141
</template>
145142
```
146143

147-
#### Query with parameters
144+
### Query with parameters
148145

149146
You can add variables (read parameters) to your `gql` query by declaring `query` and `variables` in an object:
150147

@@ -247,7 +244,7 @@ And then use it in your vue component:
247244
</template>
248245
```
249246

250-
#### Reactive parameters
247+
### Reactive parameters
251248

252249
Use a function instead to make the parameters reactive with vue properties:
253250

@@ -284,7 +281,7 @@ This will re-fetch the query each time a parameter changes, for example:
284281
</template>
285282
```
286283

287-
#### Advanced options
284+
### Advanced options
288285

289286
These are the available advanced options you can use:
290287
- `update(data) {return ...}` to customize the value that is set in the vue property, for example if the field names don't match.
@@ -350,7 +347,7 @@ If you use `ES2015`, you can also write the `update` like this:
350347
update: data => data.ping
351348
```
352349

353-
#### Reactive Query Example
350+
### Reactive Query Example
354351

355352
Here is a reactive query example using polling:
356353

@@ -416,7 +413,7 @@ export const resolvers = {
416413
};
417414
```
418415

419-
### Mutations
416+
## Mutations
420417

421418
Mutations are queries that changes your data state on your apollo server. For more info, visit the [apollo doc](http://dev.apollodata.com/core/apollo-client-api.html#ApolloClient\.mutate).
422419

@@ -534,7 +531,7 @@ export const resolvers = {
534531
};
535532
```
536533

537-
### Subscriptions
534+
## Subscriptions
538535

539536
To make enable the websocket-based subscription, a bit of additional setup is required:
540537

@@ -650,7 +647,7 @@ You can then access the subscription `ObservableQuery` object with `this.$apollo
650647

651648
For the server implementation, you can take a look at [this simple example](https://github.com/Akryum/apollo-server-example).
652649

653-
### Pagination with `fetchMore`
650+
## Pagination with `fetchMore`
654651

655652
Use the `fetchMore()` method on the query:
656653

0 commit comments

Comments
 (0)