Skip to content

Commit eee91e5

Browse files
author
Guillaume Chau
authored
Updated links + some minor fixes and changes
1 parent 4c5a70a commit eee91e5

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Apollo and GraphQL for Vue.js
22

33
[![npm](https://img.shields.io/npm/v/vue-apollo/next.svg) ![npm](https://img.shields.io/npm/dm/vue-apollo.svg)](https://www.npmjs.com/package/vue-apollo)
4-
[![vue1](https://img.shields.io/badge/apollo-2.x-blue.svg)](http://apollodata.com/)
4+
[![vue1](https://img.shields.io/badge/apollo-2.x-blue.svg)](https://www.apollographql.com/)
55
[![vue1](https://img.shields.io/badge/vue-1.x-brightgreen.svg) ![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/)
66

77
![schema](https://cdn-images-1.medium.com/max/800/1*H9AANoofLqjS10Xd5TwRYw.png)
88

99
**Warning! This README is related to the next version of vue-apollo (that supports Apollo 2.x). For the old release (supporting only Apollo 1.x), see [here](https://github.com/Akryum/vue-apollo/tree/master).**
1010

11-
Integrates [apollo](http://www.apollodata.com/) in your [Vue](http://vuejs.org) components with declarative queries. Compatible with Vue 1.0+ and 2.0+. [Live demo](https://jsfiddle.net/Akryum/oyejk2qL/)
11+
Integrates [apollo](https://www.apollographql.com/) in your [Vue](http://vuejs.org) components with declarative queries. Compatible with Vue 1.0+ and 2.0+. [Live demo](https://jsfiddle.net/Akryum/oyejk2qL/)
1212

1313
[<img src="https://assets-cdn.github.com/favicon.ico" alt="icon" width="16" height="16"/> More vue-apollo examples](https://github.com/Akryum/vue-apollo-example)
1414

@@ -108,7 +108,7 @@ new Vue({
108108
})
109109
```
110110

111-
You can access the [apollo-client](http://dev.apollodata.com/core/apollo-client-api.html) instances with `this.$apollo.provider.defaultClient` or `this.$apollo.provider.clients.<key>` (for [Multiple clients](#multiple-clients)) in all your vue components.
111+
You can access the [apollo-client](https://www.apollographql.com/docs/react/) instances with `this.$apollo.provider.defaultClient` or `this.$apollo.provider.clients.<key>` (for [Multiple clients](#multiple-clients)) in all your vue components.
112112

113113
## Queries
114114

@@ -122,7 +122,7 @@ Use `gql` to write your GraphQL queries:
122122
import gql from 'graphql-tag'
123123
```
124124

125-
Put the [gql](http://docs.apollostack.com/apollo-client/core.html#gql) query directly as the value:
125+
Put the [gql](https://github.com/apollographql/graphql-tag) query directly as the value:
126126

127127
```javascript
128128
apollo: {
@@ -166,7 +166,7 @@ export const resolvers = {
166166
}
167167
```
168168

169-
For more info, visit the [apollo doc](http://dev.apollodata.com/tools/).
169+
For more info, visit the [apollo doc](https://www.apollographql.com/docs/apollo-server/).
170170

171171
You can then use your property as usual in your vue component:
172172

@@ -207,9 +207,9 @@ You can use the apollo `watchQuery` options in the object, like:
207207
- `pollInterval`
208208
- ...
209209

210-
See the [apollo doc](http://dev.apollodata.com/core/apollo-client-api.html#ApolloClient\.watchQuery) for more details.
210+
See the [apollo doc](https://www.apollographql.com/docs/react/reference/index.html#ApolloClient\.watchQuery) for more details.
211211

212-
For example, you could add the `forceFetch` apollo option like this:
212+
For example, you could add the `fetchPolicy` apollo option like this:
213213

214214
```javascript
215215
apollo: {
@@ -414,7 +414,7 @@ this.$apollo.queries.tags.skip = true
414414

415415
These are the available advanced options you can use:
416416
- `update(data) {return ...}` to customize the value that is set in the vue property, for example if the field names don't match.
417-
- `result(ApolloQueryResult)` is a hook called when a result is received (see documentation for [ApolloQueryResult](http://dev.apollodata.com/core/apollo-client-api.html#ApolloQueryResult)).
417+
- `result(ApolloQueryResult)` is a hook called when a result is received (see documentation for [ApolloQueryResult](https://github.com/apollographql/apollo-client/blob/master/packages/apollo-client/src/core/types.ts)).
418418
- `error(error)` is a hook called when there are errors. `error` is an Apollo error object with either a `graphQLErrors` property or a `networkError` property.
419419
- `loadingKey` will update the component data property you pass as the value. You should initialize this property to `0` in the component `data()` hook. When the query is loading, this property will be incremented by 1; when it is no longer loading, it will be decremented by 1. That way, the property can represent a counter of currently loading queries.
420420
- `watchLoading(isLoading, countModifier)` is a hook called when the loading state of the query changes. The `countModifier` parameter is either equal to `1` when the query is loading, or `-1` when the query is no longer loading.
@@ -573,7 +573,9 @@ created () {
573573

574574
## Mutations
575575

576-
Mutations are queries that change 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). There is a mutation-focused [example app](https://github.com/Akryum/vue-apollo-todos) you can look at.
576+
Mutations are queries that change your data state on your apollo server. For more info, visit the [apollo doc](https://www.apollographql.com/docs/react/reference/index.html#ApolloClient\.mutate). There is a mutation-focused [example app](https://github.com/Akryum/vue-apollo-todos) you can look at.
577+
578+
**You shouldn't send the `__typename` fields in the variables, so it is not recommended to send an Apollo result object directly.**
577579

578580
```javascript
579581
methods: {

0 commit comments

Comments
 (0)