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

Add default export from graphql-tag/loader modules #281

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dobesv
Copy link
Contributor

@dobesv dobesv commented Jan 8, 2020

ES6 modules expect the default export to be named default, rather
than using the module.exports object. By providing an export named
default here, we make the module more directly compatible with ES6 modules.

The benefit of this is that when you import the default export in an ES6 environment
you won't get extra properties on the object for all the named exported operations
and fragments in the file.

This probably doesn't affect too many people, but it's a little cleanup that might save
some trouble / confusion for people who are importing a graphql module and doing more
with it than just feeding it into the apollo client.

ES6 modules expect the default export to be named `default`, rather
than using the `module.exports` object.  By providing an export named
`default` here, we make the module more directly compatible with ES6 modules.

The benefit of this is that when you import the default export in an ES6 environment
you won't get extra properties on the object for all the named exported operations
and fragments in the file.

This probably doesn't affect too many people, but it's a little cleanup that might save
some trouble / confusion for people who are importing a graphql module and doing more
with it than just feeding it into the apollo client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant