Questions tagged [vue-apollo]

Apollo/GraphQL integration for VueJS

339 questions
5
votes
1 answer

How to update nested Apollo Cache 3+ levels deep?

I have a NuxtJS app with deeply nested data in my Apollo Cache. As an example, my cache could look something like this, where Trips have many Categories which have many Items. ROOT_QUERY trips: [Trip] 0: Trip:1 categories: [Category] …
J. Jackson
  • 3,326
  • 8
  • 34
  • 74
5
votes
1 answer

How to update the Strapi GraphQL cache, after creating new data?

How to update the cache, after creating new data? Error message from Apollo Store error: the application attempted to write an object with no provided id but the store already contains an id of UsersPermissionsUser:1 for this object. The…
Cem Kaan
  • 2,086
  • 1
  • 24
  • 55
5
votes
1 answer

How to add headers in login.vue?

How to update headers of apolloProvider? Please check out nativescript-vue app repo: https://github.com/kaanguru/vue-apollo-login I can not explain properly so please check out the app. I don't know how to update appolloClient headers. App repo has…
Cem Kaan
  • 2,086
  • 1
  • 24
  • 55
5
votes
1 answer

How to handle .gql file imports in Jest tests

I'm trying to test a component that imports a .gql file. When I try to build the component in a Jest file, I receive this error: ( object. anonymous function(module exports require __dirname __filename global jest) { query getUser { …
jvpcavalcante
  • 53
  • 1
  • 6
5
votes
1 answer

Intercepting network errors on apollo-module using Nuxt

I'm using nuxt with apollo-module and I need to intercept possible network errors (401/403's to be more specific) so I can show some error modal and log out my user. In the documentation I see that inside the nuxt.config.js you can do like: …
Eduardo Pedroso
  • 839
  • 3
  • 12
  • 30
5
votes
1 answer

vue-apollo: GraphQL queries only run when using tags. Never works in script code. this.$apollo.queries is empty

I know I'm probably missing something really super basic here, I'm trying to run a graphql query with vue-apollo... if I use tags, it works fine If I try to run queries from inside my code, like in the basic examples in the docs (links below) then…
LaVache
  • 2,372
  • 3
  • 24
  • 38
5
votes
1 answer

How to readQuery() and writeQuery() from Vue-Apollo Store?

I want to edit some data in the cache manually. How can I readQuery() and writeQuery() in vue-apollo directly from a method of a Vue component? Im looking for something like this.$apollo.readQuery(...), which does not work. Where do I get the store…
Zezi Reeds
  • 1,286
  • 1
  • 16
  • 29
5
votes
1 answer

vue-apollo execute graphql query in router guard

I have an application where a user can sign up for an event. As soon as the user has signed up, he can visit routes he couldn't before. I'm using graphql for my api requests. The code in my route guard looks like this: router.beforeEach(async (to,…
Timo Jokinen
  • 707
  • 7
  • 26
5
votes
1 answer

How to implement a working Graphql query in Vue with Apollo?

Could someone please help me in getting my first queries working with scaphold.io? When I query the following to my scaphold, using the internal GraphiQL: query AllPrograms { viewer { allPrograms{ edges { node { id …
Code-MonKy
  • 2,026
  • 2
  • 14
  • 27
5
votes
2 answers

Show Apollo mutation error to user in Vue.js?

I am using Vue.js with Vue-Apollo and initiating a User mutation to sign in a user. I am using the graph.cool service. I have a request pipeline function setup to catch some errors, like an invalid email. When the request is made with bad / invalid…
Michael Giovanni Pumo
  • 14,338
  • 18
  • 91
  • 140
4
votes
1 answer

Vue 3 & Apollo Composable - Are we obliged to call useMutation and useQuery inside setup()

I am new in Vue 3 and Apollo Composable. I first created a Vuex store and a module service to fetch data from GraphQL endpoint. Furthermore, I noticed during implementation that I can't call useMutation and useQuery outside of setup(). Can I have…
Cedric Achi
  • 78
  • 1
  • 7
4
votes
0 answers

How to get the origin of an unhandled promise rejection in browser?

I'm currently facing an impossible to reproduce bug. My front error logger is Bugsnag and the front use Vue.js / vue router / vue apollo Graphql I'm sometime having errors popping in Bugsnag that say: unhandledrejection handler received a…
4
votes
3 answers

Apollo query inside nuxt.config.js

I'm trying to make a smart request in nuxt with nuxt-apollo-module in order to grab my routes for the nuxt-sitemaps-module (so I can create my sitemap with them). I need to make this request from within nuxt.config.js file. I have tried this way…
Joe82
  • 1,357
  • 2
  • 24
  • 40
4
votes
0 answers

How to combine two queries in one using GraphQL, Vue-Apollo?

I am working on a project called WikiJS. My task is to make a tree view looking left-hand-sidebar (LHS). The LHS is using dynamic data, which is pulled by using GraphQL, Vue Apollo queries. There are two queries: is displaying the first level of…
Terar
  • 53
  • 6
4
votes
0 answers

How to mutate watch in GitHub's GraphQL API?

I am using GitHub's GraphQL API for a project and I am expected to star or watch a repository. I am able to do the mutation on adding a star. Watching, however, has no word under the mutations. What am I missing here? I did quite a lot of research…
1
2
3
22 23