Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript error when ignoring errors #8896

Open
alexpuertasr opened this issue Oct 5, 2021 · 3 comments
Open

Typescript error when ignoring errors #8896

alexpuertasr opened this issue Oct 5, 2021 · 3 comments

Comments

@alexpuertasr
Copy link

Intended outcome:
Following the documentation I want to ignore the errors and handle the issue with any typescript issue:
https://www.apollographql.com/docs/react/data/error-handling/#ignoring-errors

Actual outcome:
The code is working well but I have a typescript error:
Type 'null' is not assignable to type 'readonly GraphQLError[] | undefined'.

How to reproduce the issue:
Ignore the error like it's documented here using typescript:
https://www.apollographql.com/docs/react/data/error-handling/#ignoring-errors

Versions
System:
OS: macOS 11.5.2
Binaries:
Node: 14.16.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.11 - /usr/local/bin/npm
Browsers:
Chrome: 94.0.4606.61
Firefox: 86.0.1
Safari: 14.1.2
npmPackages:
@apollo/client: 3.4.15 => 3.4.15

@brainkim
Copy link
Contributor

brainkim commented Oct 5, 2021

This might have been fixed by #8424, which was shipped in 3.5, which is currently in an RC phase. Can you try installing @apollo/client@beta? If not, I’m happy to help here!

@brainkim brainkim added ⛑ TypeScript 🏓 awaiting-contributor-response requires input from a contributor labels Oct 5, 2021
@brainkim brainkim self-assigned this Oct 5, 2021
@alexpuertasr
Copy link
Author

Hi @brainkim, I tried the latest beta (@apollo/client: 3.5.0-rc.1) but it's still happening. I prepared a codesandbox so you can see this by your own:

https://codesandbox.io/s/typescript-error-gtmnm?file=/src/apolloClient.ts

@schw4rzlicht
Copy link

I am stumbling across the same issue. I am on @apollo/[email protected]. Any news on this?

@hwillson hwillson added the 🔍 investigate Investigate further label May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants