apollo-client Questions

4

Solved

The dev tools version is 4, same situation in Chrome as in Firefox. "@apollo/client": "^3.5.7", const createApolloClient = (authToken) => { return new ApolloClient({ link: ...
Selfheal asked 27/2, 2022 at 17:34

2

Intended outcome: We did a pagination implementation, following the apollo docs (https://www.apollographql.com/docs/react/pagination/offset-based/). Using a read/merge function We expect that the r...
Kleon asked 16/4, 2021 at 14:2

5

Here is how I am using MockedProvider. How can I mock refetch in mocks array? const mocks = [{ request: { query: GET_USERS_BY_FACILITY, variables: { facility: 300 } }, result: { data: { G...
Acicula asked 21/11, 2019 at 18:13

5

I'm using GraphQL to communicate between two domains client and server. I have enabled CORS on my API website following the vercel documentation, but it seems to throw a blocked by CORS policy: Res...
Postconsonantal asked 22/5, 2021 at 3:42

5

Solved

This must be user error, but I've got an app with a simple currentUser query that looks at a JWT for an id, looks it up, and returns the appropriate user. I can look at devtools and see that it's i...
Xanthic asked 18/3, 2021 at 17:20

2

Solved

I had an issue where the loading property was not true when performing a refetch. I read somewhere notifyOnNetworkStatusChange to true would fix this. However we've notice after using this property...
Dunghill asked 5/3, 2021 at 22:0

3

Solved

I'm trying to create server with ApolloClient and GraphQL but got the following error: SyntaxError: Named export 'ApolloClient' not found. The requested module '@apollo/client' is a CommonJS modul...
Feoff asked 8/3, 2022 at 19:2

2

Solved

I'm having some trouble figuring out token refreshes when using apollo-client and firebase's auth service. I've setup token refresh using apollo client before. Typically I use the apollo-link-erro...

3

const { ApolloServer, gql } = require('apollo-server-express') const express = require("express"); const next = require("next"); const dev = process.env.NODE_ENV === "development"; cons...
Hemostat asked 28/12, 2018 at 6:25

2

Solved

I'm building an app with micro-frontends using webpack 5's module federation plugin. Everything was fine until I started adding react hooks into my remote app. At that point I received errors about...

3

this my code const NewVerificationCode = () => { const { loading, error, data = {}, refetch } = useQuery(CONFIRMATION_CODE, { skip: true, onError: (err) => {}, }); console.log(loading, e...
Idiocy asked 15/8, 2020 at 7:18

4

Solved

Having a weird issue passing variables into the useQuery hook. The query: const GET_USER_BY_ID= gql` query($id: ID!) { getUser(id: $id) { id fullName role } } `; Calling the query: cons...
Chisholm asked 12/2, 2020 at 22:30

3

My Setup Typescript React App Backend GraphQL API Apollo Client Inspecting with Apollo Client Devtools Extension My question What are active queries? The Apollo Docs talks about active queries a...
Tavarez asked 16/4, 2021 at 12:4

4

I'm using Pothos to build a graphql schema and graphql-codegen to generate types based on this schema. The server runs via graphql-yoga and nextjs and the actual query works fine when run via the g...
Swartz asked 12/4, 2023 at 21:49

2

I have a React-Native app where I make requests to a GraphQL server. Everything works fine except I need a way to set the timeout on the request/client to 5 or 10 seconds. Currently the request tak...
Finespun asked 9/11, 2017 at 9:38

2

Solved

I tried changing the addTypeName: false in the Apollo client in GraphQL apollo.create({ link: httpLinkWithErrorHandling, cache: new InMemoryCache({ addTypename: false }), defaultOptions: { wat...
Piracy asked 20/3, 2019 at 11:36

5

Solved

Apollo link offers an error handler onError Issue: Currently, we wish to refresh oauth tokens when they expires during an apollo call and we are unable to execute an async fetch request inside the...
Clerical asked 21/6, 2018 at 9:41

2

UPDATE: Tried upgrading to React 18 and RTL 13 but that did not fix the issue. React 16.4.0 react-scripts 5.0.1 Apollo Client 3.5.9 React Testing Library 12.1.2 I’m having chronic issues with tes...

2

Solved

I'm currently using ApolloClient to connect to an AppSync GraphQL API. It all works perfectly for queries and mutations, but I'm having some trouble getting subscriptions to work. I've followed the...
Parshall asked 21/6, 2020 at 18:6

9

Solved

Hy I am working in a project with Apollo GraphQL method and its working fine. But now the client required for adding additional header with Apollo API's. But after adding the header the API's respo...
Vannavannatta asked 28/3, 2019 at 10:43

4

Solved

I have learned Apollo + GraphQL through Odyssey. Currently, I am building my own project using Next.js which required fetching data from 2 GraphQL endpoints. My problem: How can I fetch data from m...
Strage asked 19/10, 2021 at 10:17

6

I am writing a graphql server component on AWS Lambda (NOT using graphql-server). On the client side I'm using apollo-client. On the response of the lambda function I'm setting const response = {...
Cartan asked 16/2, 2018 at 0:44

2

I want to implement a way to switch over different links based on the context set in graphql query. What I did so far is something like this which is working fine but doesn't seem to be a nice solu...
Dalrymple asked 11/2, 2021 at 12:49

3

Solved

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 ...
Screak asked 24/10, 2017 at 22:49

3

Solved

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...
Dextrosinistral asked 6/3, 2017 at 17:10

© 2022 - 2024 — McMap. All rights reserved.