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

Wrong component prop type names when using typescript-react-apollo #2160

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

Wrong component prop type names when using typescript-react-apollo #2160

jlkiri opened this issue Jul 12, 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 12, 2019

Describe the bug
As a result of #2116, using operationResultSuffix leads to generation of wrong React Apollo component prop type names. They are not updated, but operation result type name is generated correctly.

To Reproduce

  1. Specify operationResultSuffix in config.yml (e.g. "Response"), when using typescript-react-apollo plugin.
  2. Generate output.
  3. Check the generated file and make sure that TData in generated ReactApollo.DataProps<TData, TGraphQLVariables> has a wrong type name. E.g. MyOperationQuery instead of MyOperationQueryResponse.

Expected behavior
Component prop type names are updated too when operationResultSuffix is used.

Environment:
Any

Additional context
This is my mistake and I will fix in a PR.

@jlkiri jlkiri changed the title Wrong prop type names when using typescript-react-apollo with custom operation result type names Wrong component prop type names when using typescript-react-apollo Jul 12, 2019
@mohsen89z
Copy link

Same! Also, Query argument's name is wrong!

@jlkiri
Copy link
Contributor Author

jlkiri commented Jul 13, 2019

I did some tests and it looks like only generated React Apollo HOC props are affected by the change. The only current workaround is to set withHOC to false.
This is a pretty easy fix, I'll send a PR.

@dotansimha dotansimha added bug plugins waiting-for-release Fixed/resolved, and waiting for the next stable release labels Jul 14, 2019
@dotansimha
Copy link
Owner

Fixed in 1.5.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

3 participants