-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
Apollo has a constructor which is not compatible with Dependency Injection. It should probably not be @Injectable(). #1376
Comments
This issue only shows up for me when |
Likewise |
Same issue for me... This error look like something that could be related to (https://next.angular.io/guide/ivy-compatibility)
May this library could help to validate apollo ?!: https://github.com/angular/ngcc-validation |
Anyone working on this?
Looking to see what changed with constructor to make it so that it thinks this shouldn't be an injectable
At this point stuck: |
It’s taking time. We need to fix that |
This problem goes away if you switch to Angular 9 RC releases, e.g. |
There's no stable Angular 9 yet so you guys please give me time to solve it. I started creating As @Vilsol pointed out. It's no longer an issue in It's an open-source project and I'm the only one developing it (Apollo Team haven't pushed a single line of code). If you want to help, please provide reproductions or even pull requests, this speeds up things a lot. |
There is some way to help you with this fix? Can you give me some pointers around this? |
@joacorandom You could create a repository with basic reproduction |
@kamilkisiela I want to personally thank you for all your work. This project is awesome. I really do appreciate you taking the time to look into this. Thank you. |
I am only having this issue when running unit tests. is there any solution for this already? |
According to #1466 (comment), #1466 (comment) and #1376 (comment). It seems it's been resolved and this issue should be closed. |
Seems like the issue hasn't been fixed yet. I'm still facing it with Angular 12 |
@kamilkisiela could you please reopen this one? |
Maybe it is due to a missing |
@WolfSoko No, as I've found out, this issue is caused by a bug in @Nielsb85 @CharlieGreenman @Napas could you please confirm if you were experiencing this issue when using jest with angular? |
Yes. I was using jest with Angular
Op do 9 sep. 2021 12:50 schreef Maksym Kobieliev ***@***.***>:
… @WolfSoko <https://github.com/WolfSoko> No, as I've found out, this issue
is caused by a bug in jest-preset-angular, which is not able to properly
handle es6 namespace imports. And such imports are (in my case) generated
by graphql code generator. This is the issue:
thymikee/jest-preset-angular#963
<thymikee/jest-preset-angular#963>
@Nielsb85 <https://github.com/Nielsb85> @CharlieGreenman
<https://github.com/CharlieGreenman> @Napas <https://github.com/Napas>
could you please confirm if you were experiencing this issue when using
jest with angular?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1376 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABH6ZQKTX7577INAEZ6452TUBCGOZANCNFSM4JFRVNNQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@Maximaximum Good to know. I can confirm that I have the DI Problems when using jest and the generated queries from graphql code generator. |
I was following documentation from the https://www.apollographql.com/docs/angular/basics/setup/ trying to install Apollo Angular.
After running
ng add apollo-angular
and updating API endpoint in thegraphql.module.ts
, I'm gettingApollo has a constructor which is not compatible with Dependency Injection. It should probably not be @Injectable().
when trying to injectApollo
fromapollo-angular
in any component or service.Angular version:
8.2.11
Angular Apollo version:
1.8.0
How this could be resolved?
The text was updated successfully, but these errors were encountered: