-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Re-export all public graphql-tag
exports
#5861
Conversation
b870205
to
c78ff36
Compare
Make sure we're re-exporting all public `graphql-tag` exports, while ensuring that valid types exist.
Based on how we're importing and re-exporting `graphql-tag`, we no longer need to leverage Rollup's commonjs plugin `namedExports` feature. Since we're also not building an ESM bundle via Rollup, we don't need to use the commonjs plugin for anything else, so it can be removed.
c78ff36
to
33e83ed
Compare
@hwillson related to this, I have send a PR to update all the But the repository seems a bit abandoned. Do you think you could check it out? It would be great to later be able to export the library as ES Modules. I would like to be able to use |
// then re-exporting them separately, helps keeps bundlers happy without any | ||
// additional config changes. | ||
import gql from 'graphql-tag'; | ||
const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can actually just do export const { ... } = gql
here, to avoid repetition.
// be fully updated to use Typescript, and these discrepancies will be fixed. | ||
|
||
declare module 'graphql-tag' { | ||
function gql(literals: any, ...placeholders: any[]): any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be literals: string[]
?
Make sure we're re-exporting all public
graphql-tag
exports, while ensuring that valid types exist.