Skip to content

Error when upgrading to Apollo 3. #5

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

Open
Eraldo opened this issue Aug 26, 2020 · 14 comments
Open

Error when upgrading to Apollo 3. #5

Eraldo opened this issue Aug 26, 2020 · 14 comments

Comments

@Eraldo
Copy link

Eraldo commented Aug 26, 2020

ERROR in src/app/core/graphql/graphql.module.ts:49:28 - error TS2322: Type 'ApolloNetworkStatus' is not assignable to type 'ApolloLink | RequestHandler'.
  Property 'setOnError' is missing in type 'ApolloNetworkStatus' but required in type 'ApolloLink'.

49     link: ApolloLink.from([networkStatus, link]),
                              ~~~~~~~~~~~~~

  node_modules/@apollo/client/link/core/ApolloLink.d.ts:15:5
    15     setOnError(fn: (reason: any) => any): this;
           ~~~~~~~~~~
    'setOnError' is declared here.
ERROR in src/app/core/graphql/graphql.module.ts:49:28 - error TS2322: Type 'ApolloNetworkStatus' is not assignable to type 'ApolloLink | RequestHandler'.
  Property 'setOnError' is missing in type 'ApolloNetworkStatus' but required in type 'ApolloLink'.

49     link: ApolloLink.from([networkStatus, link]),
                              ~~~~~~~~~~~~~

  node_modules/@apollo/client/link/core/ApolloLink.d.ts:15:5
    15     setOnError(fn: (reason: any) => any): this;
           ~~~~~~~~~~
    'setOnError' is declared here.

Versions:

  • "apollo-angular": "^2.0.3",
  • "apollo-angular-link-network-status": "^1.0.4",
@kamilkisiela
Copy link
Owner

It doesn't support @apollo/client, a simple PR that replaces apollo-link with @apollo/client/core should be the only migration needed. I will happily accept and merge it.

@Eraldo
Copy link
Author

Eraldo commented Sep 10, 2020

Update: As soon as PR #6 will be merged and released, this issue will hopefully be done. :)

@Eraldo
Copy link
Author

Eraldo commented Sep 16, 2020

Tried it again today.
Getting this error message:

TS2322: Type 'ApolloNetworkStatus' is not assignable to type 'ApolloLink | RequestHandler'.   Type 'ApolloNetworkStatus' is missing the following properties from type 'ApolloLink': split, concat, setOnError

@Eraldo
Copy link
Author

Eraldo commented Sep 16, 2020

index.d.ts contains this line: import { ApolloLink, Operation, FetchResult, Observable as LinkObservable } from 'apollo-link';
Seems like this is still an old import, right @kamilkisiela ?

Using latest: "apollo-angular-link-network-status": "^1.0.4",

@Eraldo
Copy link
Author

Eraldo commented Sep 16, 2020

I just realised that 1.0.4 is the same version where the issue originally occurred. ^^
So I guess you just did not find the time to do the new release yet, is that the case?
kamilkisiela/apollo-angular#1555 (comment)

@Eraldo
Copy link
Author

Eraldo commented Sep 16, 2020

I forked and tried if I can get it to run with your changes @kamilkisiela.
(To see if the release is the only step missing.)
Seems like the signature of onError also changed => onError(reason: any): void;.

@Eraldo
Copy link
Author

Eraldo commented Oct 29, 2020

@kamilkisiela Any hope of this moving forward? :)

@Eraldo
Copy link
Author

Eraldo commented Nov 29, 2020

@kamilkisiela Ping. :)
(Heartbeat in the hope to keep the issue alive.)

@Eraldo
Copy link
Author

Eraldo commented Jan 1, 2021

Any updates @kamilkisiela ?

@Eraldo
Copy link
Author

Eraldo commented Jul 12, 2021

Any updates?

@Eraldo
Copy link
Author

Eraldo commented May 21, 2022

Any hopes/outlook of things moving forward?

@Eraldo
Copy link
Author

Eraldo commented Mar 4, 2023

@kamilkisiela any update? 🙏
Other ways of how I can do the same thing without that package maybe?

@Eraldo
Copy link
Author

Eraldo commented Jul 2, 2023

Shall I give up hope? 😅

@Eraldo
Copy link
Author

Eraldo commented Jun 6, 2024

@kamilkisiela ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants