Tag: vue.js
-
Vue, Vitest and MSW: Mocking and testing a GraphQL query result in composable not possible
0 I made a simple dummy application as in the end it will fit in a much bigger enterprise application, but I first made a proof of concept to make sure it works… and it doesn’t yet! I’m at a loss why this is. I’ve followed the documentation on https://mswjs.io/ for getting the mock in…
-
Get Result from apollo client error undefined
0 I’m trying to use the result I’m getting from my apollo client. but it keeps giving me error of undefined although the request send was success in network. It means I cannot get access to the result like normal! the code in my store is: async questionSearch({ commit }, data) { const ALL_QUESTION_SEARCH =…
-
How to commit Personal Access token from github
1 I made a test app which uses github’s graphQL api. For using this api the personal access token has been placed inside the code. Now whenever I commit the code with token, I get email from github which has title: "Action needed: GitHub access token found in commit, any app using this secret may…
-
How to update query on route change using Vue and Urql
0 I’m trying to find a way to update my query when the route changes (same component). The query is being selected using route meta data. Between Vue router’s navigation guards, hooks, watching for changes, etc, and Urqls "useQuery," I can’t figure out how to structure it to give me new data when the route…
-
Graphql “Unknown argument “bookId” on field “book” of type “Explore”.”
0 I’m trying to call my API but it keeps giving me 400 Error request with the error of: message: "Unknown argument "bookId" on field "book" of type "Explore"." I’ve just read the documentation of Apollo graphql and tried to fetch my data the way it said with variables and args, and it’s in my…
-
Uncaught (in promise) GraphQLError: Syntax Error: Unexpected character: “.” using GraphQl in Vue
-1 I’m using graphql in Vue and I came up with this problem! This is my code for calling graphql in store: async fetchBookContent({ commit }, data) { let token = data.token let bookId = data.bookId const ALL_BOOKS_QUERIES = gql` query { book(args:{token:${token},bookId:${bookId}}){ information{ name } } } ` const { result } = useQuery(ALL_BOOKS_QUERIES)…
-
Apollo-client returns “400 (Bad Request) Error” on sending mutation to server
13 I am currently using the vue-apollo package for Apollo client with VueJs stack with django and graphene-python for my GraphQl API. I have a simple setup with vue-apollo below: import Vue from ‘vue’ import { ApolloClient } from ‘apollo-client’ import { HttpLink } from ‘apollo-link-http’ import { InMemoryCache } from ‘apollo-cache-inmemory’ import VueApollo from…
-
How to allow Urql (typescript) to accept Vue reactive variables for queries created with graphql-codegen
2 I’m building a Vue project with urql and graphql-codegen. Urql has the ability to take Vue reactive variables when using useQuery() to enable useQuery to be reactive and update when the variables do. But graphql-codegen is creating the type for the variables parameter to require scalars (ex. string) and so typescript is throwing an…
-
Vue Apollo Composable useQuery Ignores Reactive Filter Variable Change Even Though It Triggers a Refetch
0 I am using Vue Apollo Composable with useQuery to perform a GraphQL query. My pagination works as expected; however, I am facing an issue with my filters.verified variable. Although I see the variable toggling in the client-side (I’m logging it), the network request still shows the initial value as true. Problem: When I click…
-
Can’t access value from apollo response with Vue/Nuxt
0 I have an apollo request which returns some data, but no matter what I do I can’t access the value and at this point I’m all out of ideas, maybe I’m missing something obvious, here’s the request : mutation MyMutation($jwtRefreshToken: String = "") { refreshJwtAuthToken(input: {jwtRefreshToken: $jwtRefreshToken, clientMutationId: "uniqueId"}) { authToken } } JS…