-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Remove "source" field from emitted loc object #13
Comments
Near as I can tell, the source property is used to create unique cache keys during fragment processing. I think it's safe to eagerly normalize the value in this plugin, as it's mostly noisy whitespace in my experience. |
The source is taking bytes and computation for just generating a cache key. This can be optimized in compile time, for example, pre-generate a shorter hash instead of saving the full source.
The drawback is that it is then tied to the implementation of graphql-tag. But I would still like to have it as an option. Maybe the plugin can provide a post-process callback so the user can do additional transformation to the generated object definition. |
Given that the purpose of this babel plugin is to remove imports of |
I think if you're only using Apollo, it's safe to remove. Would you accept a PR that changes the options to have Happy to change naming too if you feel strongly |
Not sure if this is possible or needed by the babel plugin, but it would be great to remove the "source" part of the "loc" object. It seems to just be bloat since the query is preprocessed into other objects.
The text was updated successfully, but these errors were encountered: