3 ms·
I may try this out since I am handrolling something similar for a project but I am strapped for time. Only thing is I am generating types from an openapi spec
by darepublic 4y ago
I may try this out since I am handrolling something similar for a project but I am strapped for time. Only thing is I am generating types from an openapi spec and sharing the types with ui as a dependency. I somewhat prefer that approach as I end up with an openapi spec and I don't need any framework whatsoever beyond perhaps a dev dependency on type generation from openapi doc
- goodoldneon 4y agoWhat are you using to codegen the types?
- darepublic 4y agoI haven't done it yet. I've just set up a monorepo and prototyped sharing of types from backend to frontend. Googling it seemed like there were some decent options for type generation from swagger, i.e. https://github.com/drwpow/openapi-typescript https://github.com/drwpow/openapi-typescript
- goodoldneon 4y agoTake a look at https://github.com/bcherny/json-schema-to-typescript https://github.com/bcherny/json-schema-to-typescript, too. I used it successfully at a previous job. IIRC, I had to write some code to convert OpenAPI to JSON Schema but it wasn’t onerous
- nawgz 4y agoI like to use Hasura to give me full GraphQL access to a PostgreSQL/MSSQL database and then I can use graphql-codegen to get real, schema-based frontend types with no need for more tools than Hasura and graphql-codegen. Not sure that'll help you here but it's a thought. I will note the MSSQL version of Hasura seems to be slightly behind in documentation, not sure about features though
- darepublic 4y agounfortunately I am in the anti-graphql camp
- nawgz 4y agoWhy? It has meaningful schemas and therefore type generation, and it performs really well on an implementation like Hasura Surely swagger isn’t a better tool than Hasura and GraphQL-codegen