Tag: react-hooks
-
Codegen and Graphql-Request Error: Server Error TypeError: Cannot read properties of null (reading ‘useState’)
0 This is the Error image im getting when I start my frontend Server Error TypeError: Cannot read properties of null (reading ‘useState’) This error happened while generating the page. Any console logs will be displayed in the terminal window. I am building a Full stack App using NextJs,GraphQL and codegen. When i run the…
-
Why state not updating from useMutation?
0 I’m trying to update state(useState) from useMutation(Apollo Client) callbacks, but it is not updating the state. Setting it inside "error" callback. Getting error in console: Warning: Can’t perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions…
-
why polling of Apollo useQuery don’t call onCompleted?
1 I am playing around the code: https://codesandbox.io/s/restless-framework-uldf4q?file=/src/App.js import React, { Fragment } from "react"; import { gql } from "apollo-boost"; import { useQuery } from "@apollo/react-hooks"; const GET_DOG_PHOTO = gql` query Dog($breed: String!) { dog(breed: $breed) { id displayImage } } `; const breed = "dingo"; const App = () => { const [count,…
-
Wrap usePreloadedQuery in a custom hook
1 I’m new to working with react-relay and graphql. I’ve taken the initiative to create the custom hook below and I’m wondering if this is the correct way to do it or if it goes against the recommended practices in Relay. From the usePreloadQuery documentation I do notice that we use it on a deeper…
-
DOMException: signal is aborted without reason in useEffect with async call
5 I have a project using React in Strict Mode alongside GraphQL. I updated some packages, and I now get the following error in useEffect containing async calls. useEffect(() => { const loadTags = async () => { const { data } = await fetchTags(); setTags([…(data?.tags || [])]); }; loadTags(); }, [current, fetchTags]); DOMException: signal…
-
React function executing multiple times (4 times)
0 My function is executed 4 times ? (I am using GrahQL, Appolo-Client, React) One of the issues is that my query returns set of images, which are hosted on S3 and page keeps refreshing with new urls. import React, { useState } from "react" import { useQuery } from "@apollo/client" import styled from "styled-components"…
-
Why isn’t my react app mapping my graphQL query?
0 I am working on a component to map all posts from a graphQL query on the client side using semantic UI. I am running it locally and the webpage is not showing any of the data even though this query works in apollo studio. Here’s the code for the component. import React from ‘react’;…