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

Make suffix of generated query response types customizable #2110

Closed
jlkiri opened this issue Jul 5, 2019 · 3 comments
Closed

Make suffix of generated query response types customizable #2110

jlkiri opened this issue Jul 5, 2019 · 3 comments
Labels
plugins waiting-for-release Fixed/resolved, and waiting for the next stable release

Comments

@jlkiri
Copy link
Contributor

jlkiri commented Jul 5, 2019

Is your feature request related to a problem? Please describe.

componentSuffix option of typescript-react-apollo plugin allows us to generate React Apollo components with arbitrary suffixes. The default is XXXComponent but many would like to generate something like XXXQuery. However, this format is already reserved for generated query response types, e.g.

export type PlayerQuery = ({ __typename?: 'Query' } &
{ player: ({ __typename?: 'PlayerModel' } & Pick<PlayerModel, 'id' | 'username' | 'character'>) });

Describe the solution you'd like

Although type names and component names should not clash, it would be preferrable to be able to also customize names of generated query responses via some similar option in config. I think querySuffix is appropriate.

Describe alternatives you've considered

Is this better done somehow by extending the execution flow?

Additional context

@jlkiri jlkiri changed the title Make suffix of generated query responses customizable Make suffix of generated query response types customizable Jul 5, 2019
@jlkiri
Copy link
Contributor Author

jlkiri commented Jul 5, 2019

I have a working solution but not sure if it is the best way. I can send a PR.

@dotansimha
Copy link
Owner

dotansimha commented Jul 6, 2019

@jlkiri sure, can you please share it here or submit a PR? :) thanks

@dotansimha dotansimha added the waiting-for-release Fixed/resolved, and waiting for the next stable release label Jul 8, 2019
@dotansimha
Copy link
Owner

Available in 1.4.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

2 participants