Tag: apollo-client
-
Mock UseMutation in react testing library and jest used in custom hook
0 I have created a custom hook which is having several functions for processing the data and calling the functions. I am writing the test cases for few specific scenarios inside the hook. I will mention in the code below only functions specific to my case. This is my custom hook : useShippingInformation.js const useShippingInformation…
-
Adding an entity to apollo-client cache after mutation to match query variables
0 I’m currently building a SPA with apollo-graphql and everything is working fine so far. However, I have reached a point where the apollo cache causes some issues. I have a UI which provides several filter criteria. The fields are mapped to variables in my graphql query, specifically a project ID and a timespan (start/end…
-
Cannot read properties of undefined (reading ‘FIELD’) when bumping @apollo/client to 3.8.x
0 I have a particular feature where I require to implement a second graphql client (using @apollo/client) that uses the old ws protocol for subscriptions – the other graphql client uses the latest one. This is a code snippet of a codesandbox link import React, { useState } from "react"; import reactLogo from "./assets/react.svg"; import…
-
Catch apollo client errors when using errorLink
0 I’m using Apollo error link to handle graphQL errors. In most cases, I would only want to catch the error and show an alert, which is something I can easily to when defining onError, but in one of my views I’m running a mutation call and there I would like to catch the error…
-
GraphQL Client for C++ and .NET
7 Is there an GraphQL client library available for C++ (Windows and Linux) and .NET? From Apollo website I can only see clients for React, Vue.js, Angular, Android, iOS, Ember and Meteor. If there is an Apollo client for C++ and .NET, where is it located ? If not, what should be used ? graphql…
-
module.export = {} with Vite React
0 I created a react App with Vite, and I want to use Apollo extension to get Intellisense when building GraphQL queries. According to the extension docs, I created an apollo.config.js file at the root with this code : module.exports = { client: { service: { name: "my-graphql-app", url: "https://localhost:4000/graphql", }, }, }; But since…