Apollo client usequery github. How to reproduce the issue: I have the following simple q.
Apollo client usequery github. Use Apollo Client as React hooks.
Apollo client usequery github g To run a query within a React component, call useQuery and pass it a GraphQL query string. Jun 20, 2023 · There is a case where ApolloClient enters an infinite request loop whenever there is 2 useQuery with the same query but different variables, e. writeQuery will cause an infinite loop of reloading the component over and over again. Contribute to trojanowski/react-apollo-hooks development by creating an account on GitHub. * * To run a query within a React component, call `useQuery` and pass it a GraphQL query document. I was hoping that I could use a refetch (returned from useQuery) to pull only from the cache, but from debugging and looking throug Dec 15, 2020 · Hi all. Versions 3. This makes updating my code a massive pain, and breaks every usage of useQuery with an @client directive Feb 5, 2020 · In our use case we switch Apollo clients depending on a context. ; The undefined result mean the query executes the resolver. 5. disableNetworkFetches switches from true to false after creation. 8 directly. 44. . 👍 3 XXuain, fmccready, and ArunOnly1 reacted with thumbs up emoji ️ 3 brainkim, rayhatfield, and fmccready reacted with heart emoji Mar 30, 2021 · Hi folks, I believe this behavior may be improved if you run npm i @apollo/client@3. When your component renders, useQuery returns an object from Apollo Client that contains loading, error, and data properties you can use to render your UI. 👍 8 prabhuignoto, kkak10, marianocodes, alobato, antsav, david29832, khangtu22, and bvsbharat reacted with thumbs up emoji 👀 3 SyedAsimAliSE, kkak10, and I just ran into this upgrading from apollo-client/v2 to @apollo/client@3. How to reproduce the issue: I think it is something wrong after version 3. Actual outcome: refetch triggers the new request but didn't update the loading state variable. Jan 12, 2020 · When variables change in useQuery, Apollo Client should repeat the full request lifecycle exactly as for the initial set of options, including checking the cache for possible hits. query() or skip: true (for useQuery). The network request completes successfully, however the hook does not reliably update – occasionally (maybe 50% of the time) it stalls out and remains in a loading state. 6 Feb 29, 2024 · Issue Description I have a strange issue where two successive calls to fetchMore will cause a bug only if the query was changed once before. . Spectrum discussion is ineffective at surfacing and maintaining knowledge of a solution; this I forked the hooks example from the react-apollo repo and it seems like the value for loading is never being updated, even when the data is being returned properly? I set up my own project and was experiencing the same issue when using u It's a major improvement for Apollo to support this, and we are now going to stick with Apollo until these experimental hooks are released so that we can utilize them before making a decision. Jan 25, 2022 · apollo-client 3. But Oh-My, this was hard to trace down. Already have an account? Oct 28, 2019 · Apollo Client version: 2. Solutions to this are client. Jul 13, 2022 · I believe this might have been a misconception about useQuery and react-router-dom. ) as we can see not a good idea. nextFetchPolicy option allows updating options. 8 to install/test version 3. I cannot find a way to attach headers to queries made with useQuery on the client side. The Apollo client library includes a MockedProvider component which allows query and mutation results to be mocked, but didn't offer enough control within unit tests. Oct 18, 2023 · AWS AppSync packages are provided by a third party, however. Versions "@apollo/client": "3 Sep 28, 2022 · Thanks for some more of the context! Would you be willing to share the Apollo client and React version version you're using? That would go a long way toward helping us understand if it's an Apollo bug or something else! when the fastest query (the five-day one) solves, but it crashes - as the stockData initially passed is always an empty array I'm having a similar issue with useQuery in React Native. Loading should be true, then false. It should re-fetch when skip is togged from true to false. Mar 7, 2010 · Hi @sven-ahrens 👋. PS: because client. After disabling React. The issue is especially bad because skip only intermittently fails: it appears it correctly skips the first useQuery but fails for later queries (the second time the query is loaded). In my opinion, if you have a normal size app (tens not hundreds of queries), then dealing with the impact of a fetchPolicy of 'cache-first' for a list of items has a massive overhead. 8 to latest on npm probably this coming Monday (and close this issue), if everything looks good. This is useful when instantiating multiple clients to identify the client instance more easily. Actual outcome: Long task is created when rendering components with many useQuerys. Apollo's useQuery defaults to only ever checking the cache if it exists. Everyone else moved on to URQL and so should you. Dec 13, 2022 · Intended outcome: Using the same useQuery throughout many components should have relatively low performance impact. Fetching data in a simple, predictable way is one of the core features of Apollo Client. It should skip the network request when skip is true. This partial data can be missing fields that are req Nov 23, 2021 · Saved searches Use saved searches to filter your results more quickly Dec 21, 2021 · Hello, I am working on a NextJs application and I have an issue while rendering the result to send to the client. Network requests are still sent on the server, but following the Apollo Client API, not the Remix APIs, because Apollo Client is a client-side library. To run a query within a React component, call useQuery and pass it a GraphQL query string. Apollo codegen generates correct types out of the box without having to worry about adding additional plugins. May 6, 2022 · Intended outcome: useQuery hook that is polling with a fetchPolicy: no-cache should not update the cache. Using useQuery for asynchronous logic (user events etc. May 24, 2022 · Since Apollo Client is (more or less) a global state manager, it could be useful to look at what other global state management libraries do. Aug 20, 2020 · However, after updating to @apollo/client v3 (or @apollo/react-hooks v4), the data resets to undefined whenever the query reloads. I noticed that using the client like the docu suggests is also leading to the warning for me. vue-apollo. Jul 23, 2020 · Since updating from apollo client 2 to @apollo/client 3 (3. I'm not really sure if its an intended behavior or a bug so I'm posting this as a question. Jun 2, 2020 · Intended outcome: I have a local field named "displayedGame": gql`query GetDisplayedGame { displayedGame @client { id myPlayerId players { id name } } }` It references a Game in the cache: ROOT_QUE I was having the same issue, I believe the problemas was that when importing import { gql, useQuery } from "@apollo/client" you are importing a . This article demonstrates how to fetch GraphQL data in React with the useQuery hook and attach the result to your UI. I want to be able to get both the network status code, and the graphQL errors out of the result. May 9, 2022 · In latest versions of Expo React Native (also newest versions of Apollo Client for React) useQuery no longer works. The actual problem is, that I wanted to increase the number from 500 to 5000 because in my case 0. Jun 25, 2020 · The HOC have in general continuously configuration issues and misbehaviours, like for example the refetchQueries also don't trigger the data. Actual outcome: Nov 16, 2022 · When we end up with a lot of useQuery hooks on the page, we've noticed significant performance issues trying to unmount the components on navigation. Oct 1, 2021 · I got two answers in github for that question, combined them both and it finally worked: Pass notifyOnNetworkStatusChange: true to useQuery: const { data, loading } = useQuery(getRecommendationsQuery, { notifyOnNetworkStatusChange: true }); Pass documents, not objects to refetchQueries prop: Nov 23, 2021 · I am using the latest versions and am seeing the same issue with the custom NextJS app that implements isomorphic rendering. Intended outcome: After Jan 10, 2020 · This made my code a lot cleaner and easier to read; Actual outcome: With 3. Actual outcome: Only useLazyQuery and useQuery's refetch with identitical variables will return cache. Jun 11, 2021 · Intended outcome: Complex fragment merges work as though they were all specified in a single large query. I have a first step that uses the getDataFromTree to fetch all the data and then renders the app providing the apollo client that has the cache. We're still maintaining this repo in the meantime, but we've definitely fallen behind on certain issues due to time constraints (PR's are definitely welcome!). Aug 14, 2019 · In the component which uses the useQuery I also retrieved the client with useApolloClient() and when I use the readQuery() with the same query this contains the correct data even if I log both the results, the readQuery is correct the useQuery not. Aug 5, 2019 · Intended outcome: @client query with fetchPolicy no-cache or network-only should always hit local resolver. Is there a way to not get the first undefined on initial render?. How to reproduce the issue: I have the following simple q Apollo Client 3 will have React Suspense support. This sets a trap for engineers. 3. readFragment instead, you can find it in the documentation here 🚀 Apollo/GraphQL integration for VueJS. 0-beta. By default, the useQuery hook checks the Apollo Client cache to see if all the data you requested is already available locally. Sep 1, 2020 · When React mounts and renders a component that calls the useQuery hook, Apollo Client automatically executes the specified query. 2 to be exact) a useQuery(GET_CART) will ALWAYS return an undefined first in the child components before returning the data from the cache. Nov 18, 2019 · “Client-side schema. I'd like to remain using the data until it updates. nestedObject field, so InMemoryCache can safely merge these objects: existing: {"__typename":"NestedObject May 28, 2020 · Reliable delivery of loading results is one of the core benefits that Apollo Client strives to provide, expecially since handling loading states tends to be such an annoying, error-prone task in hand-written state management code, and Apollo Client is all about keeping hand-written state management code to a minimum. cjs and my react-scripts version did not support that extension on jest. Jun 1, 2021 · Something useful I discovered while debugging: if you install the Apollo Client Devtools extension on chrome, select the failing query, click "run in GraphiQL", click "Load from cache", and then run the query, you will get a console warning telling you which fields are missing in your mock implementation. com/apollographql/apollo-tooling#apollo-clientcodegen-output. Take the given example: import {useState} from 'react' import { DocumentNode, gql, useQuery } from '@apollo/clie Mar 10, 2021 · Issue Due to the compatible issue, I am using ApolloClient to form my AWS AppSync API client, so that I can use ApolloProvider to pass the client to different sub-component. I have configured a brand new app with the following dependencies: { "name": Feb 8, 2021 · Intended outcome: In code like this: useQuery(QUERY_FOR_POLL, { variables, pollInterval: 10000, // 10s skip, }); Polling should start when skip is set to false. Versions @apollo/client 3. That became a problem because I'd like to not rely on "Initial Loading" states for the data after an initial value is already present. As this is a very old issue and there's nothing really actionable (the SSR story is changing a lot right now and will not include useQuery going to the future with suspense) for us right now, I'm going to close this Jun 29, 2022 · I found out that useQuery works as inteded from version 3. Issue Description I am having issues grabbing data from my endpoint when I use apollo/client inside an expo application. The level of this support is still a bit up in the air, as we don't want to tie the release of AC 3 to React's release schedule, and Suspense for data fetching is still experimental. Jun 8, 2021 · Apollo client assumes that the id field is a unique value that is safe to use as an identifier, but here it seems that's not the case. 0, because in version 3. This doesn't happen when using the client from the context. I suggest instead of using useQuery, you can use client. Otherwise not. In most cases for our application, we render leaf nodes that are keyed by id, like you mentioned, and use useQuery hooks with cache-only fetch policies Jul 10, 2023 · The simple answer here is: we are able to execute the query on the server with useSuspenseQuery but have to wait for the browser for useQuery, so useSuspenseQuery is going to get you results faster. Jun 19, 2023 · Cache data may be lost when replacing the nestedObject field of a RootObject object. Not sure if it is related, but by logging what we receive on nextFetchPolicy the initialFetchPolicy and lastFetchPolicy are set as standby and not cache-and-network or cache-first which were the configured options in the client. So if manually resetting disableNetworkFetches is working for you, would that change whether you need to continue using ssrForceFetchDelay in your app? Jul 29, 2020 · Intended outcome: Populated Apollo Cache could be filtered with useQuery's refetch or useLazyQuery. g Fetching data in a simple, predictable way is one of the core features of Apollo Client. Actual outcome: useQuery triggers on second render. You'll also learn how Apollo Client simplifies data management code by tracking error and loading states for you. Oh and the refetch function actually works :) P. The issue in my case seems to be when I add fetchPolicy: 'network-only' to it. Its sole function is to set disableNetworkFetches to false after X milliseconds. Aug 30, 2022 · Intended outcome: A typical reason for skiping a useQuery() is the query is not yet ready to be called, for whatever reason. I use useLazyQuery in component with useQuery and useMutation. That way the server could query the latest data, and thus, would serve it to the client. Prerequisites Shared context between your component and your network interface (Apollo Link). Actual outcome: Resolver is only called once, all subsequent requests are cached. Nov 18, 2021 · alessbell added the project-apollo-client (legacy) LEGACY TAG DO NOT USE label Apr 28, 2023 jerelmiller added 🪝 react hooks Feature requests related to React hooks and removed project-apollo-client (legacy) LEGACY TAG DO NOT USE labels Jan 22, 2024 Sep 28, 2022 · Thanks for some more of the context! Would you be willing to share the Apollo client and React version version you're using? That would go a long way toward helping us understand if it's an Apollo bug or something else! when the fastest query (the five-day one) solves, but it crashes - as the stockData initially passed is always an empty array Oct 29, 2019 · I'm having a similar problem, and did find a temporary solution. Data always undefined. why is it recommended to use server components to fetch data with apollo client? Aug 12, 2021 · Generally, when using Apollo Client on the server, you should create a new instance of Apollo Client for each incoming request. 0. To modify the client I tried two things: Use apollo setContext to only update the header (this doesn't work) Jul 21, 2021 · Prerequisities When using useQuery with options Fetch-Policy: "network-only" Intended outcome: One network request for fetch policy "network-only" Actual outcome: Module: useBaseQuery. Here's a summary of what I'm experiencing: I use useQuery to load a query. How to reproduce the issue: I cloned the demo codesandbox from the documentation and added the minimum reproducible code. The initial load is fine but any updates to data in that query using cache. Drop-in replacements for @apollo/client's useQuery, useMutation and useSubscription hooks with reduced overhead and additional functionality. Their focus is different now. Jul 6, 2022 · Hi, I've stumbled on an issue with auto refetching. Whilst using the impressive @apollo/client library, I ran into issues while trying to unit test components which used the GraphQL Query and Mutation components. You can read more about the package changes in the migration guide. Oct 16, 2020 · Hi, I'd like to ask you, is there any possibility to add custom header with query hook. Reproduction outline fetchpolicy = "network-only" paginating with a: custom merge function custo Feb 4, 2021 · From what I understand (according to the name), I guessed that useQuery would do just that (a bit like useContext or useState, I assumed it would trigger a re-render everytime the client gets modified). To address this problem (which is not a bug in Apollo Client), either ensure all objects of type NestedObject have an ID or a custom merge function, or define a custom merge function for the RootObject. - Rewrite big parts of useQuery and useLazyQuery to be more compliant with the Rules of React and React Compiler #11936 1b23337 Thanks @jerelmiller! - Add the ability to specify a name for the client instance for use with Apollo Client Devtools. But what if you want to execute a query in response to a different event, such as a user clicking a button? * * To run a query within a React component, call `useQuery` and pass it a GraphQL query document. It seemed that doing the above wasn't enough, so I had to set certain queries as fetchPolicy: 'network-only' on the server's apollo-client too. S Most Api of urql is adopted from Apollo Client so it's easy to migrate. 4 and found this happening in any existing components that use refetch, downgrading back to 3. setOptions. I switch to new version of Apollo client. 20, this is no longer the case. 0 (and maybe lower, I haven't checked) up to version 3. Actual outcome: The cache is updated with the query results from polling. I can see that the cache is populated properly on the server-side and hydrated on the Don't waste your time on Apollo. x that needs fixing. something like this const [loadData, { loading, data }] = useLazyQuery(Query, { headers: { . 6 (also was able to reproduce with 3. You can optionally set a client-side schema to be used with Apollo Client, through either the ApolloClient constructor typeDefs parameter, or the local state API setTypeDefs method. 4, client built in React, using hooks. 6 The text was updated successfully, but these errors were encountered: 👍 4 rossmartin, GabrielNastase, jmacpherson, and yobananaboy15 reacted with thumbs up emoji ️ 3 brainkim, xbaun, and genintho reacted with heart emoji Nov 23, 2019 · @dylanwulf is right; we're in the process of merging this project directly into apollo-client, for the release of Apollo Client 3 (you can follow along here). How to Oct 12, 2022 · **Note: Using Apollo Client with Remix results in using Apollo Client’s hooks in lieu of Remix’s loader and action functions. Dec 17, 2018 · I'm using newest "@apollo/client": "3. May 13, 2022 · Actual outcome: After setting the option skip: true, the query is skipped forever, even if we update skip to false and change the query variables. refetch() function (and any other functions that could trigger a new request) with something like this to attempt to intercept May 28, 2021 · I've tried change the version of @apollo/client to older one like 3. You can find the code used in this post on GitHub. Execute useLazyQuery hook using fetch-policy as cache-and-network on @apollo/client v3. We use the Apollo client useQuery hook for fetching data all over our app. For some reason the response data type get set to 'any' causing implicit any errors all over our codebase. For example, I am pretty sure that Redux + react-redux does not do any batching unless you explicitly use the batch function that they export. The data object initially has no value. I've reproduced this bug. Versions. is popping up all over my application after installing msw. In my case the 1st call should not skip but later ones should. 0-rc. @apollo/client is version 3 of the library and apollo-client is version 2 of the library. useQuery usually used for making calls on the component mounting life-circle. Aug 10, 2022 · Cannot find module '@apollo/client' or its corresponding type declarations. I should be able to see the following console logs after clicking the button. Refer to the config: Aug 26, 2020 · Having the same issue in Apollo Client 3. refetch, its hard to work with it, but still apollo project is a nice project. Generally: The useQuery hook will never get data for the wrong variables from the cache. May 4, 2022 · Saved searches Use saved searches to filter your results more quickly Jan 21, 2022 · Saved searches Use saved searches to filter your results more quickly Aug 17, 2020 · Intended outcome: useQuery skip should continue working after being toggled. Your schema should be written in Schema Definition Language. After upgrading @apollo/client to the v3 range, my (local) server was being spammed by requests. I have configured a brand new app with the following dependencies: { "name": Jan 25, 2022 · apollo-client 3. Its easy, maintained since years and years, and extremely well documented. Setting ssr: false fixes the issue, but there is no warning or anything in the console on the server and it doesn't hang on client-side routing, just on full page loads of a page that uses useLazyQuery which took a few days to figure out. 13 Using fetchPolicy: 'network-only' and notifyOnNetworkStatusChange: true , calling fetchMore will trigger an unwanted additionnal network fetch which will mess up with the type policy merge . Any query executed with Apollo client works well in the web, but on mobile devices (both real device and emulator) is stu Regardless, you'll want to make sure you're using @apollo/client in both places. 6 The text was updated successfully, but these errors were encountered: 👍 4 rossmartin, GabrielNastase, jmacpherson, and yobananaboy15 reacted with thumbs up emoji ️ 3 brainkim, xbaun, and genintho reacted with heart emoji Issue Description I am having issues grabbing data from my endpoint when I use apollo/client inside an expo application. Glad to hear that you're looking into this @alessbell!. It sounds like you're referring to the default of 500ms here, since I see you're not passing an initial pollInterval via your useQuery options. Aug 2, 2023 · @phryneas I could narrow it a little bit down: It seems that in my case the problem appears when combined with polling. Jun 3, 2020 · Intended outcome: I'm using react-native and I have a Flatlist that gets it's data from a useQuery hook. You can specify a different fetch policy for a given Apr 21, 2023 · Notice how much less code you have to use to get this to work, simply because useQuery is reactive to its inputs. Log loading. Contribute to vuejs/apollo development by creating an account on GitHub. This becomes a huge issue on pages where we do infinite scroll pagination and end up wi Saved searches Use saved searches to filter your results more quickly Aug 16, 2023 · And what is the strangest thing is that to use useQuery for goals for which it wasn't created. My context: Using "@apollo/react-hooks" So in my case, I'm using useMutation() to add a new object, even after I add this new object into the underlying cache using the update() callback, a list component doesn't re-render showing the new object in the list, which uses useQuery() pulling from the same list in cache. Nov 4, 2020 · This is a question that appears to have been repeatedly asked, but due to archiving repos and package evolution there is no documented answer. And that now plays a role because of 4a0e8dd - which happened between those two betas that you told us about. StrictMode works fine. 0 it works correctly. ; The resolver will go to the network and resolve with { organization: null }. js (there is my root) with provideApolloClient(defaultClient) works for me. Not being able to reliably subscribe/listen for (refetches/polling) responses via onCompleted without also setting notifyOnNetworkStatusChange: true has lead to our codebase having to wrap the returned query. Sign up for free to subscribe to this conversation on GitHub. I am using a TypePolicy to get the results from the cache, not sure if that is important to this issue. Nov 30, 2023 · Issue Description I found a bug that can cause useQuery to return partial data if one query fails, a second overlapping query then succeeds, and notifyOnNetworkStatusChange is enabled. This could be considered a breaking change, but it's also a regression from Apollo Client 2. fetchPolicy after the intial network request, without calling observableQuery. Actual outcome: Fetches nonstop (looped) Loading always true. Aug 10, 2020 · When I use useQuery with fetchPolicy: 'cache-and-network' for loading data from the server it is doing infinity loop like this: If I remove fetchPolicy: 'cache-and-network' it works correctly. Saved searches Use saved searches to filter your results more quickly Mar 1, 2021 · Using Apollo Client and useQuery hook I found issue when we try to get data witch loading more the 10 seconds useQuery returns nothing but seems websoket client returns data. This cache-first policy is Apollo Client's default fetch policy. - appmotion/apollo-augmented-hooks Jun 8, 2021 · Intended outcome: Fetch once. 1. * * To run a query within a React component, call `useQuery` and pass it a GraphQL query document. Given the nature of useQuery, I expect it should trigger immediately when variables change. I want to call the fetchMore function when the user reaches the end of the list, to grab the next page of data, and append it to the However, my issue was caused because I'm using apollo-client on the server, to query my Hasura db. Jun 19, 2020 · I'm experiencing a similar issue with 3. Since you're assigning the ref in render before useQuery is executed, the next render will see the updated value and trigger the fetch again. Also, I'm setting cache-and-network as the default fetch policy for all queries. If all data is available locally, useQuery returns that data and doesn't query your GraphQL server. They have their federation to evolve. Jan 21, 2022 · By default, the useQuery hook checks the Apollo Client cache to see if all the data you requested is already available locally. Jun 29, 2020 · Since you're using hooks provided by react-apollo, you should probably use the official apollo cli tool to generate types as well - https://github. Actually v 3. 5 seconds is just too fast. 43" and still some additional rerenders happend. Intended outcome: After moving my app from the pages layout to the new app directory, I should be able to make simple queries to my GraphQL endpoint using apollo-client and graphql-codegen Actual outcome: With the new NextJS 13 server re May 7, 2020 · Use useQuery from @apollo/client@^3. 6 and above have the unintended outcome. We have workarounds but it is important for us that Apollo Client is reliable. Data should not be undefined. Mar 10, 2020 · Saved searches Use saved searches to filter your results more quickly A drop in replacement for apollo client's `useQuery` hook with a return type that mimics Elm's RemoteData ADT - agmoss/use-query-rd Drop-in replacements for @apollo/client's useQuery, useMutation and useSubscription hooks with reduced overhead and additional functionality. Actual outcome: Fragment merges can result in the cache dropping fields, which ends up returning an empty value from useQuery when returnPartialData is off, and misses fields when returnPartialData is on. 2 as @cc-dev-leader suggested seems to be an okay work-around so far. Jul 23, 2020 · The new options. Hey @kjhuang-db 👋. Useful for setting headers from props or sending information to the request function of Apollo Boost. 6. I have tried both adding: function makeClient() { const httpLink = new Http Jan 2, 2020 · Intended outcome: I am using refetch from useQuery hook in order to retry if something fails or timeout (remote graphql taking too long). The core Apollo Client API itself is not opinionated about how to handle Websockets connections, so I recommend looking at the aws-appsync-subscription-link docs for guidance on how to handle disconnect events in your applications. But providing the Client in the main. This is via the fetchPolicy that is 'cache-first'. For these goals useQuery can be rewritten by useLazyQuery. - mindnektar/apollo-augmented-hooks Feb 1, 2022 · But apollo will hit the cache first if you are requesting the same query with the same variables. Intended outcome: useQuery hook should return data if query lo Mar 4, 2017 · Saved searches Use saved searches to filter your results more quickly Feb 19, 2021 · Expected result: The query consults the type policy, and returns undefined. Use Apollo Client as React hooks. During that switch all useQuery and useLazyQuery retrigger even if all variables/options remain the same. I fetch list of items that I render on a screen using GET_ITEMS query (first and last argumen Feb 10, 2023 · => if the Apollo client is created at the same time as the first render runs, we see a double-fetch. If I clicked on button,which open confirm window,then I call useLazyQuery function called load({variables: Jul 1, 2022 · Intended outcome: I would expect Data and Loading to reflect the completed nature of the query Actual outcome: Immediately following onCompleted Data is still null and Loading is still true, I am guessing it has to do with async state up Jan 30, 2022 · Saved searches Use saved searches to filter your results more quickly Apologies if this has been addressed, I feel like i've look high and low. What is does, though, is that while your component is mounted, when you change variables, it holds on to the last data it had until it receives new data for the new variab Aug 26, 2020 · Having the same issue in Apollo Client 3. We will promote v3. I don't believe that will work since useQuery does a deep equality check to compare context values between render. It seems that when calling useQuery while passing through a client the query always returns loading true and reruns infinitely. 6, and the problem remains, maybe I did not understand the documentation, or something broken after upgrade to React 17? All reactions May 6, 2021 · Intended outcome: I have a query which might cause the server to return a 401 status, with additional GraphQL errors in the body. Oct 20, 2020 · In your root instance, you need to provide a default Apollo Client instance v4. useLazyQuery requires you to interact with its execute function in order to work, so you need some additional code to ensure the fetch kicks off. Jan 24, 2023 · The only source code in Apollo Client that uses ssrForceFetchDelay is in the snippets I posted above. ts within apollo-client. 0). djyfqbe qnhh rydgejx bmnghkwq mayn osuej bzvd skpwaf sbvcw piep