I’ve implemented a RetryLink into my Apollo Client as follows: The goal is to use a custom header sent by the server to adjust the delay (the server is rate limited). However, the headers field in the response is always empty. The response itself is present and looks as follows: If I use another link the header is there as
Tag: apollo-client
How to provide type hints in JavaScript using JSDoc for Apollo Client based code?
I have trouble setting up type hints for my JavaScript code using JSDoc (trying to make this work with VSCode and WebStorm). As first step, I converted GraphQL schema into set of JSDoc @typedef entries using @graphql-codegen/cli. For the sake of this conversation, lets talk about this one: Then, somewhere in my App.js I tried writing: However, it looks like
Saving the state of the button onClick
I have: This pattern works fine, but whenever on the page more then 1 attribute and user select more then one, previously selected button gets unclicked. My question is: How can I save the state of 1st selected button after clicking on 2nd one? for each attribute only one button can be active buttons name should be used Answer You
Weird error in react – using apollo/client – graphql
I’m developing a MERNG App, and everything is working fine so far, but i’m getting some errors in the fronted with useMutations, let me explain to you. So, in the login/register part, if you leave fields empty or in the login, if your user is not found in the DB, it’ll give errors, and i receive those errors in the
Send data between components in ReactJs using Apollo Client
According to the documentation, GraphQl provides state management like Redux. I have 2 components. In the Component1 i get data from the server using AppoloClient, it works ok, and in the Component2 i want to read data from the cache(store). Issue: I can get data in component 1, but when I try to read data from component 2, I get
How to get and set a ref for a newly cached related object in Apollo client InMemoryCache?
I have a set of related items like so: which apollo caches as two separate cache objects, where the related_entity field on book is a ref to an EntityNode object. This is fine, the related entity data is also used elsewhere outside of the context of a book so having it separate works, and everything seems well and good and
Best practice for Next.js data fetching inside a component
I have a menu component that appears globally. What is the best practice for getting data into that component? I’m trying to take advantage of static generation that Next.js offers but all data fetching guidance from the Next.js team relates to pages. getStaticProps and getStaticPaths seem to pertain to page generation, not data for components. Is their SWR package the
Error: Network error: Error writing result to store for query (Apollo Client)
I am using Apollo Client to make an application to query my server using Graphql. I have a python server on which I execute my graphql queries which fetches data from the database and then returns it back to the client. I have created a custom NetworkInterface for the client that helps me to make make customized server request (by