apollo-client Questions

4

Solved

I am setting up a new typescript project with react and apollo client. I am attempting to wire in the client like so: const client = new ApolloClient({ cache: new InMemoryCache(), link: new HttpL...
Coulisse asked 21/7, 2020 at 0:14

3

I am using vue 3 with composition api with apollo/client . I did everything from documentation but this is as far I could go.I provied a correct backend url and just cant figure it out.This is my c...
Balmy asked 22/1, 2021 at 18:32

2

Solved

I am building a chat service and I want to handle the cases when the subscription(websocket) connection is disconnected. Apollo client is configured like bellow. I removed unnecessary code like cac...
Shrunk asked 8/6, 2021 at 7:30

2

Solved

Using useLazyQuery() hooks from @apollo/react-hooks I was able to execute a query on click of a button. But I cannot use it execute same query on consecutive clicks. export default ({ queryVariabl...

1

Solved

I'm trying to get data from Apollo cache. I know that data is there because in Apollo dev tools specified records are available. In my react app I making a simple click and set Id which later passe...
Theodora asked 6/6, 2021 at 21:8

1

I am learning apollo and graphQL and have a simple application that displays a list of data, with a fetchMore function that adds to the array. I would like to remove the updateQuery as it is being ...
Mcgehee asked 21/8, 2020 at 12:52

2

I am building a React app with Eslint setup. In my app, I am using GraphQL @apollo/client dependency. When I tried to do import { setContext } from '@apollo/client/link/context' I got an eslint err...
Riorsson asked 24/5, 2021 at 19:8

0

I want to fetch data from GraphQL, I've tried with static params and it worked. But when I tried to use QueryParams, it returned error 404 on my network. I want my GraphQL query to become dynamic p...
Buckshee asked 17/5, 2021 at 11:24

1

I'm upgrading my application with Apollo Client from v2 to v3 and I can't find the correct solution to the following problem. I have a schema with a product and inside this product, a price. This p...
Loaiasis asked 25/8, 2020 at 17:50

1

Solved

How do you unit test (with jest and enzyme) a functional component that uses the useReactiveVar hook? Should I mock the useReactiveVar hook with jest?
Storyteller asked 15/11, 2020 at 18:49

1

I am trying to use relay style pagination. However, I am getting trouble on infinite scrolling. When i scroll or load next sets of data then I just get the current data without it being merged to t...
Hammack asked 1/3, 2021 at 0:25

1

I am working with the Apollo GraphQL client for the first time in my swift project. Followed all the steps mentioned in their document and searched over google for my issue but had no luck. I have ...
Hilliard asked 29/4, 2021 at 13:27

1

Solved

I am extremely confused. Before the real problem comes, let me tell you how I got started. maybe i'm on the wrong way. so you can suggest other ways We do not use graphql for sign-in and sign-up in...
Gerrygerrymander asked 24/4, 2021 at 19:22

1

Solved

I'm new to Next.js and have some questions about client-side rendering and server-side rendering in Next.js I see there are two ways to fetch data on Next.js. One of them is to use the useQuery ho...
Mongolic asked 19/4, 2021 at 14:4

2

Solved

I am implementing using @apollo/client, but i do not see any complete example of @apollo/client with react. If i search i get example with apollo-client and apollo boost. What is the difference bet...
Finnougric asked 29/9, 2020 at 12:13

1

I posted this in the apollo-client repo, but thought I would ask stackoverflow as well Hello! I'm new to apollo (and graphql as a whole) and am having some questions about SSR / SSG. I conceptually...
Bookstore asked 15/4, 2021 at 21:32

0

I have a simple React component that uses Apollo's useQuery to fetch data. The problem is, because the component is being rendered twice, it is calling useQuery twice, which is then calling the Apo...
Oui asked 12/4, 2021 at 14:34

3

Solved

So when i get the response from my query, i can see there is a loading property. But i don't really get why they would pass it along. Because when you get the response it means that the loading is ...
Saturniid asked 18/5, 2018 at 9:56

1

Solved

I'm trying to create a custom Apollo Client mutation hook in a TypeScript project in the following shape: const customApolloMutation = () => { const [ mutationFunction, { data, loading, erro...
Selfrighteous asked 7/4, 2021 at 17:51

1

Apologies for the long question, but I'd be really grateful for some thoughts/help on the best strategy for cache invalidation & refetching queries in Apollo Client 3. Background First, some...
Westernize asked 21/2, 2020 at 18:56

2

Solved

I have a menu component that appears globally. What is the best practice for getting data into that component? I'm trying to take advantage of static generation that Next.js offers but all data fet...
Earp asked 19/8, 2020 at 20:23

3

Solved

Hy I'm using the Apollo Client with React. I query the posts with many different variables. So I have one post in different "caches". Now I want to delete a post. So I need to delete this...
Ligetti asked 31/7, 2020 at 13:27

2

Solved

I'm trying to add authorization token to the apollo client in react js to let the users login ... index.js import React from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter as Rou...
Sauerkraut asked 25/1, 2021 at 12:15

1

Solved

I have a simple Apollo set up. In this CodeSandbox example I'm using the MockedProvider but the live one also works: https://codesandbox.io/s/winter-glitter-o8ug5?file=/src/App.js:0-1164 import { A...
Gentlefolk asked 3/3, 2021 at 10:38

2

Solved

I am using GraphQL with Apollo-Client in my React(Typescript) application with an in memory cache. The cache is updated on new items being added which works fine with no errors. When items are remo...
Villosity asked 30/7, 2020 at 5:36

© 2022 - 2024 — McMap. All rights reserved.