Display a list of links 2. Available values are: cache-first (default): return result from cache. Every useXxxxQuery can receive an options object to define query specific settings. To update the cache, we will be using the update function again to modify the cache. In this case, Apollo Client will automatically update the entity in the cache, using the data returned by the mutation execution. Use an options object#. This would allow us to test queries and mutations hooks as well as cache updates. Only fetch from network if cached result is not available. After installing vue-apollo in your app, all your components can now use Apollo through the apollo special option. ← The SIGNIN_USER_MUTATION looks very similar to the mutations we saw before. Last time, I wrote a simple Vue application using dummy data in our components.Today, we’re going to link it to the Apollo GraphQL API that I wrote earlier. To explore the new API, I will use one of the examples already shown in my Vue+Apollo talk - I call it 'Vue Heroes'. #Tag setup. Once the signup process is successful (that is, the user has been created), we redirect the user to the login page (which we’ll create shortly). You can use useMutation in your setup option by passing it a GraphQL document as the first parameter and retrieve the mutate function: It's generally a good idea to rename the mutate function into something more explicit: We can now use it in our template by passing variables to mutate (now called sendMessage): We can call sendMessage in our JavaScript code too. The update function comes in handy to update the cache for }, query ($threadId: ID!) As in the sections before, you’ll set the stage for the login functionality by preparing the VueJS components that are needed for this feature. }, mutation sendMessage ($text: String!) }, mutation sendMessage ($text: String!) →, mutation sendMessage ($input: SendMessageInput!) The mutation prop, which we give it the todoToggle mutation from our mutations. Welcome back to the final part of our Vue with GraphQL series. Vue-Apollo — This is an Apollo Client integration for Vue.js, it helps integrate GraphQL in our Vue.js apps!. I'll try and create a sandbox demo this weekend to share. npm install --save vue-apollo@next graphql apollo-client apollo-link apollo-link-context apollo-link-http apollo-cache-inmemory graphql-tag Let’s quickly go over each package: vue-apollo: An Apollo/GraphQL integration for VueJS. Within the signup method, we make use of mutate method available on this.$apollo (from the Vue Apollo plugin). { variables: Variables object.. awaitRefetchQueries: By default, refetchQueries does not wait for the refetched queries to be completed, before resolving the mutation Promise. In our example, this is very useful for resetting the message input: This is triggered when an error occurs during the mutation. Here is an example: