Apollo/GraphQL integration for VueJS
Questions tagged [vue-apollo]
339 questions
0
votes
0 answers
Can't modify vuex state through a mutation
So I have this mutation in my store:
DELETE_POST: (state, index) => {
state.Posts.splice(index, 1);
}
and I also have this action:
delete({ commit, state }, index) {
commit('DELETE_POST', index);
}
This action basically deletes a post from an…

Sammi
- 286
- 1
- 3
- 11
0
votes
2 answers
GraphQL vue apollo query and mutation same view
I'm just starting to use GraphQL with Apollo and Vue, so it might be a "stupid" question but I can't figure how to do.
How can I do inside the same view, a query to fetch one object, and update it using a mutation
Let's say I have a simple…

Jerome
- 219
- 1
- 2
- 10
-1
votes
1 answer
Failing to setup Websocket link
Been trying to get a Subscription working with Hasura and Vue Apollo with a websocket link with Vue Apollo with Vue3. Have it all seemingly setup.
The subscription works in Hasura so that’s right.
The query version worked with the HTTP link.
So the…

Max Sinclair
- 1
- 1
-1
votes
1 answer
How to solve JSON.parse Error from Vue Apollo Client with fetchOptions: {mode: 'no-cors'}
When using the Apollo client to fetch data, I'm getting the Error from the Apollo client: 'Network error: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data'. (With Firefox)
With Chrome the Error message is a bit…

Stefan
- 123
- 1
- 10
-1
votes
1 answer
ERROR: Property "mainText" was accessed during render but is not defined on instance
I'm using queries Apollo and i want to know how to wait datas to display my page.
Because i'm getting warning and errors. See screen
import TemplatePresentationPage from "./../components/TemplatePresentationPage.vue";
import gql from…

Yannis Haismann
- 54
- 6
-1
votes
1 answer
Vue: Async Apollo mixin function prints a value, but returns undefined
Async/return undefined queries are common on here but I've tried all permutations of answers and seem to be getting nowhere... Apologies if I couldn't find it.
I have taken all Apollo mutations out of my main Vue code into a global mixin so I can…

dangerzone
- 1
- 3
-1
votes
1 answer
Constructing query string with gql-tag in Vue-apollo
I believe it is possible to construct GraphQL query string dynamically with JS but I can't figure out the syntax.
I have a query in my Vue component which looks like this:
apollo: {
metricsOee: {
query: METRICS_OEE,
loadingKey:…

Dvdgld
- 1,984
- 2
- 15
- 41
-2
votes
1 answer
Edit readonly javascript objects
I have a read-only object that is returned by GraphQL (vue-apollo) query, the result which is read-only looks something like this:
result: {
id: 'yh383hjjf',
regulations: [{ title: 'Test', approved: false}]
})
I want to bind this to a form and…

capiono
- 2,875
- 10
- 40
- 76
-2
votes
1 answer
Redirect to an error page when API is unavailable
I'd like to redirect to an error page when my GraphQL API is down instead of showing an empty page because the content couldn't load.
I think I have to do the redirection when Apollo receives an error 503 as a reply but I don't know how I can do…
user7770410