Convert to TypeScript
0xR opened this issue · 4 comments
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
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
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.
I thought it can take more, but sure, if you're confident that it's not going to be a long refactoring
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.