Tag: apollo-client
-
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"…
-
Remove read-only fields before mutation in GraphQL
10 I’ve got a type called Article in my schema: type Article { id: ID! updated: DateTime headline: String subline: String } For updates to it, there’s a corresponding input type that is used by a updateArticle(id: ID!, article: ArticleInput!) mutation: input ArticleInput { headline: String subline: String } The mutation itself looks like this:…
-
GraphQL Code Generator with Apollo Client query with fragment type not detected
0 I have a simple Todo component that pulls all todos from my GraphQL endpoint. I am testing the fragment functionality using Apollo Client and GraphQL Code Generator to generate my types. Everything works, however the types for the fragment don’t (the data is there and displays correctly on the page). Below is the code…
-
Not able to Configure GraphQL with Angular. NodeJS 14
0 I have been trying to configure my angular project with graphql, angular-apollo but it’s not happening. My angular project is using NodeJS 14 Version error PS C:UsersadminDocumentsworkspacetechwarelab-websiteTechwareLab-Website> ng serve Compiling @nguniversal/express-engine/tokens : es2015 as esm2015 Compiling ngx-captcha : es2015 as esm2015 Compiling ngx-owl-carousel-o : es2015 as esm2015 Compiling @nguniversal/express-engine : es2015 as esm2015 chunk…
-
Error when installing apollo/client in react-native app
0 I am building a react native cli app and I want to use @apollo/client to reach the graphql server. But when running these commands npm install @apollo/client graphql I get the following error. npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/graphql npm…
-
GraphQL Client with ApolloBoost issues
0 I’m trying to run a React App using ApolloClient in node.js, and I receive the following error from Chrome Inspect: invariant.ts:12 Uncaught Invariant Violation: An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#%7B%22version%22%3A%223.8.2%22%2C%22message%22%3A47%2C%22args%22%3A%5B%5D%7D at new InvariantError (https://localhost:60422/static/js/0.chunk.js:76352:24) at invariant (https://localhost:60422/static/js/0.chunk.js:76363:11) at invariant (https://localhost:60422/static/js/0.chunk.js:9980:67) at useApolloClient (https://localhost:60422/static/js/0.chunk.js:7980:80) at useQuery (https://localhost:60422/static/js/0.chunk.js:8412:103) at…
-
How can I add a variable to all requests in apollo client?
1 I need a middleware so I can pass a variable in all my requests. This is what I have, but isn’t working. const httpLink = new HttpLink({ uri: process.env.REACT_APP_BASE_URL_API }); const addVariableMiddleware = new ApolloLink((operation, forward) => { operation.variables.newVariable = "nuevavariable"; return forward(operation); }); const client = new ApolloClient({ cache: new InMemoryCache(), link: from([addVariableMiddleware,…
-
Material-UI TextField select still only shows the old values
0 I have the following code, the values and change when another Dialog is completed and it will trigger useEffect to refetch data from the server but the Material-UI TextField select still only shows the old values (new value is not being shown). import { Button, Dialog, DialogActions, DialogContent, DialogTitle, MenuItem, } from ‘@mui/material’; import…
-
Vue Apollo Composable useQuery Ignores Reactive Filter Variable Change Even Though It Triggers a Refetch
0 I am using Vue Apollo Composable with useQuery to perform a GraphQL query. My pagination works as expected; however, I am facing an issue with my filters.verified variable. Although I see the variable toggling in the client-side (I’m logging it), the network request still shows the initial value as true. Problem: When I click…