Posts
Members
Info
React re-render causing Apollo useQuery to be called twice
I have a simple React component that uses Apollo's useQuery to fetch data. The problem is, because the component is being re-rendered by Apollo, it is calling useQuery twice, which is then calling the Apollo resolver twice, which is then calling the associated function that…
0
2
does readquery brings in new cache?
I have this code update(cache, { data }) { const newLectureFromResponse = data?.insert_lectures_one; …
0
0
While testing Apollo with jest:
I am getting : TypeError: Cannot read property 'query' of undefined------------ const folderMocks = [ …
0
0
Problem updating reac-apollo dependecies to apollo 3
In my project which uses Apollo 2, I import react-apollo dependencies like this: import { Query, QueryProps, QueryResult } from "react-apollo" Now In Apollo 3, I can't found QueryProps in @apollo/client, I have seen in the documentation of apollo with typescript, that QueryProps…
0
0
Newbie looking for advise on how to create an Apollo GraphQL API
Hi everyone, I have just joined a new company and I am given a task as an assessment to use GraphQL along with React and till now I have only used REST I have no clue how GraphQL works and the books and tutorials I find seem to be so confusing since I am used to the REST way of…
0
5
optimisticResponse in useMutation
Has anyone else found that adding optimisticResponse to useMutation causes all queries with 'network-only' to be refetched? If I remove optimisticResponse, it doesn't happen.
0
1
useReactiveVar in sub components
How to deal with useReactiveVar and "Cannot update a component from inside the function body of a different component"
0
1
Deleted·23d# React Apollo
How should i use the Apollo client in my react project
Hey everyone. I use redux-toolkit for state management in my react project. I want to use the apollo client to make graphql requests, but i do not fully understand how to work together. or I might be thinking wrong. can they work together? how should i send my api requests in my…
0
1
React class component with reactive variables?
How can I use a reactive variable that triggers a re-render in a react class component?
0
2
useLazyQuery Executed Twice
I am working on one React project, and for one of the components I am calling useLazyQuery in useEffect hook with an empty dependencies array. When the query gets executed i am returning the child component and inside the child component i have one useMutation hook which i am…
0
0