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

Entire `graphql` package included when using @vue/apollo-util's `logErrorMessages` #994

Closed
rebolyte opened this issue Jun 3, 2020 · 0 comments

Comments

@rebolyte
Copy link

@rebolyte rebolyte commented Jun 3, 2020

I was trying to figure out why my Webpack bundle included the graphql package, since I didn't think I depended on it anywhere. After digging through my Webpack stats in their analyzer, I discovered the culprit was using logErrorMessages from @vue/apollo-util:

2020-06-03 15_05_34-module  _ _node_modules_graphql_index mjs

To Reproduce
Steps to reproduce the behavior:

  1. Import logErrorMessages anywhere in your app: import { logErrorMessages } from '@vue/apollo-util'
  2. Build your app.
  3. Use webpack-bundle-analyzer or similar to see graphql.js adding ~175KB to your bundle size.

Expected behavior
The util package would not depend on graphql.js for printing error messages, and not bloat bundle sizes.

For now, I'm just using console.error.

Versions
vue: 2.6.11
@vue/apollo-composable: 4.0.0-alpha.6
@vue/apollo-util: 4.0.0-alpha.6

@Akryum Akryum added the v4 label Oct 15, 2020
Akryum added a commit that referenced this issue Oct 15, 2020
@Akryum Akryum closed this Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.