Skip to content

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.

1 participant