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

Configurable gql import #1342

Closed
danielkcz opened this issue Feb 23, 2019 · 6 comments
Closed

Configurable gql import #1342

danielkcz opened this issue Feb 23, 2019 · 6 comments
Labels
plugins waiting-for-release Fixed/resolved, and waiting for the next stable release

Comments

@danielkcz
Copy link
Contributor

danielkcz commented Feb 23, 2019

Is your feature request related to a problem? Please describe.
It's pretty much a recommended way to use graphql.macro for loading graphql files or inlining documents. Since CRA2.0 has babel-plugin-macros includes it's a fairly cheap optimization of runtime code.

Describe the solution you'd like
Add configuration option gqlImportFrom to specify where to find gql.

Describe alternatives you've considered
Perhaps a boolean flag directly for a macro variant?

@IanVS
Copy link

IanVS commented Feb 23, 2019

I think this shouldn't be a Boolean. It would be great if it's flexible, to support other import locations, like Gatsby: #1321

@dotansimha dotansimha added enhancement waiting-for-release Fixed/resolved, and waiting for the next stable release plugins labels Feb 24, 2019
@dotansimha
Copy link
Owner

dotansimha commented Feb 28, 2019

Fixed in graphql-tag-pluck & graphql-toolkit by @kamilkisiela . PR here: #1370

@kamilkisiela
Copy link
Collaborator

kamilkisiela commented Feb 28, 2019

@dotansimha It's not exactly the same. I made graphql-tag-pluck to support any kind of package, either with default or named export but we don't have a way to define those packages in graphql-code-generator through codegen.yml.

By default we use the default export from graphql-tag package and graphql from gatsby.

@kamilkisiela
Copy link
Collaborator

@dotansimha #1376 should enable that

@kamilkisiela
Copy link
Collaborator

@dotansimha
Copy link
Owner

Available in 0.18.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugins waiting-for-release Fixed/resolved, and waiting for the next stable release
Projects
None yet
Development

No branches or pull requests

4 participants