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

Allow es-module-like graphql-import syntax (import * from "...") #22

Open
matuscongrady opened this issue May 15, 2019 · 4 comments
Open

Comments

@matuscongrady
Copy link

Hello,

I'm using webpack-graphql-loader together with graphql-codegen. These tools are using different graphql-import syntax, which means they can't be used together.

I think webpack-graphql-loader uses the non-standard
import "./filenamegraphql"
vs the standard (maybe not "standard", but definitely more common) syntax
import * from "./filenamegraphql"

Could you please add support for the ESM-like syntax? Or consider using ESM-like syntax by default (this would result in a breaking change).

Thank you!

@emahuni
Copy link

emahuni commented Aug 10, 2019

any news on this?

import { theQuery } from './queries.graphql'

is norm, it keeps things modular and small.

@amonks
Copy link

amonks commented Aug 15, 2019

thanks for the issue! 👍

forgive me if I'm misunderstanding what you're asking for, but does this undocumented option meet your needs here?

29da45c

If so, I'd be interested in adding documentation around it 😄

@emahuni
Copy link

emahuni commented Aug 22, 2019

I am not sure what that was :D, could you explain please

@maktouch
Copy link

maktouch commented Dec 8, 2020

import "./filenamegraphql" is standard, it's an import with side-effects. source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

import * from "./filenamegraphql" is not standard, you're missing a name identifier.

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

No branches or pull requests

4 participants