Host: localhost. is not in the cert's altnames

I'm getting the below error while doing server-side rendering. RENDERING ERROR: { [Error: Network error: request to https://api-dev.xyz.io/graphql failed, reason: Hostname/IP doesn't match...

Remove unnecessary fields before mutation in GraphQL

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...

React Native Apollo error: "Network error: Network request failed"

On IOS, the application runs correctly. But on Android I get this error. Here's my config in client and server. Please help! Error: Error image Here's the config on client: import ApolloClient, {...

Updating authorization header in websocket graphql

I am trying to implement authentication in Graphql using firebase and websockets (on react native). The client uses the firebase to authenticate and gets a token. It then sends the token to the...

How to send a file to response a graphql query? (send a csv file from server to client)

I wanna send a csv file in repose of graphql query. I am using Apollo server and Apollo client and Reactjs. (send a csv file from server to client) can anybody give me an idea how can I implement it?

When to use watchQuery or query in Apollo-Angular?

I am using a watchQuery or query in Apollo-Angular (graphql) How is the logic and difference of the watchQuery and query

Apollo Angular not sending request

I have a simple query (Apollo-Angular Client) to fetch some data from an GraphQL server public getQuestionBank(courseCode: string): Observable<ApolloQueryResult<{}>> { const query = gql` ...

Send graphQL mutation based on DynamoDb stream with NodeJS

I'm trying to update a GraphQL subscription when a DynamoDb table receives a new row. I got the following code working with only the RekognitionId, but I'm not trying to send the entire NewImage...

How to remove the `__typename` field from the graphql response which fails the mutations

I tried changing the addTypeName: false in the Apollo client in GraphQL apollo.create({ link: httpLinkWithErrorHandling, cache: new InMemoryCache({ addTypename: false }), defaultOptions: { ...

CORS issue with using localhost:3000 to access graphql API at a different URL

I have searched all over StackOverflow and saw similar questions but have not found a working solution. Wondering if anyone has a working solution? I am developing a create react app on...

Apollo codegen:generate gives error "Generating query files with 'typescript' target"

I have backend on Express with Apollo Graph. In my client React app im do next: apollo codegen:generate --excludes=node_modules/* --includes=**/*.tsx --target typescript --tagName gql --outputFlat...

How to refresh JWT token using Apollo and GraphQL

So we're creating a React-Native app using Apollo and GraphQL. I'm using JWT based authentication(when user logs in both an *activeToken* and *refreshToken* is created), and want to implement a...

Testing useSubscription apollo hooks with react

Testing the useSubscription hook I'm finding a bit difficult, since the method is omitted/not documented on the Apollo docs (at time of writing). Presumably, it should be mocked using the...

Apollo Client Async Refresh Token

I have been struggling to asynchronously refresh the token in Apollo client, when an Unauthenticated error occurs. I've reviewed several resources on this, like StackOverflow answers, this Github...

How to get all cache data using reactjs @apollo/client v3

Is there anyway that I can check all the cache, eg: changes within apollo for debugging. Something like redux store, where you can view the whole state tree. They mentioned: The cache stores the...

'Unauthorized' error when using AWS amplify with grahql to create a new user

So I think this issue comes from me not quite understanding the relationship between AWS cognito user pools and the auth rules in a graphql schema. When I run the code below, I get the message...

error - ./node_modules/busboy/lib/main.js:1:0 Module not found: Can't resolve 'fs'

When I add a new React component to my NextJS app (React, TypeScript and GraphQL), my local development environment suddenly breaks with this cryptic error: wait - compiling... error -...

NextAuth.js signout if Apollo GraphQL token is invalid or it has expired

What would it be the best way to clear the NextAuth.js session when trying to hit the backend (Apollo GraphQL) and it returns a 401 because the token has expired or is invalid? I thought about an...

Can't use await in update method of apollo mutation

I'm trying to update cache to trigger rerender of UI but it seems that the update method on apollo mutations does not work correctly if you use async/await mutation({ variables: { ... }, ...

What is the difference between SchemaLink and HttpLink for ApolloClient?

For ApolloClient we can use either SchemaLink or HttpLink. Is there any advantage for using one or other? // SchemaLink function createLink() { const { SchemaLink } =...

Why apollo client network request cancelled twice?

My apollo/client - useQuery is loading twice which is normal based on normal flow but when I have my network tab on devtools open and noticed weird stuff. I have 2 cancelled request I don't know...

Apollo client / React native error using localhost

I have a react native app that works with Apollo client(grapqhl), the problem is that I have a production API and Apollo client works without any problem but if I change the uri in apollo...

Unhandled Rejection (Error): Response not successful: Received status code 400 new ApolloError

I'm kind new to Apollo Client. Let's talk less and show the code. I have a server that is running and I'm trying to make a mutation using react. mutation in the server.js const RootMutationType =...

Integrating apollo-angular V2 with Angular V8

I am trying to integrate apollo-angular into my Angular project which uses Angular V8 but getting the following errors: The apollo-angular versions im using are the following ones:...

Ensure that there is only one instance of "graphql" in the node_modules directory

While trying to download the schema using npm run schema:download I am receiving the following error. [email protected] schema:download npx apollo service:download...

Express-session does not set cookie?

I'm following along with Ben Awad's 13-hour Fullstack React GraphQL TypeScript Tutorial and encountered a wall during the login cookie setting (aprx at 1:50:00). I think I successfully connected...

AWS AppSync + Apollo Client ends up with a broken subscription websocket

I'm having a problem with AppSync subscription. Together with my team we have created an app (TypeScript) and we are leveraging features of GraphQL via AWS AppSync. The problem we are having is...

Main module field cannot be resolved after installing @apollo/client

I'm running into an error after installing Apollo when trying to run my React Native Expo app. I've tried deleting node-modules and re-installing, resetting cache, restarting computer, and still...

VSCode prettier adds `value` to imports in TypeScript React

After configuring prettier with the plugin in VSCode the format on save function adds weird value keywords to every non-default import in my React+TS code. Like this: import { value ApolloProvider...

Uncaught Invariant Violation: client.watchQuery cannot be called with fetchPolicy set to "standby"

I just clone my project on Ubuntu machine and did yarn install and then yarn start and this giving me above error. However on my Windows machine it is working fine. I'm using "apollo-client":...