benawad / graphql-ts-server-boilerplate

A GraphQL server boilerplate made with Typescript, PostgreSQL, and Redis
693 stars 181 forks source link

Using more type-safe solution #6

Open MichalLytek opened 6 years ago

MichalLytek commented 6 years ago

Hi @benawad! I appreciate your work on this project 😉

I would like to suggest using a more TypeScriptish way of creating a GraphQL server, where all your GraphQL types live with your code, not as a separate definitions converted to interfaces by a CLI: https://19majkel94.github.io/type-graphql

I've experienced the pain of matching and syncing schema, interfaces and resolvers code, that's why I've created this lib: https://medium.com/@19majkel94/graphql-typescript-typegraphql-ba0225cb4bed

I would be grateful if you share your thoughts on this with me 😃

benawad commented 6 years ago

Is it production ready? Does it work with libraries that wrap the executable schema (https://github.com/kadirahq/graphql-errors)? Does it work with directives?

MichalLytek commented 6 years ago

1) Sure! 1.0.0 is just a number, there's only a few docs issue to solve until final release. 2) Yes, it also produce GraphQLSchema instance. 3) Not until exposing schema metadata comes to GraphQL specification. However for many libraries there are workarounds like with apollo-cache-control and for user code you can easily use decorators and middlewares 😉

benawad commented 6 years ago

Cool, after my next series I'll take a look at it