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

Cannot find module apollo-client/gql #327

Closed
rricard opened this issue Jun 28, 2016 · 16 comments
Closed

Cannot find module apollo-client/gql #327

rricard opened this issue Jun 28, 2016 · 16 comments

Comments

@rricard
Copy link
Contributor

rricard commented Jun 28, 2016

Like #186, apollo-client#0.3.21 seems to not have the right module resolution on gql.

Can you publish a corrected version please ?

Also this is related to #188.

Thanks to @pschupp01 for indentifying the bug.

@stubailo
Copy link
Contributor

You're right! I just realized the issue, will publish a fix in 10 minutes.

@helfer
Copy link
Contributor

helfer commented Jun 28, 2016

Isn't the fix that gql is now in its own repo and you have to do this?

import gql from 'graphql-tag';

@rricard
Copy link
Contributor Author

rricard commented Jun 28, 2016

That is not an acceptable fix because what you are suggesting is there has been a major API change and you just incremented a PATCH number (see semver http://semver.org/). To actually tell you what happened on our side is that we had a major breakage because npm considered it was ok to go to 0.3.21.

@rricard
Copy link
Contributor Author

rricard commented Jun 28, 2016

By the way, you should emit a deprecation warning when people are trying to import apollo-client/gql if you want to deprecate it. I could actually do a PR for that if you want.

@helfer
Copy link
Contributor

helfer commented Jun 28, 2016

@rricard I agree, the proper way to fix things now is probably to re-introduce it in 0.3.22, and then remove it for 0.4.0. But maybe @stubailo has something else in mind, like importing it in apollo-client and exporting it again from there.

@rricard
Copy link
Contributor Author

rricard commented Jun 28, 2016

I think that's better. React warns breaking changes mostly like this and it works really well!

@abhiaiyer91
Copy link
Contributor

@rricard send over that deprecation warning PR!! :)

@rricard
Copy link
Contributor Author

rricard commented Jun 28, 2016

@abhiaiyer91: when I'll have some time but if there is some stuff to revert back, I think it's better that the @apollostack's team takes care of it

@stubailo
Copy link
Contributor

This was an accidental change. I had no intention to break importing from apollo-client/gql in this version.

@rricard
Copy link
Contributor Author

rricard commented Jun 28, 2016

Okay, I'll just do a deprecation warning PR then!

@stubailo
Copy link
Contributor

@rricard yes please, it would go here: https://github.com/apollostack/apollo-client/blob/master/gql.js

Is there any way to avoid printing the warning in production?

@rricard
Copy link
Contributor Author

rricard commented Jun 28, 2016

mheh, I know that React and Redux remove warnings on prod but I don't think it's easy to do, they have a really different build system and I have to admin I'm not an expert with tsc

@stubailo
Copy link
Contributor

I think it's up to the user's build system. Perhaps if we just do if (process.env.NODE_ENV === 'production') that will be good enough.

@rricard
Copy link
Contributor Author

rricard commented Jun 28, 2016

I was leaning towards that by looking at redux. But it should be noted that redux uses webpack's DefinePlugin for UMD builds ...

@stubailo
Copy link
Contributor

I think those if statements are evaluated by the app using the package, at the minification step. Like, when you npm install react it comes with all of the debug stuff, I'm pretty sure it's up to your minifier to remove it.

@stubailo
Copy link
Contributor

Hey, I published a fix as version 0.3.24.

This kind of problem is exactly why we are moving it into a different package - I'd prefer not to have to deal with moving around folders when publishing the package, which is what we had to do to achieve the apollo-client/gql module.

So hopefully @rricard you can add the deprecation warning for 0.3.x, and in 0.4.x we will get rid of it in favor of the new graphql-tag package.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants