apollo-client Questions

5

I'm using react-router V6 and trying to test the new feature of useOutletContext. my testing library is testing-library/react and I'm not sure how to pass the Context data in the test. In the TSX c...
Thirteen asked 28/12, 2021 at 12:59

5

Solved

I am trying to implement pagination in a comment section. I have normal visual behavior on the website. When I click the get more button, 10 new comments are added. My problem is the request is exe...
Varus asked 2/3, 2021 at 14:38

1

Solved

Should Apollo retryLink come before or after the errorLink? Some examples show it as before https://medium.com/@joanvila/productionizing-apollo-links-4cdc11d278eb#3249 while some show it after http...
Kingfisher asked 21/4, 2022 at 8:40

3

I have the following code that runs a mutation to update a post to "published" the mutation works great! It updates the data as expected. However, the data property is always undefined in...
Balkin asked 21/4, 2022 at 15:49

3

I have this code right here import React from "react"; import { useQuery } from "@apollo/react-hooks"; import gql from "graphql-tag"; const FETCH_POSTS_QUERY = gql` ...
Artistic asked 7/5, 2022 at 18:32

1

I'm using react router and apollo client (v 3.0) in my react project. I have a nested route, let's say A -> B, where I use useQuery hooks to fetch different sets of data via graphql queries, let...
Juttajutty asked 16/7, 2020 at 15:54

4

Our GraphQL server responds to a query with data that includes an array of objects each of which shares the same id and different values for a different key. For instance, we might have an array th...
Studer asked 25/10, 2017 at 17:45

3

I am new to NextJS. I have a page that needs to display real-time data pulled from a Hasura GraphQL backend. In other non-NextJS apps, I have used GraphQL subscriptions with the Apollo client libr...
Shuntwound asked 12/5, 2020 at 3:12

2

Solved

Is there anyway that I can check all the cache, eg: changes within apollo for debugging. Something like redux store, where you can view the whole state tree. They mentioned: The cache stores the o...
Kawasaki asked 22/7, 2020 at 9:7

1

I am using React with apollo-client. If user not the owner of note it should be redirected. But after redirecting I am receiving: Warning: Cannot update a component ('BrowserRouter') while renderin...
Paul asked 27/6, 2022 at 14:28

1

I'm using the hooks such as useQuery from @apollo/client in my react app for querying my AppSync backend. I have defined the schema in my Serverless AppSync project in a separate repo. In order to ...
Coeternity asked 13/4, 2020 at 9:25

2

Solved

So I have a GraphQL server that I wrote in Go, following this tutorial pretty closely. I have my front-end written as a Next.js application, and I am currently trying to create a client to connect ...
Glarum asked 4/5, 2022 at 17:11

2

Solved

Update January 22nd 2020 The solution from @slideshowp2 is correct, but I could not get it to work at all, due to this TypeError: TypeError: Cannot read property 'query' of undefined Well it ...
Moccasin asked 20/1, 2020 at 19:23

0

I'm using Apollo Client v3.5.10 in React Native in a project managed by Expo v44.0.6. Occasionally, a GraphQL query returns an error that says Unexpected token < in JSON at position 0. I underst...

2

Solved

The question is about the interaction of a mutation, optimistic response, and a watchQuery. I have a mutation "myMutation" which has an "optimisticResponse" and an implemented "update" function. ...
Dominique asked 16/5, 2018 at 7:44

1

I am wondering if it is possible to have nested values using typePolicies of the InMemoryCache For now you can define flat fields policies new InMemoryCache({ typePolicies: { Query: { fields: { ...
Balneology asked 8/1, 2021 at 16:24

1

I need some help. I'm a newbie in apollo client reactive variables. There is a component where the displaying of the message depends on a variable that values from the local state (apollo cache). H...
Semivitreous asked 23/3, 2021 at 8:23

2

While trying to download the schema using npm run schema:download I am receiving the following error. [email protected] schema:download npx apollo service:download --endpoint=http://localhost...
Oath asked 25/9, 2021 at 4:58

1

Solved

I previously asked this question on Apollo’s community chat, but am reposting it here because it wasn’t answered after two weeks. This question is about the new cache introduced by Apollo 3.0. This...
Foliated asked 14/9, 2020 at 8:53

6

Solved

I am using Apollo Client to make an application to query my server using Graphql. I have a python server on which I execute my graphql queries which fetches data from the database and then returns ...
Duleba asked 7/6, 2017 at 5:5

1

I have a page that is loading connected apollo-client pages as widgets inside of a main page. My GraphQL server is self-hosted. They are served up through iFrame (self-hosted), connecting back to m...
Danikadanila asked 17/10, 2019 at 17:37

4

after installing new version of apollo client getting this Error. I tried other versions and to downgrade but nothing. Also I tried to specify in metro.config.js to resolve "cjs" type of ...
Centenary asked 13/12, 2021 at 16:57

3

Solved

I am using the apollo-client library to query data from my Graphql server. Some of the queries are sent to the server every 5 seconds through apollo polling ability. Is there a generic way to add ...
Buote asked 1/2, 2018 at 8:53

5

I'm running into an error after installing Apollo when trying to run my React Native Expo app. I've tried deleting node-modules and re-installing, resetting cache, restarting computer, and still no...
Ornamentation asked 22/11, 2021 at 19:51

4

Solved

Currently I have a useLazyQuery hook which is fired on a button press (part of a search form). The hook behaves normally, and is only fired when the button is pressed. However, once I've fired it...
Abrupt asked 14/8, 2019 at 17:37

© 2022 - 2024 — McMap. All rights reserved.