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

Add operation export name #4020

Merged
merged 4 commits into from
Aug 3, 2020
Merged

Add operation export name #4020

merged 4 commits into from
Aug 3, 2020

Conversation

aspirisen
Copy link
Contributor

This PR is relative to this issue #3949

It allows you to add operation name to output file.

@dotansimha
Copy link
Owner

Thanks @aspirisen !

This should work only with .d.ts output, right? it won't work with .ts extension? because some configuration flags might effect that as well.

Also, have you checked graphql-let (https://github.com/piglovesyou/graphql-let#readme) package? it should does that automatically as far as I know.

@aspirisen
Copy link
Contributor Author

aspirisen commented May 17, 2020

@dotansimha Yes, it would work only in d.tsfiles, but it is up to user because there is a flag for that. But if user uses only types this flag will help him to import everything from one file.

I checked graphql-let and there is one issue that stops me using it piglovesyou/graphql-let#60

@dotansimha
Copy link
Owner

If you need to have a more strict path in the module declaration, you can use this configuration: https://github.com/dotansimha/graphql-code-generator/blob/master/packages/plugins/typescript/graphql-files-modules/src/index.ts#L6-L25 (it's not in the docs, we need to update it).

I afraid that the name you set for this variable might conflict with other plugins, we need to check that.

@aspirisen
Copy link
Contributor Author

@dotansimha what variable do you mean, the const export in d.ts?

@dotansimha dotansimha force-pushed the master branch 5 times, most recently from 3ec140a to 4f425e8 Compare June 11, 2020 14:14
@dotansimha
Copy link
Owner

I think we can get this one merged. Thank you @aspirisen , sorry it took so long!

@dotansimha dotansimha merged commit 36cbf18 into dotansimha:master Aug 3, 2020
@theguild-bot
Copy link
Collaborator

The latest changes of this PR are available as alpha in npm: 1.17.8-alpha-36cbf188.0

Quickly update your package.json by running:

npx match-version @graphql-codegen 1.17.8-alpha-36cbf188.0

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.

3 participants