Tag: #reactjs
-
Front End Development Lead – IT Minds LLC – Remote
IT Minds LLC Remote Depends on Experience Accepts corp to corp applications, Contract: Independent, W2, 12 Month(s) Skills Front End Development GraphQL Javascript Reactjs Nodejs Nestjs Nextjs Job Description Position: Development Lead Duration: Long Term Location: Remote Deliver Innovative technology solutions to complex problems with client-centric approach Improve current capabilities, process and resources Innovation in…
-
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…
-
How to efficiently paginate data in a React application using GraphQL and TypeScript?
0 I’m building a React application with TypeScript where I fetch data from a GraphQL server. I’ve been trying to implement pagination for my data, but I’m facing some challenges in ensuring that the data is fetched efficiently and the user experience remains smooth. Current Approach: I’m using Apollo Client for fetching data. Here’s a…
-
how to add product to shop cart via apollo and react
0 I try to use useMutation to add product to cart by button click, but after a lot of attempts it still don’t work and i can’t understand how to make it work. my code looks like that: product.jsx const [add, {error: addError}] = useMutation(ADD_CART, { update(cache, { data: { add } }) { cache.modify({…
-
How can I parse a custom scalar in Apollo Client?
0 How can I return a Decimal type from my backend GraphQL server and then parse it on my frontend client? I have a backend that returns a product with a price. The price is a custom scalar of Decimal type. The schema is like so: scalar Decimal type Product { id: ID! price: Decimal…
-
How to implement error handling globally for URQL GraphQL mutation?
0 My stack is: react v17.0.2 graphql v16.8.0 graphql-ws v5.14.0 urql v4.0.5 I use Hasura Actions to connect to REST API and I need to implement global error handling for all mutations. For example I have useAuthentication hook that returns a signOut promise: import { useMutation } from ‘urql’; export const useAuthentication = () =>…
-
Resolve two GraphQL schema fields using one endpoint
2 There’s a situation where there are two possible types to fill data property. I have made a union type for that (ComponentItem) to determine which field needs to be returned. The first schema (ComponentItem1) should just be a hardcoded list but the second one (ComponentItem2) is more dynamic where it gets a searchTerm from…
-
Triggering one query is triggering other related ones
0 I suppose its because of cache? But i have Query01 that i trigger using a button click, and Query02 that had run previously, when Query01 runs, it reruns query 02. What is going on?? Here’s the structures: query Query01( $patientId: Something! $externalId: String $externalEncounterId: String! ) { patient(patientId: $patientId) { pastMedicalHistory {} prescriptions {}…