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

Convert to TypeScript #130

Closed
0xR opened this issue May 18, 2019 · 4 comments
Closed

Convert to TypeScript #130

0xR opened this issue May 18, 2019 · 4 comments

Comments

@0xR
Copy link
Collaborator

0xR commented May 18, 2019

This project currently uses flowtype. Currently there are quite some flow errors. We could fix those, but I think it's more useful to convert the whole project to TypeScript.

I see most graphql ecosystem project use typescript: apollo server/client, graphql-yoga, graphql-tools, graphql nexus etc etc

@yarax
Copy link
Owner

yarax commented May 18, 2019

Unfortunately yes, Flow lost the competition despite had a better design from the beginning. We could do it. But I'd say, Openapi3 support seems to be more important for library end users now

@0xR
Copy link
Collaborator Author

0xR commented May 18, 2019

True, I tried adding OpenAPI 3 support, but to do that safely I'd have to invest a lot in the flow types to make them OpenAPI 2 and 3 compatible. I think it's smarter to try and migrate to Typescript first and then invest more into the Typescript types with the OpenAPI 3 migration.

I think I can migrate to Typescript in a couple of hours.

@yarax
Copy link
Owner

yarax commented May 18, 2019

I thought it can take more, but sure, if you're confident that it's not going to be a long refactoring

@0xR
Copy link
Collaborator Author

0xR commented May 19, 2019

Ok I spent some time on the migration, in doing so I fixed some longstanding bugs! Some of the code I didn't understand, adding better types helped me understand the code and fix the issues. Now there are a lot less empty types in the petstore example.

See my WIP here: https://github.com/yarax/swagger-to-graphql/compare/convert-to-typescript?expand=1

The tests typescript errors are fixed an the tests run. Now I have to fix the lint errors.

@0xR 0xR closed this as completed May 25, 2019
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

2 participants