Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
0 replies
34 views

I’m trying to find an effective way to introduce newly created “second class” objects into the InMemoryCache. By “second class”, I mean objects that depend on a parent object. When I’m creating these ...
gboysko's user avatar
  • 31
0 votes
0 answers
63 views

My React Native app (v0.79.5) with Apollo Client works perfectly when testing locally with release APK, but when uploaded to Google Play Console and downloaded from the Play Store, I get consistent ...
Yash Nayi's user avatar
  • 147
-1 votes
1 answer
163 views

I have a problem with migrating from Apollo client v3 to v4 and i get this error Warning: Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite ...
Ahmed Elselly's user avatar
1 vote
0 answers
154 views

I'm building a React app with Apollo Client and a Node.js backend (Apollo Server). My Apollo Client setup looks like this: const httpLink = createHttpLink({ uri: "http://localhost:4000", ...
Shashikant Redekar's user avatar
1 vote
1 answer
364 views

I’m using Apollo Client v4 (4.0.5) with Next.js App Router and GraphQL Code Generator (typescript-react-apollo) to generate TypeScript types and hooks for my GraphQL API. Everything was working fine ...
kslmn's user avatar
  • 11
0 votes
0 answers
57 views

I am working with a NextJS project that needs to access a graphql API. I am using the nextjs app router and am trying to follow the best practices outlined here https://github.com/apollographql/apollo-...
Ty Nielson's user avatar
0 votes
1 answer
106 views

I’m using graphql-codegen with apollo-client. Everything works great except one thing: I tried to update cache after mutation, the update function of client.mutate doesn’t have typings for the cache ...
musketeerdt's user avatar
-1 votes
1 answer
132 views

Since sometime recently, possibly from upgrading to apollo 3.9.9 or from switching to mocking with graphql-codegen (not sure which if either), the console of my developer tools now fills up with ...
Pix81's user avatar
  • 715
2 votes
1 answer
274 views

I recently started using Apollo Fragments for the first time to synchronize parts of schemas between queries and mutations instead of manually keeping those schemas synchronized. However, now ...
mrbinky3000's user avatar
  • 4,391
0 votes
1 answer
81 views

Several of my Apollo Client query's variables are mutable depending on different user actions (search input, category filtering, pagination, etc.). I figured the best way to handle this was to use ...
Kristen Grote's user avatar
1 vote
1 answer
197 views

The following line works fine in the browser and in Bun: import { ApolloProvider } from "@apollo/client"; but when I run it in SSR (inside Tanstack Start / Vite / Vinxi) I get an error ...
Michael Lorton's user avatar
0 votes
2 answers
223 views

I am getting an unexpected behaviour. That is, I have put a skip condition in the query and even when the skip condition is supposed to be true, the query is being run. I have made a minimal ...
suyog's user avatar
  • 159
0 votes
0 answers
48 views

I have below code snippet: const [state, setState] = useState(null); {data, loading, error} = useQuery(SOME_QUERY, {fetchPolicy: 'no-cache'}); useEffect(() => { setState(data) }, [data]); This ...
Mrityu's user avatar
  • 508
1 vote
1 answer
133 views

How can I parse a stored JSON response in React and pass to a component that is expecting graphQL response? Is there a way to add the __typenames from the query RatingQuery? This is what I am trying, ...
Amit M's user avatar
  • 11
1 vote
2 answers
271 views

I want to get the cookie with my client component, but somehow, it always return undefined or empty string. I am using js-cookie since someone recommend it. ApolloProviderClient.tsx: "use client&...
Fikri Lazuardi's user avatar
0 votes
1 answer
39 views

Token API should get called before the GraphQL API but it's being called at the same time I am fetching the headers inside setContext Inside commonAuthHeaders I am calling the API to get refresh token ...
Nischal Singh's user avatar
1 vote
1 answer
88 views

First, I call useGetData with parameters that include filters for test1 and test2 (this is correct). The data is fetched and stored in the cache. Then, I disable the test2 filter and make a new ...
lukasmaska98's user avatar
1 vote
0 answers
16 views

I want to throw a custom exception from the my reactive spring-boot backend to the browser front end over graphql apollo. I want to front end browser to know about the specific information in this ...
Oliver Watkins's user avatar
0 votes
1 answer
143 views

I recently updated my Apollo Client version from 3.5.8 to 3.12.0, and now I'm encountering an error when using the useLazyQuery hook. The error states: observable.reobserveAsConcast is not a function ...
Avtar Nanrey's user avatar
1 vote
0 answers
55 views

I am trying to implement registered persisted query. when i am running a query which is not there in my PQL, with apq as enabled it is logging the query in router logs with error code “...
varun sharma's user avatar
0 votes
1 answer
97 views

I am trying to run the useLazyQuery in my vue to get data from Apollo client. I am passing the parameter and query return different results based on the parameter being passed. My issue is that result ...
Arun Kumar's user avatar
1 vote
2 answers
1k views

I'm trying to add apollo-angular to my Angular 19 project, but I'm getting the following output in the terminal: We couldn't find 'esnext.asynciterable' in the list of library files to be included in ...
mkelley33's user avatar
  • 5,669
0 votes
1 answer
288 views

I have a GraphQL query which looks like so query Person($cursor: ID, $limit: Int) { items:{ ... } name ... cursor } While making the query for the next page, I fetch using the returned ...
dumbPotato21's user avatar
  • 5,703
0 votes
3 answers
177 views

I can't see anything in the Apollo docs to suggest whether the Apollo client implements short or long polling - can someone please confirm(?)
JoeTidee's user avatar
  • 26.3k
0 votes
1 answer
58 views

I am using Query and resolver for fetching the articles data. In one request it fetches the 15 records. Fetching data limit is 15. After some request it lost the user Info/cookies an gives error ...
Priya Kumari's user avatar
0 votes
1 answer
185 views

I am using Next.js v14, graphql, ApolloClient and ApolloGraphQL Experimental support for NextJS { "@apollo/client": "^3.12.0-rc.3", "@apollo/experimental-nextjs-app-...
randomuser5767124's user avatar
1 vote
0 answers
68 views

I'm using the apollo-client-maven-plugin version 7.1.0, and I'm trying to flatten fragments in my response models, but I'm encountering an issue where the fragments are wrapped in a nested object. ...
Denis Cucchietti's user avatar
0 votes
1 answer
249 views

I have this weird issue in my react application. My graphQL request does not seem to be fetching the most recent data even when the graphQL server returns the data. I am not really sure what is going ...
oleksii pytts's user avatar
1 vote
1 answer
769 views

When we build nextJs yarn build when it goes to the step Generating static pages we have this error: Error occurred prerendering page "/partners/partner-with-us". Read more: https://nextjs....
Alan's user avatar
  • 10.3k
0 votes
1 answer
150 views

I have been using MockProvider from Apollo Client successfully in mocking normal GQL queries, but when I try to mock mutations it does not seem to work. If I try to mock a useMutation using the ...
Oliver Watkins's user avatar
3 votes
1 answer
1k views

I'm using Strapi as a headless CMS with the Draft & Publish feature enabled, and I'm querying the data using GraphQL in my project. The problem I'm facing is with filtering drafted and published ...
david's user avatar
  • 87
1 vote
0 answers
223 views

I'm encountering a 502 Bad Gateway error when switching between pages in my Next.js application that uses Apollo Client. Here’s a brief overview of my setup: import { ApolloClient, HttpLink, ...
Srys's user avatar
  • 11
0 votes
1 answer
515 views

I have the below component -LocationStats- running a suspense query. The query causes non stop re-renders. I can see it sends a query to the server, and the minute it gets a response, it launches the ...
kfc's user avatar
  • 323
0 votes
1 answer
50 views

We are in the process of migrating some calls from one server to another. I currently have an existing call that works with refetchQueries const refetchQueries = ['MyComponent', { query: MY_QUERY, ...
Baptiste Pernet's user avatar
0 votes
1 answer
50 views

I have a mutation that adds a todo to a list of todos. mutation AddTodo($data: AddTodoInput!) { addTodoToList(data: $data) { id todos{ ...
William Neely's user avatar
0 votes
1 answer
85 views

I am trying to use cache.modify to update a field after mutation. This is reactions field of my Message model. The mutation removes reaction from the reactions field. I am using optimistic response. ...
Georgy Nemtsov's user avatar
0 votes
1 answer
240 views

I have created a Rest API application in Typescript, using NestJS and querying a GraphQL server using Apollo Client. I currently have my queries hard-coded like this: const query = "query { ...
Matheus Maximo's user avatar
0 votes
1 answer
263 views

I’m looking for a way to run a query against a mock data object. The problem I currently mock the GQL response via . That works great, but the mock’s result comes back exactly as defined. The mock ...
Gabriel Faria's user avatar
1 vote
1 answer
44 views

I am trying to fetch menu items from WordPress through Apollo client, but my getStaticProps function never gets called. Here is what I currently have as my setup: Navbar.jsx src/components/Navbar ...
Steve Gaita's user avatar
0 votes
0 answers
251 views

I have a tree like structure in my backend described by the following GraphQL schema. Since dynamic recursion is not possible each node just contains the numerical id of it's parent but not the object ...
Moritz's user avatar
  • 72
0 votes
2 answers
215 views

I want to set auth in req header to specific value but after I tried different methods and check req from browser my key is not in the req header I am using Reactjs ,vite ,@apollo/client and running ...
mohamed nageh's user avatar
1 vote
1 answer
692 views

I have a React App setup in an npm workspace /apps /fe-app /common /common /common-fe common-fe depends on common fe-app depends on common-fe previously I used CRA with babel/webpack to ...
Radek Domański's user avatar
-1 votes
1 answer
106 views

I took over a Craft CMS project, which I successfully upgraded to the latest version of Craft 5. When I run the command needed to build the JS and CSS files npm run dev I get the following error: ...
cjhdev82's user avatar
0 votes
1 answer
142 views

I am getting datasource undefined on resolvers when trying to query getTracking. I have a FedexAPI class that extends RESTDataSource from "@apollo/datasource-rest" as a Data source. The ...
Anamol Acharya's user avatar
0 votes
1 answer
865 views

I’m currently working on a personal sports tracking project using React Native and GraphQL, and I’m wondering about the use of Apollo Client in combination with Zustand. Apollo Client handles data ...
Jeff's user avatar
  • 31
0 votes
1 answer
34 views

In my react native project I'm using graphql codegen to generate types and hooks. I'm using react native 0.74.5. But I don't know why I have an error, so that is why I can't launch my app. also here ...
rakhlinskyi's user avatar
0 votes
1 answer
521 views

I'm working on a Next.js server component to fetch events from a GraphQL server, but I'm encountering an issue where the cache seems to be used despite setting fetchPolicy: 'no-cache'. Here is my ...
James Nganga's user avatar
1 vote
1 answer
230 views

I want to have centralized client-only fields. Example: Server: type Name { first: String last: String } type User { name: Name } Client: extend type User { fullName: String! } import { ...
Anton S's user avatar
  • 59
1 vote
1 answer
28 views

I have given mutation query for adding book details. I have to accept 3 params dynamically. this is my bookQuery.js const ADD_BOOK = gql`{ mutation ($name: String!, $genre: String!, $authorId: ID!)...
Ashish Khokhariya's user avatar
0 votes
1 answer
357 views

I have this weird behavior that I've been wrapping my head around for the past couple of hours. Let's consider these two queries as examples: A query that returns and array of authors query Authors { ...
As above so below's user avatar

1
2 3 4 5
68