You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**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).**
10
10
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/)
12
12
13
13
[<imgsrc="https://assets-cdn.github.com/favicon.ico"alt="icon"width="16"height="16"/> More vue-apollo examples](https://github.com/Akryum/vue-apollo-example)
14
14
@@ -108,7 +108,7 @@ new Vue({
108
108
})
109
109
```
110
110
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.
112
112
113
113
## Queries
114
114
@@ -122,7 +122,7 @@ Use `gql` to write your GraphQL queries:
122
122
importgqlfrom'graphql-tag'
123
123
```
124
124
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:
126
126
127
127
```javascript
128
128
apollo: {
@@ -166,7 +166,7 @@ export const resolvers = {
166
166
}
167
167
```
168
168
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/).
170
170
171
171
You can then use your property as usual in your vue component:
172
172
@@ -207,9 +207,9 @@ You can use the apollo `watchQuery` options in the object, like:
207
207
-`pollInterval`
208
208
- ...
209
209
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.
211
211
212
-
For example, you could add the `forceFetch` apollo option like this:
212
+
For example, you could add the `fetchPolicy` apollo option like this:
These are the available advanced options you can use:
416
416
-`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)).
418
418
-`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.
419
419
-`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.
420
420
-`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 () {
573
573
574
574
## Mutations
575
575
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.**
0 commit comments