Skip to content

Commit

Permalink
Re-export graphql-tag exports directly, without destructuring.
Browse files Browse the repository at this point in the history
Seems to fix #8217, judging from the provided reproduction. Presumably
this is because using ECMAScript re-export syntax means we don't have to
import anything into the scope of the index.ts module, which makes
the whole situation easier for the tree-shaker to reason about.
  • Loading branch information
benjamn committed May 14, 2021
1 parent 3f545c0 commit 9609317
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ setVerbosity("log");
// workaround of pulling the extra properties off the `gql` function,
// then re-exporting them separately, helps keeps bundlers happy without any
// additional config changes.
import gql from 'graphql-tag';
export const {
export {
default as gql,
resetCaches,
disableFragmentWarnings,
enableExperimentalFragmentVariables,
disableExperimentalFragmentVariables
} = gql;
export { gql };
disableExperimentalFragmentVariables,
} from 'graphql-tag';

0 comments on commit 9609317

Please sign in to comment.