Closed roschlau closed 3 years ago
I experienced the same issue recently, but I have no idea how it can be solved on the library level.
The only way this library would be able to do anything about it is by renaming it's version of gql to something different so that the compiler doesn't suggest multiple choices. I'd say the real issue is with the @apollo library for not separating their code base into react and angular directories.
It's annoying but something that I think all apollo devs outside of react are forced to live with.
At the end of the day, I don't think this is the responsibility of this library.
There's nothing to do from our side. If someone will come up with an idea of how to prevent this, let's us know. For now, I close it.
In my Angular project, if I accidentally
import { gql } from '@apollo/client'
instead ofimport { gql } from 'apollo-angular'
, I get the following errors when compiling the project:It would be nice to at least have some way to pinpoint the error in this case - took me a good while of trial and error until I found the culprit. I've added an
import-blacklist
entry for the offending import in my tslint.json, but that only becomes an option once you know about the actual problem, and might not be an option for others at all.Environment:
@apollo/client
:3.0.0
apollo-angular
:^2.0.4
graphql
:^15.0.0
@angular/core
:~10.2.0
@angular/cli
:~10.2.0
typescript
:~4.0.2